News:

Wondering if this will always be free?  See why free is better.

Main Menu

$content doesn't work

Started by Shunt, December 24, 2006, 05:30:52 AM

Previous topic - Next topic

Shunt

Hi,

I am trying to access the login form (made with SSI) in coppermine, by adding a custom header and footer (both php files) through the coppermine admin theme settings.

The $content variables do not seem to be loaded, because of some conflict between coppermine and the SMF SSI file (If I access the login script file directly, it works just fine).

The code of my login script (pretty basic):

<table class="moduletable" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <th valign="top">
  <?PHP
include_once("../forums/SSI.php");
$url = "http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"];
$_SESSION['login_url'] = $url;
$_SESSION['logout_url'] = $url;
if ($context['user']['is_guest']){
echo("Login Form");
}
elseif($context['user']['is_logged']){
echo("Welcome back!");
}
?></th>
    </tr>
    <tr>
      <td><?
 
if ($context['user']['is_guest']){
echo("Welcome Guest, please login below, or <a href=index.php?page=forum&action=register>register for free</a> to access more features of this website.");
ssi_login($url);
}
elseif($context['user']['is_logged']){
echo("<div align=center>");
echo($context['user']['avatar']['image']);
echo("<br>");
echo("Welcome back, <b>". $context['user']['name'] ."</b>!</div> <br><font size='1'>You have a total of ". $context['user']['messages'] ." messages, ");
if ($context['user']['unread_messages'] > 0){
echo("<a href=''>whereof ". $context['user']['unread_messages'] ."new.</a>");
}
else{
echo("but no new ones.");
}
echo("<br><br></font>");
echo("<a href='index.php?page=forum&action=profile'>View Profile</a><br>");
ssi_logout($url);
}
?>
      </td>
    </tr>
  </tbody>
</table>


Then, in the header.php I made, this is fetched through:

<?PHP
ob_start();
include("newlogin.php");
$parsed = ob_get_clean();
$parsed = str_replace( "index.php?","http://www.kristenonline.net/cms/index.php?", $parsed );
$parsed = str_replace( "http://www.kristenonline.net/cms/forums/http://www.kristenonline.net/cms/index.php?action=","http://www.kristenonline.net/cms/index.php?page=forum&action=", $parsed );

echo $parsed;
?>


This is needed to rewrite the forum urls, since the forum itself is wrapped too.
Accessing both the header.php or the login script directly will make it work fine, but when used in coppermine the whole login script part is empty, since basically all of the if ($context['*']['*']) statements return false.

I am using SMF 1.1 RC2 and CPG 1.4.10 (stable)

Dannii

SSI.php needs to be included at the very very VERY top of your file, even above the doctype if you have one.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Shunt

#2
I tried that by including it at the very top of the coppermine index.php and even in the top of the header.php (which also contains the html <head>), but both give the same result.

Dannii

Do you get any errors in your error log?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Shunt

Nope, no errors reported whatsoever.

Orstio


Shunt

That fixed it, awesome!
Thanks a ton!

brelwit

#7
I'm wondering what files to include in the COPPERMINE Admin Page, header and footer fields. I have SMF and Coppermine installed. Also have setup the bridge successfully. Now, I am lost on what to do in including my SMF forum's header and footer in my Coppermine gallery pages. I can't find any header or footer files in SMF. There is only index.template.html which contains functions. Since Coppermine requires 2 files: 1 for the Header and 1 for the footer, which files will I use? 

I posted here because it seems somebody was able to successfully do a similar thing that I want.  I am just not sure how it was done as there are some missing info.  Hope somebody can help.  Thanks in advance!

Advertisement: