Recent Topics

1 Apr 09, 2007 08:58    

My b2evolution Version: Not Entered

I'm currently using two external stat programs which work beautifully with my blog. However I've realised that people who read my blog as a feed don't count towards stats. Now I have realised that the feeds use their own skins so I'd like to paste my stat codes in the skins for b2. However I can't workout where in the feed skins to paste the code. I'm using 1.9.2

Can anyone help?

Thanks
Stephan

2 Apr 09, 2007 12:02

Asuming that your stats software uses javascript then I'm pretty sure you can't do it.

There are some basic stats ( including feed hits ) in the admin area of your blog

¥

3 Apr 09, 2007 12:09

Yabba, thanks. The problem I'm having is that the feed folders in the back office are like very basic skin folders. So I'd have to put my <script> code into each of them somewhere. But I can't work out where in the files. because the feed 'main' files are xml there's no body/html for me to slot the script into.
Here is a feed file, and below that a sample script I would need to put into it somewhere. Any ideas'

<?php
/**
 * This template generates an Atom feed for the requested blog's latest posts
 *
 * See {@link http://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html}
 *
 * This file is not meant to be called directly.
 * It is meant to be called automagically by b2evolution.
 *
 * This file is part of the b2evolution project - {@link http://b2evolution.net/}
 *
 * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
 *
 * {@internal Open Source relicensing agreement:
 * Daniel HAHLER grants Francois PLANQUE the right to license
 * Daniel HAHLER's contributions to this file and the b2evolution project
 * under any OSI approved OSS license (http://www.opensource.org/licenses/).
 * }}
 *
 * @package evoskins
 * @subpackage atom
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author fplanque: Francois PLANQUE - {@link http://fplanque.net/}
 * @author blueyed: Daniel HAHLER.
 *
 * @version $Id: _main.php,v 1.12.2.3 2006/10/14 02:23:01 blueyed Exp $
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

if( $debug)
{
	skin_content_header( 'application/xml' );	// Sets charset!
}
else
{
	skin_content_header( 'application/atom+xml' );	// Sets charset!
}

echo '<?xml version="1.0" encoding="'.$io_charset.'"?'.'>';
?>

<feed xml:lang="<?php $Blog->disp( 'locale', 'xml' ) ?>" xmlns="http://www.w3.org/2005/Atom">

	<title>
<?php


		$Blog->disp( 'name', 'xml' );
		request_title( ' - ', '', ' - ', 'xml' );
	?></title>
	<?php
	switch( $disp )
	{
		case 'comments':
			// this includes the last comments if requested:
			require( dirname(__FILE__).'/_lastcomments.php' );
			break;
		default:
			?>
			<link rel="alternate" type="text/html" href="<?php $Blog->disp( 'blogurl', 'xml' ) ?>" />
			<link rel="self" type="text/html" href="<?php $Blog->disp( 'atom_url', 'xmlattr' ) ?>" />
			<id><?php $Blog->disp( 'atom_url', 'xmlattr' ); /* TODO: may need a regenerate_url() */ ?></id>
			<subtitle><?php $Blog->disp( 'shortdesc', 'xml' ) ?></subtitle>
			<generator uri="http://b2evolution.net/" version="<?php echo $app_version ?>"><?php echo $app_name ?></generator>
			<updated><?php $MainList->mod_date( 'isoZ', true ) ?></updated>

			<?php
			while( $Item = & $MainList->get_item() )
			{
				// Load Item's creator User:
				$Item->get_creator_User();
				?>
			<entry>
				<title type="text"><?php $Item->title( '', '', false, 'xml' ) ?></title>
				<link rel="alternate" type="text/html" href="<?php $Item->permanent_url( 'single' ) ?>" />
				<author>
					<name><?php $Item->creator_User->preferred_name( 'xml' ) ?></name>
					<?php $Item->creator_User->url( '<uri>', "</uri>\n", 'xml' ) ?>
				</author>
				<id><?php $Item->permanent_url( 'single' ) ?></id>
				<published><?php $Item->issue_date( 'isoZ', true ) ?></published>
				<updated><?php $Item->mod_date( 'isoZ', true ) ?></updated>
				<content type="html"><![CDATA[<?php
					$Item->url_link( '<p>', '</p>' );
					echo make_rel_links_abs( $Item->get_content() );
				?>]]></content>
			</entry>

			<?php
			}
	}
	?>

</feed>
<?php
	$Hit->log(); // log the hit on this page

	// This is a self contained XML document, make sure there is no additional output:
	exit();

?>

<script src="http://static.getclicky.com/1111.js" type="text/javascript"></script>
<noscript><p><img alt="Clicky" src="http://static.getclicky.com/1111ns.gif" /></p></noscript>

4 Apr 09, 2007 12:19

Javascript isn't a valid xml tag so you can't use it.

¥

5 Apr 09, 2007 12:32

Do you know if there are any files other than skin files that would be opened everytime you view the blog. If I can find a more central file to place the js I wouldn't rely on the skins.

6 Apr 09, 2007 12:40

The only way to centralise this ( and it still wouldn't work for feeds ) is to create a plugin that uses SkinBeginHtmlHead() to insert the javascript.

¥

7 Apr 09, 2007 12:41

thanks for your help, shame, I'll have to find another way.


Form is loading...