Jump to content

Recommended Posts

Hello everyone!

 

So, my friend coded this PHP code (SSI.php for SMF recent news function) for me:

 

<?php

			$array = ssi_boardNews(2, 5, null, 2000, 'array');

			foreach($array as $post) {
  				echo '   <h4>', $post['subject'], '</h4>
    				<h2>Posted by ', $post['poster']['link'], ' at ', date('G:i \o\n l, F j, Y', $post['timestamp']), '</h2>
    				<p>', $post['body'], '</p>
			', $post['comment_link'];
			}

			?>

 

I wanted to edit how the comment link looks so I edited it to this:

<?php

			$array = ssi_boardNews(2, 5, null, 2000, 'array');

			foreach($array as $post) {
  				echo '   <h4>', $post['subject'], '</h4>
    				<h2>Posted by ', $post['poster']['link'], ' at ', date('G:i \o\n l, F j, Y', $post['timestamp']), '</h2>
    				<p>', $post['body'], '</p>
			<h2>', $post['comment_link'], '</h2>;
			}

			?>

 

But when I do this, I get an error.

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /.../public_html/index.php on line 49

Parse error: syntax error, unexpected '<' in /.../public_html/index.php on line 49

 

How would I go about fixing this? I also want to add a horizontal rule after each post. Does anyone know how to add it?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/175576-php-ending-code-help/
Share on other sites

i really like this programming method of the array..

 

 

someone please explain it?

 

      $array = ssi_boardNews(2, 5, null, 2000, 'array'); <<< it a function to set

internal values UNDERSTAND THAT.

 

BUT

 

foreach as $post now, but the $array variable not $array[] format?

 

how can the function of ssi_boardNews let variable $array become a array

Link to comment
https://forums.phpfreaks.com/topic/175576-php-ending-code-help/#findComment-925227
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.