Recent Topics

1 Jun 24, 2008 06:46    

My b2evolution Version: Not Entered

Hi all, I'm fairly new to the PHP stuff so bear with me while I try to explain.

I've added and iframe section to my sidebar that displays a dynamic image based on a username (for those wondering it's the xbl gamertag image). I can hardcode the string for the image but what I want is to have the url to get the image generated based on the blog name.

I can see the line:

<h3><?php $Blog->disp( 'name', 'htmlbody' ) ?></h3>

that displays the name of the blog in the sidebar

I've added the line:

<p><iframe src="http://gamercard.xbox.com/gamertag.card" scrolling="no" frameBorder="0" height="140" width="204">gamertag</iframe></p>

Below that

Ideally I'd like to have the iframe line dynamically generated based on the 'name' value in the statement above it and replace all the 'gamertag' with 'name'

Thanks,

2 Jun 24, 2008 12:47

<?php
echo '<p><iframe src="http://gamercard.xbox.com/'.$Blog->dget( 'name' ).'.card" scrolling="no" frameBorder="0" height="140" width="204">'.$Blog->dget( 'name' ).'</iframe></p> ';
?>

¥

3 Jun 24, 2008 21:03

Awesome! thank you that worked great.

So I take it if I want to build any html string I can wrap it in the <?php echo' html string ' ?>

I'll be able to use that alot.

Thanks again.


Form is loading...