Advertisement:

Author Topic: Expert SSI FAQ  (Read 131622 times)

Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Expert SSI FAQ
« Reply #40 on: November 19, 2004, 04:14:03 AM »
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."

Offline Elissen

  • Full Member
  • ***
  • Posts: 466
  • Gender: Male
    • ICSC
Re: Expert SSI FAQ
« Reply #41 on: November 19, 2004, 06:11:24 AM »
Very true :). It must be disabled somewhere for SSI, but I have no idea where. Maybe one of the developers can comment on this.

Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Expert SSI FAQ
« Reply #42 on: November 19, 2004, 06:48:31 AM »
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."

Offline giga

  • Newbie
  • *
  • Posts: 2
Re: Expert SSI FAQ
« Reply #43 on: January 31, 2005, 02:02:32 PM »
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

Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Expert SSI FAQ
« Reply #44 on: January 31, 2005, 02:05:05 PM »
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."

Offline Reinier

  • Semi-Newbie
  • *
  • Posts: 10
Re: Expert SSI FAQ
« Reply #45 on: February 11, 2005, 04:12:47 PM »
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?

« Last Edit: February 13, 2005, 05:58:54 PM by Reinier »

Offline Reinier

  • Semi-Newbie
  • *
  • Posts: 10
Re: Expert SSI FAQ
« Reply #46 on: February 13, 2005, 05:59:00 PM »
Okay, I found the solution here: http://www.simplemachines.org/community/index.php?topic=20394.0
Thanks [Unknown] :)

Offline jazz

  • Jr. Member
  • **
  • Posts: 331
Re: Expert SSI FAQ
« Reply #47 on: April 16, 2005, 04:47:32 PM »
Code: [Select]
<?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...

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: Expert SSI FAQ
« Reply #48 on: April 16, 2005, 04:49:13 PM »
You can pull allmost everything from forum with SSI.

Example, avatar:

Code: [Select]
<?
 
if ($context['user']['is_logged'])
{
   
echo '', $context['user']['avatar']['image'], '
 
';

}
?>
« Last Edit: April 16, 2005, 04:58:44 PM by Owdy »
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

Offline jazz

  • Jr. Member
  • **
  • Posts: 331
Re: Expert SSI FAQ
« Reply #49 on: April 16, 2005, 05:01:51 PM »
I appreciate you answering this for me.  As I just discovered, a simple search would have done the trick.  Thanks again!

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: Expert SSI FAQ
« Reply #50 on: May 16, 2005, 12:31:37 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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Expert SSI FAQ
« Reply #51 on: May 22, 2005, 12:48:13 AM »
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]

Offline weekend camper

  • Jr. Member
  • **
  • Posts: 212
Re: Expert SSI FAQ
« Reply #52 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).

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? 

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

Offline eclips

  • Newbie
  • *
  • Posts: 1
Re: Expert SSI FAQ
« Reply #53 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.

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Expert SSI FAQ
« Reply #54 on: August 29, 2005, 11:56:11 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")

Offline TXSherry

  • Semi-Newbie
  • *
  • Posts: 83
  • Gender: Female
    • Cactus Blossom Software Co
Re: Expert SSI FAQ
« Reply #55 on: August 30, 2005, 12:00:56 AM »
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.

Code: [Select]

$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

Offline TXSherry

  • Semi-Newbie
  • *
  • Posts: 83
  • Gender: Female
    • Cactus Blossom Software Co
Re: Expert SSI FAQ
« Reply #56 on: August 30, 2005, 12:13:42 AM »
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)

Code: [Select]
<?php
require_once("{$_SERVER[&#39;DOCUMENT_ROOT&#39;]}/forum/SSI.php");
echo &#39;<html><body>&#39;;

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

echo &#39;</body></html>&#39;;

?>



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
Code: [Select]
http://www.privacy.com/forum/index.php?action=membergroups;sa=edit;id=8The number at the end is the id of the group.
You can also go into the tables and look it up :)

HTH,
Sherry



Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Expert SSI FAQ
« Reply #57 on: August 30, 2005, 12:20:30 AM »
If you are looking for a match from one array to another, and then allow if a match is found, try this:

Code: [Select]
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.
« Last Edit: August 30, 2005, 12:39:39 AM by kegobeer »
"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")

Offline Sting

  • Semi-Newbie
  • *
  • Posts: 61
  • Gender: Male
    • Subspace/Continuum Info & Tutorials
Re: Expert SSI FAQ
« Reply #58 on: October 23, 2005, 03:00:30 PM »
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.
« Last Edit: October 23, 2005, 03:03:54 PM by Sting »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Expert SSI FAQ
« Reply #59 on: October 23, 2005, 08:33:30 PM »
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