Not Solved create a template variable
#1
Not Solved
Hello,

What I want to do is take the following code
$id= $_GET['youtube_vid'];
// get the feed using magpieRSS
include('rss_fetch.inc');
$feed = fetch_rss("http://gdata.youtube.com/feeds/api/users/arawlifestlye/uploads?alt=rss");
$found = false;
foreach ($feed->items as $item){
	if(strstr($item['guid'], $id)){
		$found = true;
		break;
	}
}

if($found){
	$video = $item;
	?>
	<div class="video">
		<h3><?= ucfirst($video["title"]) ?></h3>
		<p><strong>Date :</strong> <?= date("d-m-Y", strtotime($video['pubdate']) ) ?></p>
		<p>
			<a href="http://www.youtube.com?v=<?= $id ?>">View it on YouTube</a><br />
		</p>
		<p><?= $video["description"] ?></p>
		<div class="object">
			<object width="425" height="350">
				<param name="movie" value="http://www.youtube.com/v/<?= $id ?>">
				</param>
				<embed src="http://www.youtube.com/v/<?= $id ?>" type="application/x-shockwave-flash" width="425" height="350"></embed>
			</object>
		</div>
	</div>
	<?php
}else{
	echo "<h3>No Videos Found</h3>";
}

and make it become {$youtuberss}

so that I can enter it in a specific location in my theme.

Thank you for help.

Derrick

Derrick[at]
MyPriceSavings.com
Reply
#2
Not Solved
Install Template Conditionals plugin, then you'll be able to use PHP in templates.
http://community.mybb.com/thread-31860.html
Reply
#3
Not Solved
(2011-03-14, 06:12 AM)Yaldaram Wrote: Install Template Conditionals plugin, then you'll be able to use PHP in templates.
http://community.mybb.com/thread-31860.html


Thank you for the post, I will look at it, I was thinking more of the lines of maybe it acting more like a plugin itself and wasnt sure how to do it. Ill give that link a look though.

thank you for the help

Derrick

Derrick[at]
MyPriceSavings.com
Reply
#4
Not Solved
Most welcome Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)