Advertisement:

Author Topic: Basic SSI FAQ  (Read 155323 times)

Offline jonidfld

  • Semi-Newbie
  • *
  • Posts: 42
Re: Basic SSI FAQ
« Reply #120 on: June 24, 2007, 09:38:25 AM »
Ok no joy.

Im using this as my path to SSI at the very top of the page....

Code: [Select]
<?php require("D:\hshome\accountname\website.com\forum\SSI.php"); 
?>

Then inputing...

Code: [Select]
<?php ssi_recentTopics(); ?>

or

ssi_welcome();

but neither work.

Hmmmmm.  ::)

i am using a CMS system would that annoy it?  :-[

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #121 on: June 24, 2007, 09:42:43 AM »
I am guessing here, but it appears you are using this on your local PC. I am certain your path is wrong, but I am not sure what to do to make it right.

Try this:

require(".\SSI.php");

or something similar

maybe this:

require('SSI.php');


If that does not work, where are you putting the SSI.php? In an html extension file? If so, is SSI.php before the html tag?

If you can see the forum, open the ssi_examples.php file and you will see how to write the require SSI.php

For example:

http://www.yoursite.com/ssi_examples.php

« Last Edit: June 24, 2007, 10:05:16 AM by spottedhog »

Offline jonidfld

  • Semi-Newbie
  • *
  • Posts: 42
Re: Basic SSI FAQ
« Reply #122 on: June 24, 2007, 01:24:25 PM »
i am sure this is the correct path, as i have used it for other things linked to the forum, such as the gallery & server settings etc.

But im gona try your suggestions now.

Time to play around with it again!!!  :P

Offline jonidfld

  • Semi-Newbie
  • *
  • Posts: 42
Re: Basic SSI FAQ
« Reply #123 on: June 24, 2007, 01:47:54 PM »
 :( no luck, can anyone help?  ::)

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #124 on: June 24, 2007, 03:06:41 PM »
You opened the ssi_examples.php file in your browser and it gave you the same path as the one you are using?

Offline jonidfld

  • Semi-Newbie
  • *
  • Posts: 42
Re: Basic SSI FAQ
« Reply #125 on: June 24, 2007, 03:13:42 PM »
You opened the ssi_examples.php file in your browser and it gave you the same path as the one you are using?

Exactly yes. The path is fine.

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #126 on: June 24, 2007, 03:26:33 PM »

Offline jonidfld

  • Semi-Newbie
  • *
  • Posts: 42
Re: Basic SSI FAQ
« Reply #127 on: June 25, 2007, 12:49:56 PM »

Offline rch10007

  • Semi-Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Teens 4 Christ
Re: Basic SSI FAQ
« Reply #128 on: July 20, 2007, 09:40:29 PM »
EDIT - The following problem was resolved by eliminating the FlashChat section in the Subs file.  I'm not sure why yet so I have to figure it out but I guess it's a bug either way...  I guess I'll email the guy who made it to let him know him I had trouble with his Mod.  I think because the install was an integration with SMF, a few tables didn't get made in the DB...

Any ideas about this?

************************************************************
**BEFORE clicking the page, read all the way down first...

Anyone else get this error from my forum?  The URL: http://www.teens4christ.org/forum/ssi_examples.php [nofollow] and the error is:

Code: [Select]
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at www.teens4christ.org Port 80

Ok, I also just noticed that I get a gazillion error messages on the forum after trying to access that page.  Here is the error messages repeated over and over:

Code: [Select]
Database Error: No Database Selected
File: /path/to/forum/Sources/Subs.php
Line: 3379

...and here is that query in the Subs.php file:

Code: [Select]
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$GLOBALS['fc_config']['db']['pref']}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$GLOBALS['fc_config']['db']['pref']}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);

Now, I just realized that this query is in the FlashChat integration section of this file!  Why would I get these errors from trying to access the ssi_examples file???
« Last Edit: July 20, 2007, 10:28:08 PM by rch10007 »
~Robbie~

Personally, I don't think there's intelligent life on other planets. Why should other planets be any different from this one? -- Bob Monkhouse

Offline evulness

  • Semi-Newbie
  • *
  • Posts: 51
  • Gender: Male
    • Evulart Studios, Inc.
Re: Basic SSI FAQ
« Reply #129 on: July 26, 2007, 12:13:55 PM »
this should be working....
Code: [Select]
<?php
require("smf/SSI.php");
if (
$context['user']['is_guest'])
   {
      echo 
' You are not logged in!';
   }
else
   {
      echo
      
'<h5>Welcome '$context['user']['name'], '!</h5>';
   }
?>


it shows the Welcome, and the ! but not the users name...
aka me, logged in on my admin account for the smf

i dont understand whats wrong? it should be showing "Welcome <username>!" right?

EDIT: let me elaborate... i have SMF installed in a folder called "smf" in my root directory my page files aka index.php are in the root folder...
this should work... no?
« Last Edit: July 26, 2007, 12:34:04 PM by evulness »

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #130 on: July 26, 2007, 05:17:39 PM »
just below the "require" put: 

global $context;


then it will work ....  sorry about that

Offline dhimes

  • Semi-Newbie
  • *
  • Posts: 13
Re: Basic SSI FAQ
« Reply #131 on: July 29, 2007, 10:13:56 AM »
It appears that $context and $user_info are not global across directories-- even when using
require_once(<path>/SSI.php)
global $context, $user_info;

The symptoms of this are that a user can log in, but when going to another page see, "welcome, guest."  This happens on SMF's very webpages, also.


I also had to add $user_info to the global line in SSI.php (essentially line 193 in SMF 1.1.3).  However, it still doesn't recognize that I am logged in when I go across directories.  I think this is the problem lots of people are having.  Quick fix:  put all of your pages in the same directory as SSI.php.  More elaborate/universal fix?  I may need help.

I will attempt to draw the directory structure so the experts can see:

                                    web root
                                    /             
                                   /               
                                product       
                                    |
                                    |
                                product version
                                    |                    \
                                    |                      \
                                 forum                 other pages
                              <SSI.php>             <landingPage.php>


I want registered users to have access to "landingPage.php"
SMF (and SSI.php) is in the 'forum' directory.  But:  when a user logs in to
SMF, then loads "landingPage.php", he/she is not seen as logged in, but
is seen as a guest.


The 'global' command is not working.

As I mentioned, this is also happening on SMF's webpages.  When I come across it again, I'll post it.  It definitely happens when going to "docs.simpl...', but I think this is by design.

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #132 on: July 29, 2007, 10:36:35 AM »
I was having similar problems and recently started using this:

Code: [Select]
require($_SERVER['DOCUMENT_ROOT'].'/SSI.php'); //add directory if SSI.php is outside Root domain
Now at least I know the path to SSI.php is correct.

Offline dhimes

  • Semi-Newbie
  • *
  • Posts: 13
Re: Basic SSI FAQ
« Reply #133 on: July 29, 2007, 10:54:34 AM »
OK--I'll try it.  Also, this works:

                     forum
                       |
                       |
                    otherPages

That is, using SSI in subdirs works, just not "above."  Even $GLOBAL doesn't save me. 

I'm thinking I could save the username in the session table, then just query for the permissions when people get to the page.  Does that sound sensible?  Seems like using a cannon to hunt a sparrow...

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: Basic SSI FAQ
« Reply #134 on: July 29, 2007, 11:47:27 AM »
I have tested that line of code on a page 10 directories deep/up and it works fine.

Offline dhimes

  • Semi-Newbie
  • *
  • Posts: 13
Re: Basic SSI FAQ
« Reply #135 on: July 29, 2007, 02:15:48 PM »
Nope--doesn't work for me.  Neither 'require' nor 'require_once' do it.  I am doing this on a windows XP local host, but my public environment will be unix.  Maybe the OS has something to do with it.  I am using SSI to protect pages (check access--I wrote my own routine in SSI.php).  It works in dirs <forum> or below, but not above.  Thanks for your help, anyway.

Offline xyxis_fahim

  • Jr. Member
  • **
  • Posts: 213
Re: Basic SSI FAQ
« Reply #136 on: July 30, 2007, 10:28:02 PM »
I'm very new to this interesting feature.
Everything works & ssi shows up great. But how can you move around the functions? Such as from the very top of the board to bottom of the forum?

And help will be much appreciated :)

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,777
  • Gender: Male
    • joshuaadickerson on GitHub
    • joshuaadickerson on LinkedIn
Re: Basic SSI FAQ
« Reply #137 on: July 31, 2007, 05:13:33 AM »
Please start a new topic for SSI questions.
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?