1 tornpaperbag Feb 25, 2005 19:46
3 edb Feb 25, 2005 20:23
The specific error you are getting
Fatal error: Call to a member function on a non-object in /home/adryden/public_html/drydens/skins/longdistance/_main.php on line 34
is coming from trying to get $Item->Author->prefered_name() when you don't have any $Item selected or identified. Basically, your entire posts loop is missing.
Quick-cut at a solution:
<div>
<IMG class=avatar src="<?php $Item->Author->prefered_name(); ?>.gif" border=1 alt="avatar">
<div class="contenttop"><b><?php $Item->title(); ?></b><br><small><?php $Item->Author->url('<?php $Item->Author->prefered_name(); ?>'); ?> : <?php $Item->categories(); ?></small></div>
<div class="contentcenter"><br> <?php $Item->content(); ?><br> <br> </div>
<div class="contentbottom"><a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php echo T_('Permalink') ?></a> posted on <?php $Item->date(); ?> at <?php $Item->time(); ?> | <?php $disp_comments = 1; $disp_comment_form = 1; ?> </div>
<br><br><br></div>
All that needs to be replaced with the posts loop from what used to be _main.php. In the custom skin it'll be identified with a long comment line indicating "start of main area" then about 50 lines later "end of main area". Throw the regular posts loop in then tweak it to do the avatar thing you want and whatever classes you want to use.
4 tornpaperbag Feb 25, 2005 20:40
You guys are amazing. Fast and efficient. Going to go fix it now.
Thanks again :D
Ashley
5 powersusa Feb 25, 2005 20:44
First you are missing the first "?" in the followig line:
<php $Item->categories(); ?>
Secondly I don't think your script is semantically what you want (just a guess). Looking at your site it looks like you want a list of categories in the side navigation. But the code is getting the categories of an $Item (which is not initialized and is why the script is broken). What you want is a list of categories for the blog not a sigle item (who knows maybe you do). If you have access to the "custom" skin which is the default for new b2evo installs have a look at the _main.php. In that file are examples of how to initialize $Item (in other words the php code to get and loop over the blog entries) and how to get the categories for the blog.
By the way if your interested in a possible way of building skins without (read ZERO) php in your layout have a look at my post [url=http://forums.b2evolution.net/viewtopic.php?t=3252] here [/url]
line 34 says what? (nm edb got it) :)