Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: okbluejays on February 05, 2008, 05:07:12 PM

Title: Try to output board for news on frontpage of site
Post by: okbluejays on February 05, 2008, 05:07:12 PM
I've used this exact piece of code in the past with no issues but now I can not get it to output news to the front of my site

<?php include('http://www.*****/SMF/SSI.php?ssi_function=boardNews;board=2.0;limit=5'); ?>

I get the following message

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/hockey/public_html/index.php on line 15

Warning: include(http://www.hhhockey.net/SMF/SSI.php?ssi_function=boardNews;board=2.0;limit=5) [function.include]: failed to open stream: no suitable wrapper could be found in /home/hockey/public_html/index.php on line 15

Warning: include() [function.include]: Failed opening 'http://www.hhhockey.net/SMF/SSI.php?ssi_function=boardNews;board=2.0;limit=5' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hockey/public_html/index.php on line 15

Any help is appreciated.
Title: Re: Try to output board for news on frontpage of site
Post by: rsw686 on February 05, 2008, 05:17:53 PM
Needs to be more like the following. Change the require statement so that the path is correct relative to your front page. You can leave out the $ssi_ and ssi_shutdown if you don't want to use the theme engine.

<?php
// Theme we're going to use
$ssi_theme = 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip = true;

require('forum/SSI.php');

ssi_boardNews();

ssi_shutdown();
?>
Title: Re: Try to output board for news on frontpage of site
Post by: okbluejays on February 05, 2008, 05:26:34 PM
Ok thank you I am getting closer with your help.

It is displaying most of what I want but I get a message

Notice: SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /home/hockey/public_html/SMF/SSI.php on line 160
Title: Re: Try to output board for news on frontpage of site
Post by: rsw686 on February 05, 2008, 07:09:02 PM
Is the SSI file at that path? If not you need to change the require statement to reflect where the SSI file is at.
Title: Re: Try to output board for news on frontpage of site
Post by: okbluejays on February 05, 2008, 07:29:59 PM
Already adjusted that part but still getting the message appearing above

http://www.hhhockey.net/
Title: Re: Try to output board for news on frontpage of site
Post by: greyknight17 on February 05, 2008, 08:26:59 PM
Just to confirm, did you change the following:

require('forum/SSI.php');

to be:

require('SMF/SSI.php');
Title: Re: Try to output board for news on frontpage of site
Post by: okbluejays on February 05, 2008, 11:06:38 PM
yes I have made that adjustment
Title: Re: Try to output board for news on frontpage of site
Post by: rsw686 on February 05, 2008, 11:12:52 PM
Quote from: BlueJayWay on February 05, 2008, 11:06:38 PM
yes I have made that adjustment

Could you show us the file contents. Seems like there is something above the require line causing an issue.
Title: Re: Try to output board for news on frontpage of site
Post by: okbluejays on February 06, 2008, 12:16:18 AM
Quote<!-- Header Start -->
<? include($_SERVER['DOCUMENT_ROOT'].'/includes/header.php'); ?>
<!-- Header End -->

<!-- Body Start -->

<!-- News Start --><title>Hard Hitting Hockey since 2001</title>
      <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
         <tr>
            <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
            <td id="boxheaderright">News</td>
         </tr>
      </table>
      
<?php
require('/home/hockey/public_html/SMF/SSI.php');

ssi_boardNews();

ssi_shutdown();
?>
<div id="boxspacer"><img src="//images/invisimage.gif" width="260" height="1" border="0" alt=""></div>
<!-- News End -->

<!-- Champions Start -->
      <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
         <tr>
            <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
            <td id="boxheaderright">Stanley Cup Champions</td>
         </tr>
      </table>
      
<table cellpadding="3" cellspacing="0" width="100%" border="0">
  <tr>
    <td id="championsmainheader">&nbsp;</td>
    <td id="championsmainheader">Season</td>
    <td id="championsmainheader">Team</td>
    <td id="championsmainheader">GM</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 10</td>
    <td id="championsmain">&nbsp;</td>
    <td id="championsmain">&nbsp;</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 9</td>
    <td id="championsmain">Pittsburgh Penguins</td>
    <td id="championsmain">Geoff Bent</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 8</td>
    <td id="championsmain">New York Islanders</td>
    <td id="championsmain">Gera</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 7</td>
    <td id="championsmain">Pittsburgh Penguins</td>
    <td id="championsmain">Geoff Bent</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 6</td>
    <td id="championsmain">Washington Capitals</td>
    <td id="championsmain">Mark Lierman</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 5</td>
    <td id="championsmain">Ottawa Senators</td>
    <td id="championsmain">Puyan Rezaie</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 4</td>
    <td id="championsmain">Buffalo Sabres</td>
    <td id="championsmain">Waled</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 3</td>
    <td id="championsmain">St. Louis Blues</td>
    <td id="championsmain">Darryl Lierman</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0"></td>
    <td id="championsmain" nowrap>Season 2</td>
    <td id="championsmain">Detroit Redwings</td>
    <td id="championsmain">Bryan Johnson</td>
  </tr>
  <tr>
    <td id="championsmain"><img src="/images/stanleycup.jpg" height="20" width="13" alt="Stanley Cup" border="0">
    <td id="championsmain" nowrap>Season 1</td>
    <td id="championsmain">Carolina Hurricanes</td>
    <td id="championsmain">Ernie Pagliaro</td>
  </tr>
</table>
      <div id="championsmainbottom"><a href="/archive/archives.php">View Archives...</a></div>
<!-- Champions End -->
   </td>
   <td width="420" valign="top">
<!-- Standings Start -->
      <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
         <tr>
            <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
            <td id="boxheaderright">Standings</td>
         </tr>
      </table>
      <? include($_SERVER['DOCUMENT_ROOT'].'/Season10/CompactNHL20062Standings.php'); ?>
      <div id="boxspacer"><img src="/images/invisimage.gif" width="420" height="1" border="0" alt=""></div>
      <table cellpadding="0" cellspacing="0" border="0" width="420">
         <tr>
            <td width="50%" valign="top">
<!-- Upcoming Games Start -->
               <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
                  <tr>
                     <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
                     <td id="boxheaderright">Upcoming Games</td>
                  </tr>
               </table>
               <? include($_SERVER['DOCUMENT_ROOT'].'/Season10/CompactNHL20062Schedule.php'); ?><!-- Upcoming Games End -->
            </td>
            <td><img src="images/invisimage.gif" width="5" height="1" border="0" alt=""></td>
            <td width="50%" valign="top">
<!-- Scoring Leaders Start -->
               <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
                  <tr>
                     <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
                     <td id="boxheaderright">Scoring Leaders</td>
                  </tr>
               </table>
               <? include($_SERVER['DOCUMENT_ROOT'].'/Season10/CompactNHL20062Leaders.php'); ?><!-- Scoring Leaders End -->
            </td>
         </tr>
      </table>
<!-- Scoring Leaders End -->

<!-- Body End -->
<!-- Footer Start -->
<? include($_SERVER['DOCUMENT_ROOT'].'/includes/footer.php'); ?>
<!-- Footer End -->
Title: Re: Try to output board for news on frontpage of site
Post by: rsw686 on February 06, 2008, 12:32:44 AM
So just as the error stated you need to include SSI at the top. You also don't need ssi_shutdown since you don't need to display the theme footer.

Quote<!-- Header Start -->
<?
require('/home/hockey/public_html/SMF/SSI.php');
include($_SERVER['DOCUMENT_ROOT'].'/includes/header.php');
?>
<!-- Header End -->

<!-- Body Start -->

<!-- News Start --><title>Hard Hitting Hockey since 2001</title>
      <table cellpadding="0" cellspacing="0" border="0" id="boxheader">
         <tr>
            <td id="boxheaderleft"><img src="/images/invisimage.gif" width="25" height="20" border="0" alt=""></td>
            <td id="boxheaderright">News</td>
         </tr>
      </table>
      
<?php ssi_boardNews(); ?>
<div id="boxspacer"><img src="//images/invisimage.gif" width="260" height="1" border="0" alt=""></div>
<!-- News End -->
Title: Re: Try to output board for news on frontpage of site
Post by: okbluejays on February 06, 2008, 10:41:07 PM
Thank you so much for the help. That set it all up.