SSI.php in Efiction script

Started by Washi, September 25, 2005, 09:31:11 PM

Previous topic - Next topic

Washi

Hi, I'm trying to put the ssi.php include in the efiction script, but I'm having some problems. I hope this is the right forum for it. The thing is, there is no <html> in the efiction script. It starts with a header.php file:


Quote<?php

session_start();
Header('Cache-Control: no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
header ("Pragma: no-cache");
header ("Expires: 0");

if(ini_get("magic_quotes_gpc") == ("" || "0"))
{
   while($element = each($_POST))
   {
      if(($element['key'] != "gid") &&  ($element['key'] != "charid") && ($element['key'] != "wid"))
      {
          $$element['key'] = addslashes($element['value']);
       }
   }
}

if($_POST)
{
   while($element = each($_POST))
   {
      if(($element['key'] != "gid") &&  ($element['key'] != "charid") && ($element['key'] != "wid"))
      {
          $$element['key'] = strip_tags($element['value'], '<br><b><i><u><center><img><a><hr><p><ul><li><ol>');
       }
   }
}

include ("config.php");

if ($_SESSION['loggedin'] == "1")
{
   $userpenname = $_SESSION['penname'];
   $useruid = $_SESSION['uid'];
   $skin = $_SESSION['userskin'];
   if(isset($skinnew))
   {
      unset($_SESSION['userskin']);
      $_SESSION['userskin'] = "$skinnew";
   }
}
include ($databasepath."/dbconfig.php");
include ("lib/class.TemplatePower.inc.php");
include ("languser.php");

$home = "<a class=\"menu\" href=\"index.php\">"._HOME."</a>";
$catslink = "<a class=\"menu\" href=\"categories.php\">"._CATEGORIES."</a>";
$recent = "<a class=\"menu\" href=\"search.php?action=recent\">"._RECENTLYADDED."</a>";
$authors = "<a class=\"menu\" href=\"authors.php?action=list\">"._AUTHORS."</a>";
$help = "<a class=\"menu\" href=\"help.php\">"._HELP."</a>";
$search = "<a class=\"menu\" href=\"search.php\">"._SEARCH."</a>";
$titles = "<a class=\"menu\" href=\"titles.php\">"._TITLES."</a>";

if ($_SESSION['loggedin'] == "1")
{
   $login = "<a class=\"menu\" href=\"user.php\">"._YOURACCOUNT."</a>";

   $logout = "<a class=\"menu\" href=\"user.php?action=logout\">"._LOGOUT."</a>";

   if ($_SESSION['adminloggedin'] == "1")
   {
      $adminarea = "<a class=\"menu\" href=\"admin.php\">"._ADMIN."</a>";
   }
}
else
{
   $login = "<a class=\"menu\" href=\"user.php\">"._LOGIN."</a>";

   if ($_SESSION['adminloggedin'] == "1")
   {
      $adminarea = "<a class=\"menu\" href=\"admin.php\">"._ADMIN."</a> ";
   }
}

echo "<html>";
echo "<head>";
echo "<title>";
$sitename = stripslashes($sitename);
$slogan = stripslashes($slogan);
echo "$sitename :: $slogan";
echo "</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"skins/$skin/style.css\">";
include ("javascript.js");
echo "</head>";
?>

Which is confusing. I tried putting the <?php require('./forums/SSI.php');?> after the first <? like so:

Quote<?php

require('./forums/SSI.php');

session_start();
Header('Cache-Control: no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
header ("Pragma: no-cache");
header ("Expires: 0");

if(ini_get("magic_quotes_gpc") == ("" || "0"))
{
   while($element = each($_POST))
   {
      if(($element['key'] != "gid") &&  ($element['key'] != "charid") && ($element['key'] != "wid"))
      {
          $$element['key'] = addslashes($element['value']);
       }
   }
}

but that gave me this error:

Quote
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/user/public_html/shane/forums/Sources/Subs.php on line 232

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/user/public_html/shane/forums/Sources/Load.php on line 40

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/user/public_html/shane/forums/Sources/Load.php on line 42

Notice: Undefined index: time_format in /home/user/public_html/shane/forums/Sources/Load.php on line 176

Notice: Undefined index: theme_guests in /home/user/public_html/shane/forums/Sources/Load.php on line 657

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/user/public_html/shane/forums/Sources/Subs.php on line 232

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/user/public_html/shane/forums/Sources/Load.php on line 683

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/user/public_html/shane/forums/Sources/Load.php on line 693

Notice: Undefined index: theme_url in /home/user/public_html/shane/forums/Sources/Load.php on line 700

Notice: Undefined index: images_url in /home/user/public_html/shane/forums/Sources/Load.php on line 701

Notice: Undefined index: theme_dir in /home/user/public_html/shane/forums/Sources/Load.php on line 702

Notice: Undefined index: smiley_sets_known in /home/user/public_html/shane/forums/Sources/Load.php on line 721

Notice: Undefined index: smiley_sets_default in /home/user/public_html/shane/forums/Sources/Load.php on line 721

Warning: array_unshift(): The first argument should be an array in /home/user/public_html/shane/forums/Sources/Load.php on line 762

Notice: Undefined index: theme_dir in /home/user/public_html/shane/forums/Sources/Load.php on line 822

Notice: Undefined index: default_theme_dir in /home/user/public_html/shane/forums/Sources/Load.php on line 824

Notice: Undefined index: default_theme_dir in /home/user/public_html/shane/forums/Sources/Load.php on line 831
index

Any idea on how to fix that? Thanks. :D

calash

I got it to work with the smf_api.php file.....the download link is in the code forum.

Was not perfect but it did an OK job, logged me in automatically and worked OK.  You would still have to setup a way to sync the user account fields, or alter all the queries in the script to look at SMF user data...a bit of a pain but can be done.


On a side note I am working on integrating eFiction into SMF as a mod.  It is going slowly, but slow is better than not at all ;)

Washi

Quote from: calash on September 27, 2005, 03:45:24 PM
I got it to work with the smf_api.php file.....the download link is in the code forum.

Was not perfect but it did an OK job, logged me in automatically and worked OK.  You would still have to setup a way to sync the user account fields, or alter all the queries in the script to look at SMF user data...a bit of a pain but can be done.


On a side note I am working on integrating eFiction into SMF as a mod.  It is going slowly, but slow is better than not at all ;)

Thanks for replying. I don't want to put a login box though, I want something along the lines of the last 10 posts. I don't mind having 2 databases (one for eFiction and one for SMF), so user integration is not the prob.
Like I said, last 10 posts, and I'm happy.
Maybe I should just wait for your mod. :D

calash

I tend to go overboard ;)

SSI.php would probably be the best bet then, much easier to pull the data you want.

Not sure why you got the errors, I have not spent much time using the SSI yet.  It looks like it may be having trouble finding the path back to SMF.

Washi

It's because I'm supposed to put a small line before the <html>, but there is no <html> in the coding, so I need to know where to put the little include for it to work. That's pretty much what I'm confused about. :D

Advertisement: