headlines on frontpage ?

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

Previous topic - Next topic

[Unknown]

Dumb typo, sorry, been horribly stretched, please change this:

foreach ($return as $news)

To:

foreach ($array as $news)

-[Unknown]

Floyds


Floyds

I have one more question.

What are the numbers ,0,100 stand for ??

$array = ssi_boardNews(29, 10, 0, 100, 'array');

29 stands for boardnumber
10 stands for number of lines
0 ??
100 ??

And how can I make it so there is no - "x comments"
And how do I make the headlines clickable ?

7summits

Quote from: [Unknown] on March 16, 2004, 12:49:53 PM
Dumb typo, sorry, been horribly stretched, please change this:

foreach ($return as $news)

To:

foreach ($array as $news)

-[Unknown]

Hi [Unknown]

I still get the same error
QuoteWarning: Invalid argument supplied for foreach() in /home/summits/public_html/test.php on line 7

even if I use this script on a complete blank page

<?php

require_once('/home/summits/public_html/smf/SSI.php');

$array ssi_boardNews(29100100'array');

foreach ($array as $news)
echo '
'
$news['subject'], ' - '$news['link'], '<br />';
?>


(see http://7summits.com/test.php )

What is wrong?
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Skoen

Look at this message:
Quote from: [Unknown] on March 16, 2004, 12:49:53 PM
Dumb typo, sorry, been horribly stretched, please change this:

foreach ($return as $news)

To:

foreach ($array as $news)

-[Unknown]
And see if it works.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


7summits

I had already changed that as you can see in the code.
Or did I miss something?
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

7summits

Quote from: 7summits on March 19, 2004, 09:19:26 AM
I had already changed that as you can see in the code.
Or did I miss something?
ah, Floyds question brought me to it: it did not work as I do not have a board with ID=29...

Changed it to 2 and now it works.

So what do the other numbers stand for?
And how can you change the output so that the title itself is the link, not the 'x comments' part?
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

7summits

Ok, I think I modded some solution:

I added this 'sublink' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['subject'] . '</a>',

Before
'replies' => $row['numReplies'],

In the boardnews part of SSI.php

Then you can call it with [Unknown]'s script,

But replace
', $news['subject'], ' - ', $news['link'], '<br />';


with
', $news['sublink'], '<br />';


:P

Am I getting warmer?

first number is board id (must exist), 2nd number is number of posts; 3rd number is teh offset (start at x'th post), 4th number remains a mystery for me, if it's the character limit then it doesn't work.
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

[Unknown]

The fourth number cuts off the body...

I recommend, instead of doing "sublink", you leave SSI.php as-is and do this:

<a href="', $news['href'], '">', $news['subject'], '</a>';

That way you're not changing any source that could change in the next version.

-[Unknown]

7summits

Ah, even better :-)

saves me from remembering all the mods...
works like a charm, thanks.
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Floyds

Well i've run into a problem, that I can't get fixed... does anyone know how to fix this.

http://www.alliedassault.nl/news.php

I want to have 2 or 3 sets of headlines, from 3 different forumsections (in the url there are only 2 just for an example).
But I don't know how the fix the error ;

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/alliedassault.nl/html/news.php:10) in /home/alliedassault.nl/html/yabbse/SSI.php on line 93

So hope some one can help me out....

[Unknown]

SSI.php has to be included *first* before even the <html> or ANYTHING.  Remember!

-[Unknown]

Floyds

oeps, ::) kinda forgot it.. thx...

It works now...  :D

babdon

hmm.. okay, what i'm actually trying to do is mix in some html into how it displays the news. every time i try to put html after the
Quoteforeach ($array as $news)

it doesn't do the repeat. Example, if i add:

Quoteecho '<link href="../cso.css" rel="stylesheet" type="text/css"> ';

or even just plan - echo '<tr>'; - it won't repeat and only shows the next result after the limit.

My question is, how do i make it so i can put the $news['body'], $news['subject'], etc. inside html so i can make it show exactly how i want it to show?

*witty comment here*

[Unknown]

<?php

require_once('/home/you/public_html/smf/SSI.php');

$array ssi_boardNews(BOARD ID HERE100100'array');

foreach (
$array as $news)
echo '
<tr title="having fun">
<td><b>'
$news['subject'], '</b> - '$news['link'], '<br /></td>
</tr>'
;
?>


-[Unknown]

Springer

I do not understand some of the things above but think this is the right place for the question.


I want to modify the way the things are presented on a web page when use'n a newsboard. 


In one I want to try and make it post only the body of the message.
In another I would like to try and change the location of the date, title, person who posted, etc...


Ben_S

The code unknown posted, you can put directly into a page on your site, you will just need to change the require_once('/home/you/public_html/smf/SSI.php line to your actually path.
Liverpool FC Forum with 14 million+ posts.

Springer

#37
Quote from: Floyds on March 19, 2004, 07:08:42 AM

$array = ssi_boardNews(29, 10, 0, 100, 'array');

29 stands for boardnumber
10 stands for number of lines
0 ??
100 ??

What do the last numbers represent?


I've tested the code and it displays the message topics with only the comments as links.  That is part of what I would like to try and do.

In the ssi.php there is a section at the end of the boardnews function that I think controls how the information is presented. 

If I read things correctly I could put something like the above on the web page to create a new array.  Then create the table on the page how I want use'n the commands in ssi for each section?




[Unknown]

I believe 29 is the ID_BOARD.  10 is the limit - how many topics. 0 is the start - how many topics to skip.  100 is how long to limit the message to.

As far as array output, yes.  You can look at ssi_examples.php at the end for more information.

-[Unknown]

Springer

So this should work on the page where I only want the body and nothing else?

I have the "require_once('/home/you/public_html/smf/SSI.php');" at the top of the page.  (with the info changed to my settings)



<?php

$array 
ssi_boardNews(BOARD ID HERE100100'array');


foreach (
$array as $news)
{
echo '
<table border="0" width="100%" align="center" class="smfNews">
</tr>
<tr>
<td>'
$news['body'], '<br /><br /></td>
</tr>

</table>
<br />'
;
?>



Advertisement: