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

Jerry

but the page wouldn't be generated without SMF, plus I like the looks of the copyright =P, it just looks blank down there without them :(.


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Elissen

Very true :). It must be disabled somewhere for SSI, but I have no idea where. Maybe one of the developers can comment on this.

Jerry

I will look for it :) but if some one could tell me howit would be cool ;D


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

giga

my first post .. hope that help

check out ..

http://www.simplemachines.org/community/index.php?topic=18633.0

or just add

$forum_version = 'SMF 1.0.1';

above the include_once('../SSI.php');

to get the copyright in SSI

Jerry

thanks for pointing that out giga :)


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Reinier

#45
I've been playing with the SSI functions and I like them a lot, finally the main page and forum of my girlfriend's site are integrated!

I use the ssi_boardNews function to display some news items on the main page. I would like to show an image next to the message body (since that is also the way the news items looked before I used SSI). Is there a way to display an image that is attached to the message? Just displaying the image http://mydomain.com/smf/index.php?action=dlattach;id=X [nofollow] is not possible, since it is unknown what the ID of the image is.

Does anybody have a clue how to do this?


Reinier


jazz

<?php ssi_welcome(); ?>  Just shows Welcome User you have so many messages...

Is there any way to add all the information from the welcome box for the forum?  Recent posts, avatar, etc...

Owdy

#48
You can pull allmost everything from forum with SSI.

Example, avatar:

<?

if ($context['user']['is_logged'])
{
   
echo '', $context['user']['avatar']['image'], '
 
';

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

jazz

I appreciate you answering this for me.  As I just discovered, a simple search would have done the trick.  Thanks again!

Owdy

Quote from: Tomer on June 28, 2004, 07:31:34 PM


Glad you asked, because just so happens as there is some more, SSI has some advanced configuration that you can define with a simple code, here are the configurations that you can change.

$ssi_gzip = 'true/false';
$ssi_ban = 'true/false';
$ssi_theme = 'themeID#';
$ssi_layers = array('main');

Do we have more of them now?
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

[Unknown]

The true/false ones CANNOT be 'true' or 'false'.  They simply will not do anything.  They must be true (without quotes!) or false.

$ssi_gzip = true;
$ssi_maintenance_off = true;
$ssi_ban = true;
$ssi_theme = 1; // <-- integer, please, no quotes.
$ssi_layers = array('main', 'etc');

-[Unknown]

weekend camper

Not able to get my head around a 'quick' way to let selected member groups have access to certain page content.  I am dealing with roughly 30 member groups and at different times will be using up to 29 groups (ie, excluding one or two groups or more).

questions:

1 - how to exclude a group using (in_array(1, $user_info['groups']))

self answered:  (!in_array(1, $user_info['groups']))

2 - is there any easy way to cycle through, say 10 groups in (in_array(X, $user_info['groups']))?
like with an array in a loop?  Or should I just write it long ways like below? 

(!in_array(12, $user_info['groups'])) || (!in_array(23, $user_info['groups'])) || (!in_array(54, $user_info['groups'])) etc?

eclips

How do I translate $user_info['groups'] into something I can use from the web board?

The $user_info array does not exist. I found most things such as $user_info['username'] had to be changed to $context['user']['name'] but I can't find anything in $context for the membergroup.

kegobeer

Quote from: eclips on August 29, 2005, 10:42:45 PM
How do I translate $user_info['groups'] into something I can use from the web board?

The $user_info array does not exist. I found most things such as $user_info['username'] had to be changed to $context['user']['name'] but I can't find anything in $context for the membergroup.

What are you trying to do?  Can you give an example of what you are looking for?
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

TXSherry

Quote from: weekend camper on August 05, 2005, 06:54:00 PM
Not able to get my head around a 'quick' way to let selected member groups have access to certain page content.  I am dealing with roughly 30 member groups and at different times will be using up to 29 groups (ie, excluding one or two groups or more).

...8<...snippity....8<.....

2 - is there any easy way to cycle through, say 10 groups in (in_array(X, $user_info['groups']))?
like with an array in a loop?  Or should I just write it long ways like below? 



Here's one way to skin this cat.  Junk echos included for ease of transforming it to your own use.



$go_away_groups=array(2,3,5,7,2,10,6,40);
$go_away = false;

foreach ($go_away_groups as $grp)
{
    if (in_array($grp, $user_info['groups'])) $go_away =true;
}


if  ($go_away)    echo 'Go away!';
else                    echo 'Come on in!';



HTH,
Sherry

TXSherry

Quote from: eclips on August 29, 2005, 10:42:45 PM
How do I translate $user_info['groups'] into something I can use from the web board?

The $user_info array does not exist. I found most things such as $user_info['username'] had to be changed to $context['user']['name'] but I can't find anything in $context for the membergroup.

You don't need to translate it, but do use the in_array as shown to test for if the 'Group ID#' is in the array of the
'person accessing the page'.
(Englishizing it)

If you wonder what $user_info['groups'] holds, then make yourself a test page and print_r() it.

So, to get to the answer of your question.  how to use it from your web board.

Well, I'm having trouble with your phrasing.  If you mean the Bulliten board (Forum) when you say 'web board', then you use it as is, and as the example given.

However, if by web board you mean you want to use it on your web site, outside of your forum, then try this.   make this test page, and pull it up. (ftp it or run it locally, however you work)


<?php
require_once("{$_SERVER['DOCUMENT_ROOT']}/forum/SSI.php");
echo 
'<html><body>';

if (
in_array(18$user_info['groups'])) 
      echo 
'Hello, you ARE in group #18.';
else
      echo 
'Hello, you are NOT in group #18.';

echo 
'</body></html>';

?>




Now, to find out what group # the group you want to test is, DO
Admin > edit membergroups

And run your mouse over the MODIFY beside the group names, and look at your status bar, you should see something like
http://www.privacy.com/forum/index.php?action=membergroups;sa=edit;id=8
The number at the end is the id of the group.
You can also go into the tables and look it up :)

HTH,
Sherry



kegobeer

#57
If you are looking for a match from one array to another, and then allow if a match is found, try this:

if (array_intersect($allowed_groups, $user_info['groups']))
{
 ... allowed code ..
} else {
  ... denied code ...
}


Of course, this assumes both $allowed_groups and $user_info['groups'] are arrays.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Sting

#58
Ok I have a problem http://www.sscont.x10hosting.com/xf/

ok I am calling the ssi_welcome(); but no matter if the user is logged in or not it gives the:

Welcome, Guest. Please login or register.

Does this mean they have to sign in through the site itself where it is being shown or do I need to change something?

Also by this happening it keeps the user of who's online shown as both a guest and a member if I use ssi_logOnline();. I even tried using just the ssi_whosOnline(); but it won't help. when I look at the examples the welcome tage works as it should.

JayBachatero

check if Help     Use subdomain independent cookies are on in admin > features and options
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: