News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Basic SSI FAQ

Started by Tomer, June 23, 2004, 05:06:24 AM

Previous topic - Next topic

jonidfld

Ok no joy.

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

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


Then inputing...

<?php ssi_recentTopics(); ?>

or

ssi_welcome();


but neither work.

Hmmmmm.  ::)

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

spottedhog

#121
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


jonidfld

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

jonidfld

 :( no luck, can anyone help?  ::)

spottedhog

You opened the ssi_examples.php file in your browser and it gave you the same path as the one you are using?

jonidfld

Quote from: spottedhog 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?

Exactly yes. The path is fine.



rch10007

#128
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:


Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] 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:


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


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


$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???
~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

evulness

#129
this should be working....

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

spottedhog

just below the "require" put: 

global $context;


then it will work ....  sorry about that

dhimes

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.

spottedhog

I was having similar problems and recently started using this:

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.

dhimes

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...

spottedhog

I have tested that line of code on a page 10 directories deep/up and it works fine.

dhimes

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.

xyxis_fahim

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 :)

Joshua Dickerson

Please start a new topic for SSI questions.
Come work with me at Promenade Group



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?

Advertisement: