inline asides within habari 0.4

0 views
Skip to first unread message

brandel

unread,
Mar 5, 2008, 2:35:17 AM3/5/08
to habari-users
I am following CJD's tutorial [http://chrisjdavis.org/asides-with-
habari] on inline asides within habari, and each time I attempt to
setup within the loop I get an unexpected $end.

Any help here?

Michael C. Harris

unread,
Mar 5, 2008, 2:57:27 AM3/5/08
to habari...@googlegroups.com

Could you post the code, either here or at a pastie, such as
pastoid.com.


--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog

Ali B.

unread,
Mar 5, 2008, 3:06:28 AM3/5/08
to habari...@googlegroups.com
Did you close the else and the foreach blocks?

If you didn't add <?php } } ?> at the bottom of CJD's code snippet.

Cheers
--
Ali B.

brandel

unread,
Mar 5, 2008, 3:31:51 AM3/5/08
to habari-users
Here is my loop code:

<?php foreach ( $posts as $post ) { ?><br />

<?php if( in_array('asides', $post->tags ) ) { ?><br />
<div id="post-<?php echo $post->id; ?>"><br />
<p class="quickie"><br />
<a href="<?php echo $post->permalink; ?>" rel="bookmark" title='
<?php echo $post->title; ?>'><
?php echo $post->title_out; ?></a> » <?php echo $post->content; ?>
<a href="<?php echo $post->permalink; ?>#comments"
title="Comments on this post">
(<?php echo $post->comments->approved->count; ?>)</a><br />
</p><br />
</div><br />
<?php } else { ?>

<div class="date"><?php echo $post->pubdate_out; ?></div>
<div class="entry_title"><?php echo $post->title_out; ?></div>

<?php echo $post->content_out; ?>

<a href="<?php echo $post->permalink; ?>"><?php echo $post->comments-
>approved->count; ?> <?php echo _n( 'Comment', 'Comments', $post-
>comments->approved->count ); ?></a><br />
<span class="tags">Filed under <?php if ( is_array( $post->tags ) ) { ?
><?php echo $post->tags_out; ?><?php } ?>.</span>
<?php if ( $user ) { ?>&nbsp;&nbsp;&nbsp;<a href="<?php
URL::out( 'admin', 'page=publish&slug=' . $post->slug); ?>"
title="Edit post">Edit This Entry</a><?php } ?><br><br>

<div class="divider">&nbsp;</div>

<br>

<!--end of loop--> <?php } ?>

On Mar 5, 3:06 am, "Ali B." <dmond...@gmail.com> wrote:
> Did you close the else and the foreach blocks?
>
> If you didn't add <?php } } ?> at the bottom of CJD's code snippet.
>
> Cheers
>

brandel

unread,
Mar 5, 2008, 3:35:55 AM3/5/08
to habari-users
Here you go!

http://pastoid.com/ci

On Mar 5, 2:57 am, "Michael C. Harris" <michael.twof...@gmail.com>
wrote:

Michael C. Harris

unread,
Mar 5, 2008, 3:45:42 AM3/5/08
to habari...@googlegroups.com
On Wed, Mar 05, 2008 at 10:06:28AM +0200, Ali B. wrote:
> Did you close the else and the foreach blocks?
> If you didn't add <?php } } ?> at the bottom of CJD's code snippet.

Ali is correct, you're not closing your if statement.

brandel

unread,
Mar 5, 2008, 3:54:05 AM3/5/08
to habari-users
how can I close it?

On Mar 5, 3:45 am, "Michael C. Harris" <michael.twof...@gmail.com>
wrote:

Ali B.

unread,
Mar 5, 2008, 4:35:14 AM3/5/08
to habari...@googlegroups.com
Add another <?php } ?> at the end of that code
--
Ali B.

brandel

unread,
Mar 5, 2008, 4:06:25 PM3/5/08
to habari-users
I did that, and it displayed my posts. However, my sidebar was
missing.

In my logs I get:
in_array() [function.in-array]: Wrong datatype for second argument in /
home/brandel/public_html/system/classes/error.php line 8


aaaaah!

Michael C. Harris

unread,
Mar 5, 2008, 4:23:11 PM3/5/08
to habari...@googlegroups.com
On Wed, Mar 05, 2008 at 01:06:25PM -0800, brandel wrote:
>
> I did that, and it displayed my posts. However, my sidebar was
> missing.
>
> In my logs I get:
> in_array() [function.in-array]: Wrong datatype for second argument in /
> home/brandel/public_html/system/classes/error.php line 8

Then you fixed one error and created/uncovered another. Without code,
we'd just be guessing.

sparkx

unread,
Mar 5, 2008, 10:12:04 PM3/5/08
to habari-users
It's still a bit ugly to look at, but I was just adding inline asides
to my habari installation and have a copy of my working loop here:

http://pastoid.com/cl

brandel

unread,
Mar 6, 2008, 12:20:23 AM3/6/08
to habari-users
THANK YOU :D
Reply all
Reply to author
Forward
0 new messages