Recent Topics

1 Feb 04, 2009 18:01    

My b2evolution Version: 2.x

I want to add a link next to the title of each blog post that follows the advice here:
http://karlo.org/2009/01/add-retweet-links-to-your-blog.html

bascially, I want to what he did in movable type using variables like this:


<!-- Retweet link script from http://karlo.org/ -->
<script language="Javascript"> 
  document.write('<a href=\"http://twitter.com/home?status=' 
  + escape('RT @USERNAME <$MTEntryTitle$> <$MTEntryPermalink$>') 
  + '\">Retweet</a>');
</script>
<!-- End Retweet link script -->

I am using the pixelgreen skin in 2.4.0 RC1 (I know, need to upgrade!) and it looks like I should edit the file index.main.php in the skins/pixelgreen directory somewhere around here:


				<div class="post bPost bPost<?php $Item->status_raw() ?>" lang="<?php $Item->lang() ?>">

					<?php
						$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
						$Item->anchor(); // Anchor for permalinks to refer to.
					?>


					<h3 class="bTitle"><?php $Item->title(); ?></h3>
					<p><?php
					$Item->author( array(
							'before'    => T_('by').' <strong>',
							'after'     => '</strong>',
						) );
					$Item->msgform_link();
					?></p>

I just need to know how to access the url of the permalink so I can plug it in. I don't even need the javascript since I'm editing the .php directly.

2 Feb 04, 2009 19:27

<?php
echo $Item->get_permanent_url();
?>

¥

3 Feb 04, 2009 19:31

What a cool idea :D

Not sure if it is the best way but it seemed to work for me:


<a href="http://twitter.com/home?status=<?php urlencode($Item->title(array( 'link_type' => 'linkto_url',)) . " " . $Item->permanent_url() ); ?>">Retweet</a>

Lee

4 Feb 04, 2009 19:33

The picture of the arrow in the code above should be an = and an > together.

Cheers
Lee


Form is loading...