News:

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

Main Menu

SMF 2.0.5 SSI help! Graphics no longer display after using SSI

Started by gman035, September 24, 2013, 04:06:56 PM

Previous topic - Next topic

gman035

Hello everyone, I am having some trouble getting SSI to work and I have no idea why. I using a host that supports SSI (I've already run all the tests a Google search could provide to prove it, and contacted my provider who confirmed their servers can make use of SSI), and a fresh install of SMF 2.0.5 with only the Custom Form Mod installed (and which I don't think would cause any problems for use of SSI anyway).

I've also gone through about every search term combination and document I could find on SMF without seeing any reference to my specific issues. If this problem was solved elsewhere please feel free to post a link and smack me. I should also mention that am not super savvy when it comes to coding. I can handle basic html/ssi, but that's about it. I'm learning, but I'm still a noob, so there is probably some simple fix that I am completely missing.

Moving on to the problem at hand:

My website was coded for me by a person whom I haven't spoken to in a long time, and haven't been unable to get in contact with for over a year. The pages work well, but they were written in .html and not .shtml or .php.

To use the SSI I followed the instructions and placed <?php require("/home/BLANK/public_html/forum/SSI.php"); ?> at the very top, line 1, of my index.html as instructed, and renamed the page to a .php. I acquired the path using my own install of SMF as instructed just to be 100% sure I had the path right. Needless to say, it worked... sort of. I can connect to SSI, but any time I use SSI in my page, the page sort of... explodes. It goes from being nicely formated with all the graphs, to just a white page containing the html. Its like the CSS just stops working. But I'm getting ahead of myself... to help you all out the whole HTML code looks like this:
<?php require("/home/BLANK/public_html/forum/SSI.php"); ?>
<html>
<head>
<neta name="description" content="information here">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Roche</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- Container -->
<div id="container">
   <div id="top">
       <!-- Message / Header / Navigation -->
       <h3>Welcome to Roche</h3>
       <div id="header">
            <div id="header_link" onClick="location.href='index.html';"></div>
            <ul id="menu">
                <li id="home"><a href="index.php"><img src="images/nav/home.gif" alt="" /></a></li>
                <li id="roster"><a href="rules.php"><img src="images/nav/rules.gif" alt="" /></a></li>
                <li id="awards"><a href="staff.php"><img src="images/nav/staff.gif" alt="" /></a></li>
                <li id="forums"><a href="forums.php"><img src="images/nav/forums.gif" alt="" /></a></li>
                <li id="about"><a href="factions.php"><img src="images/nav/factions.gif" alt="" /></a></li>
                <li id="servers"><a href="application.php"><img src="images/nav/application.gif" alt="" /></a></li>
            </ul>
      </div>
  </div>
 
  <div id="middle">
      <!-- Left field -->
      <div id="left">
          <!-- Left column #1: Latest matches -->
          <div class="left_column">
              <h3>TEST TITLE 1</h3>
              <ul>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
              </ul>
          </div>
         
          <!-- Left column #2: Latest threads -->
          <div class="left_column">
              <h3>TEST TITLE 2</h3>
              <ul>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
              </ul>
          </div>
         
          <!-- Left column #3: Team sponsors -->
          <div class="left_column">
              <h3>TEST 3</h3>
              <ul>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
              </ul>
          </div>
         
          <!-- Left column #4: Team sponsors -->
          <div class="left_column">
              <h3>TEST 4</h3>
              <ul>
                  <li><a href="#">Test</li>
                  <li><a href="#">Test</li>
              </ul>
          </div>
         
          <!-- Left column #5: Team sponsors -->
          <div class="left_column">
              <h3></h3>
              <div class="sponsor_pic"><a href=""><img src="" alt="" /></a></div>
          </div>                   
      </div>
     
      <!-- Content -->
      <div id="content">
          <!-- Content post #1: New website -->
          <div class="post">
              <h3>title</h3>
              <div class="post_pic"><img src="images/news/pic_1.gif" alt="" /></div>
              <div class="post_text">
                 <p>
Text Goes Here
                 </p>
              </div>
              <div class="post_info">
              </div>
          </div>
         
          <!-- Content post #2: New website -->
          <div class="post">
              <h3>title 2</h3>
              <div class="post_pic"><img src="images/news/pic_1.gif" alt="" /></div>
              <div class="post_text">
                 <p>
Text Goes Here
                 </p>
              </div>
              <div class="post_info">
              </div>
          </div>
         
          <!-- Content post #3: New website -->
<div class="post">
              <h3>title 2</h3>
              <div class="post_pic"><img src="images/news/pic_1.gif" alt="" /></div>
              <div class="post_text">
                 <p>
Text Goes Here
                 </p>
              </div>
              <div class="post_info">
              </div>
          </div>
          </div>
      </div>
      <div style="clear: both;"></div>
   </div>
</div>
<!-- Footer -->
<div id="footer"></div>
</body>
</html>



I'll include the SSI that page uses here:
body
{
padding: 0px;
margin: 0px;
background-color: #343434;
}

#container
{
width: 884px;
height: auto;
background-image: url('images/container_bg.gif');
overflow: hidden;
padding: 0px;
margin: 0px auto 0px auto;
}

/**
* Links
*/

a
{
font: 11px tahoma;
text-decoration: none;
color: #000000;
font-weight: bold;
}

a:hover
{
text-decoration: underline;
}

/**
* Top
*/

#top
{
width: 818px;
height: 165px;
background: url('images/top_bar.gif') top left no-repeat;
margin-left: 32px;
}

#header
{
width: 816px;
height: 137px;
background: url('images/header1.png') no-repeat;
margin: 1px 0px 0px 2px;
}

#header_link
{
width: 816px;
height: 100px;
cursor: pointer;
}

#top h3
{
font: 10px tahoma;
margin: 0px;
padding: 4px 0px 0px 7px;
}

/**
* Menu
*/

ul
{
margin: 0px;
padding: 0px;
list-style: none;
}

ul li
{
float: left;
}

#menu
{
height: 48px;
background: url('images/menu_bar.gif') bottom no-repeat;
}

#menu a:hover
{
border: 0;
}

#menu a img
{
display: block;
border: 0px;
width: 136px;
}

#menu a
{
height: 35px;
display: block;
float: left;
}
#menu a:hover img
{
display: none;
}

#home a
{
width: 136px;
background: url('images/nav/home_hover.gif') no-repeat;
}

#roster a
{
width: 136px;
background: url('images/nav/rules_hover.gif') no-repeat;
}

#awards a
{
width: 136px;
background: url('images/nav/staff_hover.gif') no-repeat;
}

#forums a
{
width: 136px;
background: url('images/nav/forums_hover.gif') no-repeat;
}

#about a
{
width: 136px;
background: url('images/nav/factions_hover.gif') no-repeat;
}

#servers a
{
width: 136px;
background: url('images/nav/application_hover.gif') no-repeat;
}

#middle
{
height: auto;
width: 884px;
background: url('images/middle_bg.gif') bottom left no-repeat;
padding: 1px 0px 6px 32px;
}

/**
* Left
*/

#left
{
float: left;
height: auto;
width: 179px;
margin: 0px;
padding: 0px;
}

.left_column
{
width: 177px;
height: auto;
background: url('images/left_column_header.gif') top center no-repeat;
margin-left: 2px;
}

.left_column a
{
font-weight: normal;
}

.left_column h3
{
font: 11px tahoma;
color: #FFFFFF;
font-weight: bold; 
margin: 0px 0px 7px 0px;
padding: 5px 0px 0px 35px;
}

.left_column ul
{
background: url('images/left_column_bg.gif') no-repeat;
width: 177px;
height: 112px;
padding: 3px 0px 0px 0px;
overflow: hidden;
margin: 0px;
}

.left_column li
{
height: 17px;
width: 177px;
background: url('images/left_column_list.gif') no-repeat;
font: 11px tahoma;
margin: 0px 0px 0px 1px;
padding: 4px 0px 0px 19px;
}

.left_column li span
{
color: #00CC33;
}

.sponsor_pic
{
width: 177px;
height: 97px;
background: urls('images/left_column_bg.gif') no-repeat;
margin-bottom: 2px;
padding-top: 5px;
}

.sponsor_pic img

display: block;
margin: 0px auto 0px auto;
}

.sponsor_pic img
{
border: 0px;
}

/**
* Content
*/

#content
{
float: left;
margin-left: 1px;
}

#content .post
{
width: 638px;
height: auto;
background: url('images/post_top_bg.gif') no-repeat;
margin-bottom: 5px;
}

#content .post h3
{
font: 11px tahoma;
font-weight: bold;
padding: 8px 0px 0px 25px;
margin: 0px 0px 7px 0px;
}

#content .post .post_pic img
{
display: block;
margin: 0px auto 0px auto;
}

#content .post .post_text
{
background-image: url('images/post_text_bg.gif');
font: 12px tahoma;
padding: 0px 25px 7px 25px;
margin: 0px;
}

#content .post .post_text p
{
width: 600px;
word-wrap: normal
padding: 0px;
margin: 9px 0px 0px 0px;
}

#content .post .post_info
{
width: 638px;
height: 24px;
background-image: url('images/post_info_bar.gif');
background-repeat: no-repeat;
}

#content .post .post_info p
{
font: 11px tahoma;
font-weight: bold;
margin: 0px;
padding: 4px 0px 0px 0px;
}

#content .post .post_info .post_left
{
float: left;
padding-left: 20px;
}

#content .post .post_info .post_right
{
float: right;
padding-right: 15px;
}

#content .post .post_info .post_left a
{
color: #acb335;
}

/**
* Footer
*/

#footer
{
width: 884px;
height: 132px;
background: url('images/footer2.gif') no-repeat;
padding: 0px;
margin: 0px auto 0px auto;
}



So lets say for example that I take this bit of code here...
<div id="container">
   <div id="top">
       <!-- Message / Header / Navigation -->
       <h3>Welcome to Roche</h3>


And change it to
<div id="top">
       <!-- Message / Header / Navigation -->
       <<?php ssi_welcome(); ?>


So that I can have the welcome message at the very top of my page above the banner. If I upload that change, all the pictures and other CSS formatting disappears. Blank white page with the html. The SSI input works, I see the "welcome guest" message... but that's about all that works, because everything else breaks.

Can anyone help me with this? I'm really lost at how to connect my webpage to the SMF 2.0.5 SSI without killing my website. :( Any help is appreciated!

Kindred

URL?

Where is this new file, in comparison to your forum directory?

does ssi_examples.php in your forum directory work correctly?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gman035

The link is: http://www.rochefortrp.com/ [nofollow]

The index.php  and styles.css files are in my /home/BLANK/public_html directory, my SMF 2.0.5 install is in the /home/BLANK/public_html/forum/ directory.

You can see that the index.php page is completely broken if you go to the link. So I've made an exact mirror of the index.php and renamed it rules.php. You can see the rules page at http://www.rochefortrp.com/rules.php [nofollow].

The only difference is that the index.php has...
<div id="top">
       <!-- Message / Header / Navigation -->
       <<?php ssi_welcome(); ?>


And the rules.php page has...
<div id="container">
   <div id="top">
       <!-- Message / Header / Navigation -->
       <h3>Welcome to Roche</h3>


The ssi_examples.php page seems to work just fine for me as well... its part of what has me really baffled. :(

I hope this information helps @_@

Kindred

something is very screwy...

First please correct your code

<div id="top">
       <!-- Message / Header / Navigation -->
       <?php ssi_welcome(); ?>
</div>

you had an extra open angle....

Second, your rules.php page is poorly formed...  your head tag is closed before the meta content and css  (and you have meta content misspelled as neta content)

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gman035

Quote from: Kindred on September 24, 2013, 08:54:12 PM
something is very screwy...

First please correct your code

<div id="top">
       <!-- Message / Header / Navigation -->
       <?php ssi_welcome(); ?>
</div>

you had an extra open angle....

Second, your rules.php page is poorly formed...  your head tag is closed before the meta content and css  (and you have meta content misspelled as neta content)

Unfortunately I didn't design the pages, just attempting to tweak them with very, very limited knowledge of what I'm doing. Hence why I'm here to plead for help, because I am way out of my depth.  :'(

I've closed the angle you found and believe I corrected the meta, and it... sort of worked? I mean that as in, my index page now shows images again, but the general organization of those images is all over the place. @_@

As the index is now... somewhat workable? I've deleted the rules.php page. Just for ease of reference, my index page is at www.rochefortrp.com [nofollow]

I appreciate the help and patience so far, I apologize for being such a noob at this

Kindred

Ah... not "all over the place".

They are exactly where they should be per the CSS and divs.

You closed the "container" dive before the openning of the "middle" hence resetting the content to the left.
If you move the close of the container div to just above the "footer" open, it should be good.

and, if you get rid of the height:165px for the top CSS, then that will close up
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mashby

I'm a little curious as to where the /forum/index.php file is though? Is that a work in progress?
Always be a little kinder than necessary.
- James M. Barrie

Kindred

Ah...   I think the FILE is there, but I think that the permissions in the forum directory might also be wonky
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mashby

Ah might be. Seems it will be hard to login or register though. :)

404 doesn't seem to be a permissions thing though, yeah?
Always be a little kinder than necessary.
- James M. Barrie

gman035

Thanks for all the help guys, I really appreciate it all!

I got the directory worked out with a little assistance from customer support from my web host and that part seems to be fixed, and with MASSIVE thanks to Kindred I think I've also worked out the kinks and got SSI working. I greatly appreciate all the support!  ;D

If I can impose for just a second more... I've got one final question that applies here, and I figure I'll ask it instead of having to open a new thread later.

The question is simply... I want to show a single post on a page of my website, but I don't want to show a link to that post, I want to show the content of the post. I've poked around a moment before writing this and got <?php ssi_fetchPosts($postIDs=3$isOverride=true); ?> working on my front front page. The question I have.... is how would I change/write this so that instead of showing a link to the post, it shows the content from that post?

I don't care about the post title or timestamps, if that makes it any easier? I mean just the actual contents of that specific post in order to do such things as write a rules post on the forums, and then link all the content from that post to the front page

Thanks so much for all the help! :)

Kindred

well, first of all, you would use something more along the lines of
ssi_fetchPosts(3,true);

second...


<?php
require_once('SSI.php');
$postsssi_fetchPosts(3,true,'block');
// echo '<pre>'; print_r($posts); echo '</pre>';

foreach($posts as $post)
{
echo 
$post['body'];
}
?>



take out the // comment flag to see what the variables within the array are....
and you can style the output however you want.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gman035

Thanks for the help Kindred, and I'm sorry I'm such a noob, but it didn't work for me and I'm not quite sure why >.<

I put in the code you gave me, and took out the // comment flags, but it returned with:

"Warning: require_once(SSI.php) [function.require-once]: failed to open stream: No such file or directory in /home/BLANK/public_html/index.php on line 93

Fatal error: require_once() [function.require]: Failed opening required 'SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/BLANK/public_html/index.php on line 93"


I'm out of my depth on how how to fix something like this >.<

The continued help (and corrections) are much appreciated!

Kindred

oops.... I used my script directly in the SMF directory. You will have to edit the require_once line with the correct path to SSI.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gman035

Alright, so... I fixed the code to be <?php
require("/home/BLANK/public_html/forum/SSI.php");
$postsssi_fetchPosts(3,true,'block');
// echo '<pre>'; print_r($posts); echo '</pre>';

foreach($posts as $post)
{
echo 
$post['body'];
}
?>

but now I'm getting this error

Fatal error: Cannot redeclare ssi_shutdown() (previously declared in /home/silve823/public_html/forum/SSI.php:197) in /home/silve823/public_html/forum/SSI.php on line 199

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gman035

Well that was a bit of a derp on my part >.< can you tell I'm a newb? lol

The code now looks like this <?php
require_once("/home/BLANK/public_html/forum/SSI.php");
$postsssi_fetchPosts(3,true,'block');
echo 
'<pre>'print_r($posts); echo '</pre>';

foreach(
$posts as $post)
{
echo 
$post['body'];
}
?>


And it sort of worked! The text I wanted is on the page... but so is some massive bit of code o.O the whole thing looks like this:

Array
(
   
  • => Array
            (
                [id] => 3
                [board] => Array
                    (
                        [id] => 1
                        [name] => General Discussion
                        [href] => http://rochefortrp.com/forum/index.php?board=1.0 [nofollow]
                        [link] => General Discussion
                    )

                [topic] => 3
                [poster] => Array
                    (
                        [id] => 1
                        [name] => Ethan Rowlands
                        [href] => http://rochefortrp.com/forum/index.php?action=profile;u=1 [nofollow]
                        [link] => Ethan Rowlands
                    )

                [subject] => TEST
                [short_subject] => TEST
                [preview] => This is a test.
                [body] => This is a test.
                [time] => Today at 12:18:22 AM
                [timestamp] => 1380007102
                [href] => http://rochefortrp.com/forum/index.php?topic=3.msg3;topicseen#new [nofollow]
                [link] => TEST
                [new] => 1
                [is_new] =>
                [new_from] => 0
            )

    )

    This is a test.[/color][/size]

    All of the text in red is visible on my index.php page, but other than that, it DID pull the "This is a test" text from the post. Any thoughts on how to fix this? @_@

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

gman035

Thank you Colin for that fix! And thank you SO MUCH Kindred for putting up with my newbishness, it is appreciated immensely! The support and help here is truly amazing and greatly appreciated :)

Kindred

right.... that's why I included the print_r line as a comment before. :)
It's a useful debug which displays the entire array and lets you pick what content out of that array you want to actually display.
(and, as I said you can then style and format it with normal HTML and CSS - my code just pulls the basic body text, unformatted, at the moment)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: