News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

headlines on frontpage ?

Started by Floyds, March 15, 2004, 08:56:25 AM

Previous topic - Next topic

babdon

Is it that you can't use this for child boards. Everytime i put the board number of a child board, i get this error:


Warning: Invalid argument supplied for foreach() in /home/centerst/public_html/main/discuss2.php on line 23

how do i get it to show a child board?
*witty comment here*

[Unknown]

Child boards are handled exactly the same way boards are.  As far as SSI.php is concerned, there is no difference.

-[Unknown]

babdon

yea, thats what i thought but it isn't working. Is there any possible reason u can think of why its giving me this error?it happens for only two of my boards. I've gone as far as checking the database to make sure the ID_BOARD i'm using is correct...

why would it not work?
*witty comment here*

[Unknown]

Can you give me a link to your forum and the exact code you're using to access the board through SSI.php?

-[Unknown]

babdon

the forum is at http://centerstorm.net/bbs [nofollow]

u can access it with test, test (user,password).

here is an example page that has the problem:

http://centerstorm.net/main/cview.php?mid=clist&midImg=mod&info=discuss2 [nofollow]

if you change info=discuss2 into info=discuss you'll see a working version (where i'm not using a child board)

Actually, some child boards work, its just these two boards that aren't working:
http://centerstorm.net/bbs/index.php/board,17.0 [nofollow]
http://centerstorm.net/bbs/index.php/board,18.0 [nofollow]

the code is:

require_once('../bbs/SSI.php');


if ($midImg == "run")
{
$x = 17;
}elseif ($midImg == "mod")
{
$x = 18;
}elseif ($midImg == "home" OR $midImg == "archive")
{
$x = 21;
}else
{
$x = 2;
}

$array = ssi_boardNews($x, 5, 0, 500, 'array');
foreach ($array as $news) {

$date=$news['time'];
$dte = explode(" ", $date);

echo '<link href="../cso.css" rel="stylesheet" type="text/css">
<table width="291" height="79" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1" rowspan="4" bgcolor="#333333"><img src="../gfx/shim.gif" width="1" height="1"></td>
<td width="21" height="19">&nbsp;</td>
    <td width="268" class="TXTgrayReg"><strong><u>'.$dte[0].' '.substr($dte[1], 0, 2).', '.$dte[2].'</u> | '.$news['poster']['link'].'</strong></td>
    <td width="1" rowspan="4" bgcolor="#333333"><img src="../gfx/shim.gif" width="1" height="1"></td>
</tr>
  <tr>
    <td height="39">&nbsp;</td>
    <td class="TXTgrayReg"><strong>'.$news['subject'].'.</strong> '.$rest = substr($news['body'], 0, 200).' </td>
  </tr>
  <tr>
    <td height="19">&nbsp;</td>
    <td class="TXTgrayReg"><img src="../gfx/shim.gif" width="1" height="1"><a href="'.$news['href'].'"><img src="../gfx/moreBox.jpg" width="47" height="17" border="0"></a></td>
  </tr>
</table>
';}


*witty comment here*

[Unknown]

> The topic or board you are looking for appears to be either missing or off limits to you.

The boardNews function requires a board with guest access privileges.

-[Unknown]

babdon

*witty comment here*

babdon

Last question (hopefully), How do i add a link to directly reply to each thread?
*witty comment here*

Floyds

what do you mean ?

Here a sample of how it works

(http://www.alliedassault.nl) it's in dutch so... just have a look...

PS, this is not SPaM.....

babdon

yea, the "write comment". whats the variable from SSI.php for that?
*witty comment here*

[Unknown]

I think it's link or href.  Try using print_r().

-[Unknown]

dracomiconia2


Advertisement: