Recent Topics

1 Feb 06, 2007 19:23    

I have been trying to set-up a skin following the instruction in one of the FAQ threads.

However, when I try to display the blog, I get the error message:

Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/nlp-southwest.co.uk/httpdocs/b2evolution/skins/nlpskin/_main.php on line 67

In my file, this is the area in question:

          <?php $Item->wordcount(); echo (" "); echo T_('Words');  // the number of words in this article ?>
	  •   <- This is line 67
          <a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>" title="<?php echo T_('Browse all posts by this author'); ?>"><?php $Item->Author->prefered_name(); ?></a>
          •

[color=red][/color]

All help gratefully received.

2 Feb 06, 2007 23:01

I've seen that recently but I don't remember what skin it was. What version of b2evolution are you using, and what's the original name of that skin?

3 Feb 06, 2007 23:10

The original name was 'custom'.

The b2e version is 1.8.2

4 Feb 06, 2007 23:28

Interesting. Firstly you should know there's a security issue with 1.8.2 that you need to address by either upgrading or doing the quick fix for. Upgrading is better because there's a lot more 'opportunity' that gets shut down by going at least to 1.8.7. Very small changes from 182 to 187, and all of them security-related.

So that line was not in the custom skin. I'm pretty sure I saw a line like it in a different skin though. The one with the alternating black and white backgrounds for the posts area? I don't like doing skin stuff that way just because I think it looks sloppy. In your case it's not working, so it's something you've done that's making it not work.

Try this instead:

<?php $Item->wordcount();
echo ''.T_('Words').'. '; // the number of words in this article ?>
<a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>" title="<?php echo T_('Browse all posts by this author'); ?>"><?php $Item->Author->prefered_name(); ?></a>.

5 Feb 07, 2007 12:26

The code int question is part of the code from the FAQ thread on setting up your own skin and is based on taking your own site template and adding this collection of code at various places in your file.

I will try your code and get back to you.

6 Feb 07, 2007 12:40

Same error message but in line 68. This now line 68:

<a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>" title="<?php echo T_('Browse all posts by this author'); ?>"><?php $Item->Author->prefered_name(); ?></a>

7 Feb 07, 2007 13:19

Okay now I see what's wrong. I didn't even look at the second line. It's broken is the thing, but I don't know how to fix it. Lemme look around for a second or 12,450,000 to find an answer. In the mean time this will work even though it will look like crap:

<a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>" title="<?php echo T_('Browse all posts by this author'); ?>">Author's Name</a>

The broken thing, I think, is that the bit calling for "prefered_name" is no longer a valid function call. Lemme poke around and see if I can dig up an answer for ya.

Actually I'm not even sure that will work. Something looks horribly wrong in it, but if you got the time to test it we'll learn more about how to make it work for you.

8 Feb 07, 2007 13:29

Thanks for the ongoing help.

What is it they say about one step forward?

Now have this:

Fatal error: Call to undefined function: permalink() in /home/httpd/vhosts/nlp-southwest.co.uk/httpdocs/b2evolution/skins/nlpskin/_main.php on line 74

which refers to this line:

<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>" class="permalink_right"><img src="img/chain_link.gif" alt="<?php echo T_('Permalink') ?>" width="14" height="14" border="0" class="middle" /></a>

9 Feb 07, 2007 13:30

Okay I think I found it. The "uneven" skin uses the same line of code and I have been playing with them a bit so the following should take care of business for you.

<a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>"><?php $Item->author(); ?></a>

10 Feb 07, 2007 13:38

Error as per my last post still exists.

11 Feb 07, 2007 13:52

Okay check it out. I can't debug a skin line by line for you. Permalink() got replaced a long time ago even if the manual still says that's what works. Obviously it doesn't, so I'm going to go way back in time and make the recommendation that never failed.

Visit the skins site (linked above on the "Extend" tab) and find a skin that has something you find desirable, download it, and see how that skin makes the bit you want. There might still be problems, but they will not be problems due to using code that hasn't been valid for at least 8 months.

Sorry my friend, but the manual page has obsolete information. Skins from the skins site will work with your version because you'll see them work with the same version.


Form is loading...