Recent Topics

1 Feb 04, 2009 12:04    

My b2evolution Version: 2.x

Hi all

I wasn't sure whether to put this in the bugs forum or not so I thought I would see what the consensus was.

I have been putting a site together where there are a number of 'pages' and a traditional blog. From a b2evo perspective I am using a blog for of the 'pages' as well as the traditional blog. I have selected 'no feed' for all but the blog part of the site.

My first question is about the external feeds part and is just really cosmetic. If 'no feeds' are selected are the external feeds still relevant or should they be disabled for that blog ?

The other thing I noticed is more skin related. The skins don't know if a particular blog has feeds enabled or not so even though I have selected 'no feeds', the auto discovery urls are still displayed in the url bar of FF etc. Clicking on them causes the 404 from b2evo.

None of these things are really major but could be confusing for people visiting the site. Is this something that should go into the bugs forum or is this known expected behavior?

Possible solutions for if there is anyone who it setting up a site in the same way are:

If you are OK with editing your skin you could add a check for the blog you want to have the auto discovery urls (the one you have the feed enabled for) and therefore only include them for this blog.

The other way which doesn't include editing your skin is to use an external feed like Feedburner (only in 2.4.6). Use the feed of the blog part of the site in your Feedburner settings and then enter your Feedburner url in the 'External Feeds' section for all your blogs. This means that no matter where a visitor is in your site, if they click on your feed they will always get the feed of your blog and not the other 'pages'.

Cheers
Lee

2 Feb 06, 2009 12:18

lturner wrote:

... None of these things are really major but could be confusing for people visiting the site. Is this something that should go into the bugs forum or is this known expected behavior? ...

Sounds to me like this is right on the fine line between "feature request" and "bug report". Cuz yeah if you say "no feeds" then b2evo should (and does) provide no feeds BUT it provides autodiscovery of these non-existent feeds.

You've probably already figured it out, but the lines in question are in skins/_html_header.inc.php

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />

A completely incorrect solution would be something like this:

<?php if( ! $I_selected_no_feeds ) { ?>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />
<?php } ?>

hmmm...

snagging a wee bit from the _atom skin perhaps something like

$feed_content = $Blog->get_setting('feed_content');
if( $feed_content != 'none' ) {
//the bits for auto-discovery of feeds
}

might actually take care of business?

3 Feb 06, 2009 13:07

Hi Ed

I know what you mean about the fine line. That's why I wasn't sure where to put it.

Unfortunately I haven't had time to finish this off so I was going for the 'completely incorrect solution' until I could find out how to check that the feeds were turned off :)

Many thanks for posting the correct solution - much appreciated.

Cheers
Lee

4 Feb 06, 2009 13:15

Hi all

EdB's solution worked like a charm. In your skin replace:

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />

with :

<?php $feed_content = $Blog->get_setting('feed_content'); 
	if( $feed_content != 'none' ) { ?>
		<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
		<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />
	<?php } ?>

As mentioned above, the lines in question are in skins/_html_header.inc.php

I'll add this as a feature request for the next release.

5 Jun 28, 2009 17:35

I'm running 3.2 with a modification of the Photoblog skin.

Under blog settings>features>rss/atom feeds I have selected "no feeds." On my blog, feeds are still listed, they just go to a 404 page.

I swapped out the code in my skin in _html_header.inc.php as quoted above as EdB suggested, using the form Lee summarized just above. Result? NO change whatsoever.

Clickable-looking things that go only to an error message are ... well, errors. And not OK. Ideas?

http://www.helioglyphs.com/blogs/blog4.php

6 Jun 28, 2009 18:05

martha: The Photoblog skin uses a custom _html_header.inc.php, located in the skin directory itself (skins/photoblog), so you need to edit this file (instead or additionally to the global file).
To remove the feed links at the bottom of the page, edit the file skins/photoblog/_body_footer.inc.php (lines 32-35).

lturner: Since you have CVS access now, do you want to fix all the _html_header.inc.php files and possibly bugs like the one martha discovered? :-)

7 Jun 28, 2009 18:48

thanks, Tblue, but the _html_header.inc.php that I edited WAS the one in skins/photoblog.

I'm editing in TextEdit--no line numbers visible, I just found the lines identical to those cited by lturner for replacement and replaced them, and yes uploaded result to photoblog skin.

I just went and checked it all again. Still shows go-nowhere rss/atom feeds.

8 Jun 28, 2009 19:17

Tblue wrote:

To remove the feed links at the bottom of the page, edit the file skins/photoblog/_body_footer.inc.php (lines 32-35).

These are the lines, try removing them:

		|
		<a href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>">RSS 2.0</a> /
		<a href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>"><?php echo T_('Atom Feed') ?></a> /
		<a href="http://webreference.fr/2006/08/30/rss_atom_xml" title="External - English"><?php echo T_('What is RSS?') ?></a>

9 Jun 28, 2009 19:37

OK, I can make that work--I deleted the "What is RSS?" business last night, no problem deleting the rest.

If there isn't another way to control it, I'm seeing this as a feature request: a way for the skin to tell when the feeds are turned off, so that the feed display is inactivated when the feeds are off. Otherwise, you need a different skin (copy, maybe with only these lines in or out) when you want or do not want feeds, or if you ever change your mind about that.

10 Jun 28, 2009 19:45

There is a way, it's the same lturner used to deactivate the two lines in the HTML <head> section. I'm busy now, otherwise I would fix this. :-)

11 Jun 29, 2009 23:11

Hi guys

Sorry for the slow response - been away on hols :)

martha - are you still struggling with this?

Tblue - I'll check the skins in CVS to make sure they are all fixed. Not back home yet so will be in the next day or so when I get to look at this.

12 Jun 30, 2009 01:37

Since changing the lines in myskin/_html_header.inc.php (per lturner's summary of EdB's fix above) didn't seem to do anything, I went ahead and nuked the lines in myskin/_body_footer.inc.php. That did of course get rid of the mention of feeds, but without any admin way to turn them back on.

THEN I discovered that more 404-generating references to feeds appear on the comments form!!!

I could find the lines that generate those references and nuke them, too, but I've been choosing to struggle with OTHER issues since then. (A new installation and a new skin and a new set of desired functions do at least give one the option of choosing one's current struggle, as there's no shortage to choose from.)

lturner: I'll be out ALL of tomorrow, not back to this much till Wednesday--so by all means wait till you're home if you wish.

In the long run, seems like there should be a clean way to turn feeds on and off--and "clean" means no error-message-generating leftovers when off. Didn't it use to work that way?

13 Jun 30, 2009 05:50

Light slowly dawns: I've been playing around with the Frugal skin this evening, and in that skin when one turns off the feeds in admin, the references to them go away. I realize that my problem is (probably) not (just) 3.2.0-beta dependent, it is an issue with the Photoblog skin. Maybe other skins.

14 Jul 01, 2009 22:12

OK, I have had a quick look at the photoblog skin and as far as I can see there are few things that need to be updated:

The links to the feeds in the head (photoblog/_html_header.inc.php) are already taken care of as per this thread:

http://forums.b2evolution.net/viewtopic.php?t=17874

There are then the links to the feeds in the footer (photoblog/_body_footer.inc.php) that need changing. If you open up the file and look for:


			|
			<a href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>">RSS 2.0</a> /
			<a href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>"><?php echo T_('Atom Feed') ?></a> /
			<a href="http://webreference.fr/2006/08/30/rss_atom_xml" title="External - English"><?php echo T_('What is RSS?') ?></a>

and change them to:


<?php
		if( $Blog->get_setting( 'feed_content' ) != 'none' )
		{ 
		?>
			|
			<a href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>">RSS 2.0</a> /
			<a href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>"><?php echo T_('Atom Feed') ?></a> /
			<a href="http://webreference.fr/2006/08/30/rss_atom_xml" title="External - English"><?php echo T_('What is RSS?') ?></a>
		<?php
		}
		?>

Then there is the link to the comments feeds that need to be updating. This will be a problem for all skins as far as I can see (including the frugal skin). The file you need to edit for this one is in your skins folder and is called /skins/_item_feedback.inc.php and the bit you are looking for is:


// Display link for comments feed:
	$Item->feedback_feed_link( '_rss2', '<div class="feedback_feed_msg"><p>', '</p></div>' );

All you need to do is change it to:


if( $Blog->get_setting( 'feed_content' ) != 'none' )
	{ 
	// Display link for comments feed:
	$Item->feedback_feed_link( '_rss2', '<div class="feedback_feed_msg"><p>', '</p></div>' );

	}

You will of course have to remove the 'XML Feeds' widget yourself for the blogs where you have turned off feeds although maybe it could be updated to display an appropriate message if it is displayed for blogs where feeds are turned off?

I included the above for people wanting to update the skin for themselves but I will also make these changes in CVS and check the other skins for similar issues. This will get it sorted for the 3.3 release. Martha, if you want the updated photoblog skin sooner and don't want to bother with the above skin updates then let me know and I will zip the skin up for you and let you have a link :)

L

15 Jul 01, 2009 22:45

lturner wrote:

You will of course have to remove the 'XML Feeds' widget yourself for the blogs where you have turned off feeds although maybe it could be updated to display an appropriate message if it is displayed for blogs where feeds are turned off?

The appropriate message would be "return false" ;)

¥

16 Jul 01, 2009 23:24

Always a pleasure to learn from a master ;)

L

17 Jul 02, 2009 01:45

lturner wrote:

Martha, if you want the updated photoblog skin sooner and don't want to bother with the above skin updates then let me know and I will zip the skin up for you and let you have a link

That would be very helpful as I'm modifying the Photoblog skin--thanks!! mlt

18 Jul 02, 2009 12:01

Hi Martha

Please make sure that you back up these files before overwriting them with the ones I am providing you :)

Here is the link to the updated photoblog skin:

http://www.leeturner.org/media/downloads/b2evolution/photoblog.zip

This should be a direct replacement for the one you already have. The next link is a zip file containing a file that lives in your /skins folder:

http://www.leeturner.org/media/downloads/b2evolution/_item_feedback.inc.php.zip

Again, this should overwrite the file that is already there (after you have backed it up)

I hope they work OK for you. I have committed changes to CVS so these updates will be released with the 3.3 release.

L

19 Jul 04, 2009 18:55

Thanks for the updated skin file, lturner, it did save me time & trouble. (It STILL took me a while 'cause I FINALLY realized I was using the skin that came with 3.1 (?) though running 3.2, and had to transfer my rearrangements of elements from index.main.php to _item_block.inc.php.)

Now the feed display for the blog turns on and off with the feeds--great!

Trouble is, the feed display for the comments is still always on. And, yup, with "no feeds" selected under features, it generates a 404 page. AND this is true of the Frugal skin (which, by the way, I think is a really good skin) as well as my modified version of Photoblog--haven't tried others.

Seems like, ideally, blog feeds and comments feeds could be turned on and off independently of each other--perhaps side by side there on the features page. Or, failing that, that they would be switched on and off together, with the "no feeds" selection disappearing the display for both. ????

20 Jul 04, 2009 20:30

Hi Martha

Glad that it helped :)

It is a little strange that the comments feeds are still displayed as I thought I had handled that with the second zip in my post:

lturner wrote:

The next link is a zip file containing a file that lives in your /skins folder:

http://www.leeturner.org/media/downloads/b2evolution/_item_feedback.inc.php.zip

Again, this should overwrite the file that is already there (after you have backed it up)

Did you apply both of the zips ? As far as I know blog feeds and comments feeds cannot be turned on and off independently of each other but if you turn off feeds in the admin console the comments feeds should disappear also.

L

21 Jul 05, 2009 02:47

Oh my, oh my, I am NOT paying attention!!! No, I did not return and notice a second zip, will play with it when I can, possibly tomorrow.

Sorry for the brain-glitch.

22 Jul 07, 2009 22:51

OK, I've done BOTH parts now, and it works perfectly!

Thank you so much!

mlt

23 Jul 07, 2009 23:03

No worries at all. Really glad you have it working the way you want.

Your changed photoblog skin looks really nice by they way. It has a really nice feel to it.

My name seems to be included in the admin users full name. Was that intentional?

Lee

24 Jul 07, 2009 23:11

Sorry, being a little slow here :) Looks like your name and my name are partly the same. Coincidence :D

25 Jul 08, 2009 01:20

Yes, given my middle name after my maternal grandfather, who (being my *maternal* grandfather) was not a turner, however.

Thanks, I'm pretty pleased with that skin, myself. Tho it still needs a few minor adjustments... (but what doesn't?)


Form is loading...