How to place image

Discussion in 'PHP' started by msk19994, Sep 3, 2011.

  1. #1
    Hey Guys
    The thing is that i have a site called Streaming Series and on that there is the rss feed the thing is that the rss feed has the code to show the images but it doesnt the rss feed url is
    Feed
    so i think the problem is that the feed is trying to get images from the play page if yes then can u provide me code to add to play page so that i can have image of episodes displayed there
    or u can modify the rss so that it grabs from the shows main page
    Main Page
    as it contains the images for the episodes
    And The Code For The Rss Is
    <?php
    @set_time_limit(0);
    @extract($_GET);
    
    require_once("vars.php");
    require_once("includes/show.class.php");
    $show = new Show();
    
    if (@$all){
    	$limit = 10000000;
    } else {
    	$limit = 20;
    }
    
    $episodes = $show->getLastAdditions($limit,@$perma);
    
    if (count($episodes)){
    	$content = '';
    	$content.= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
    	$content.= '<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?>'."\n";
    	$content.= '<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?>'."\n";
    	$content.= '<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">'."\n";
    	
    	$now = date("D, d M Y H:i:s T");
    	
    	$content.= "<channel>\n";
    	$content.= "	<title>$sitename</title>\n";
    	$content.= "	<link>$baseurl</link>\n";
    	$content.= "	<description>TV show and movie resource</description>\n";
    	$content.= "	<lastBuildDate>$now</lastBuildDate>\n";
    	$content.= "	<language>en</language>\n";
    	$content.= "	<generator>http://tvstreamscript.com</generator>\n";
    
    	foreach($episodes as $key=>$val){
    		extract($val);
    		$pubdate = date("D, d M Y H:i:s T",strtotime($date_added));
    		
    		if (@$all) $description.="\n\nEMBED:\n$embed";
    		
    		$content.= "	<item>\n";
    		if (@$pics){
    			if (@$val['thumbnail']){
    				$thumb = $val['thumbnail'];
    			} else {
    				$thumb = $val['show_thumbnail'];
    			}
    			
    			$thumb = $baseurl."/thumbs/".$thumb;
    			$content.="		<thumbnail>$thumb</thumbnail>\n";
    		}
    		$content.= "		<title>".htmlspecialchars(stripslashes(utf8_encode($showtitle)))." - ".htmlspecialchars(utf8_encode(stripslashes($title)))."</title>\n";
    		$content.= "		<link>$baseurl/$perma/season/$season/episode/$episode</link>\n";
    		$content.= "		<comments>$baseurl/$perma/season/$season/episode/$episode</comments>\n";
    		$content.= "		<pubDate>$pubdate</pubDate>\n";
    		$content.= "		<description><![CDATA[".htmlspecialchars(utf8_encode($description))."]]></description>\n";
    		$content.= "		<content:encoded><![CDATA[".htmlspecialchars(utf8_encode($description))."]]></content:encoded>\n";
    		$content.= "	</item>\n";
    	}
    	
    	$content.="</channel>\n";
    	$content.="</rss>";
    	header ("content-type: text/xml");
    	print($content);
    
    }
    ?>
    Code (markup):
    I would be highly obliged if you could help me out
    Thankyou
     
    msk19994, Sep 3, 2011 IP
  2. msk19994

    msk19994 Well-Known Member

    Messages:
    1,030
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Here i am providing the two codes one of the main tv show page and the other one is of the episode page if some 1 could implement the images in the episode page then it would be great i tried but was getting alot of errors

    Here is the show page code

    {config_load file=test.conf section="setup"}
    {include file="header.tpl" title=header}
    
    {if $thisshow neq ''}
    	{foreach from=$thisshow key=id item=val}
    <div class="post">
    	<div class="title">
    		<h2>
    			<span style="float:left;">{$val.title}</span>
    			<div class="seasonselect">
    				{if $seolinks eq 1}
    				<a href="{$baseurl}/{$val.permalink}">All</a>
    				{else}
    				<a href="{$baseurl}/index.php?menu=show&perma={$val.permalink}">All</a>
    				{/if}
    				{if $thisseasons neq ''}
    					{foreach from=$thisseasons key=k item=v}
    						{if $seolinks eq 1}
    						<a href='{$baseurl}/{$val.permalink}/season/{$v}'>Season {$v}</a>
    						{else}
    						<a href='{$baseurl}/index.php?menu=show&perma={$val.permalink}&season={$v}'>Season {$v}</a>
    						{/if}
    					{/foreach}
    				{/if}
    			</div>
    			<br style="clear:both;" />
    		</h2>
    		<br style="clear:both;" />
    	</div>
    
    	<div class="featured">
    		{if $seolinks eq 1}
    			<a href="{$baseurl}/{$val.permalink}"><img src="{$baseurl}/thumbs/m_{$val.thumbnail}" alt="" style="width:100%"/></a>
    		{else}
    			<a href="{$baseurl}/index.php?menu=show&perma={$val.permalink}"><img src="{$baseurl}/thumbs/m_{$val.thumbnail}" alt="" style="width:100%"/></a>
    		{/if}
    	</div>
    	<div class="box">
    		<div style="padding:10px;">
    			<strong>Show summary: </strong><br />
    			{$val.description}
    		</div>
    	</div>
    
    	{/foreach}
    	
    	<br style="clear:both;" />
    	<div class="box">
    		{if $thisepisodes neq ''}
    			{foreach from=$thisepisodes key=id item=val}
    				<div class="box">
    					{if $seolinks eq 1}
    					<a href="{$baseurl}/{$val.perma}/season/{$val.season}/episode/{$val.episode}"><img alt="" src="{$baseurl}/thumbs/{$val.thumbnail}" class="postim"></a>
    					<div class="title" style="padding-top: 10px;">
    							<h3><a href="{$baseurl}/{$val.perma}/season/{$val.season}/episode/{$val.episode}">{$val.showtitle} - Season {$val.season} Episode {$val.episode}</a></h3>
    					</div>
    					{else}
    					<a href="{$baseurl}/index.php?menu=episode&perma={$val.perma}&season={$val.season}&episode={$val.episode}"><img alt="" src="{$baseurl}/thumbs/{$val.thumbnail}" class="postim"></a>
    					<div class="title" style="padding-top: 10px;">
    							<h3><a href="{$baseurl}/index.php?menu=episode&perma={$val.perma}&season={$val.season}&episode={$val.episode}">{$val.showtitle} - Season {$val.season} Episode {$val.episode}</a></h3>
    					</div>
    					{/if}
    					<div class="cover">
    						<div class="entry">
    							<p>{$val.description}</p>
    						</div>
    					</div>
    				</div>
    			{/foreach}
    		{/if}
    	</div>
    </div>
    {else}
    <div class="post">
    	<div class="title">
    		<h2>Error</h2>
    	</div>
    	<p style="text-align:center;">Invalid ID provided</p>
    </div>
    
    {/if}
    
    {include file="footer.tpl" title=footer}
    Code (markup):


    And Here is the episode page code
    {config_load file=test.conf section="setup"}
    {include file="header.tpl" title=header}
    {if $thisepisode neq ''}
    
    <div class="post">
    	<div class="title">
    		<h2> {$thisepisode.showtitle} - {$thisepisode.title} </h2>
    	</div>
    	<div class="cover">
    		<div class="entry">
    			<div style="float:left;">
    				<strong style="display:block; float:left;padding-top: 1px;">Rate this episode:&nbsp;&nbsp; </strong>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 0.25}checked='checked'{/if} value="0.25"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 0.5}checked='checked'{/if} value="0.5"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 0.75}checked='checked'{/if} value="0.75"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 1}checked='checked'{/if} value="1"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 1.25}checked='checked'{/if} value="1.25"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 1.5}checked='checked'{/if} value="1.5"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 1.75}checked='checked'{/if} value="1.75"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 2}checked='checked'{/if} value="2"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 2.25}checked='checked'{/if} value="2.25"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 2.5}checked='checked'{/if} value="2.5"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 2.75}checked='checked'{/if} value="2.75"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 3}checked='checked'{/if} value="3"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 3.25}checked='checked'{/if} value="3.25"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 3.5}checked='checked'{/if} value="3.5"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 3.75}checked='checked'{/if} value="3.75"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 4}checked='checked'{/if} value="4"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 4.25}checked='checked'{/if} value="4.25"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 4.5}checked='checked'{/if} value="4.5"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 4.75}checked='checked'{/if} value="4.75"/>
    				<input class="auto-submit-star {literal}{split:4}{/literal}" type="radio" name="star" {if $thisepisode.rating eq 5}checked='checked'{/if} value="5"/>	
    			</div>
    			<div class="brokenlink"><a href='javascript:void(0);' onclick="reportEpisode();">Report broken episode</a></div>
    			<br style="clear:both;" /><br /><br />
    			
    			{if $graboidad}
    				{$graboidad}
    			{/if}
    
    			<p>{$thisepisode.description}</p>
    			<br style="clear:both" />
    	
    	
    			{if $videoad}
    			<center>
    				{$videoad}
    			</center>
    			<br style="clear:both;" />   
    			{/if}
       
    			<div class="multi-selector">
    				<ul style="list-style:none !important">
    					{foreach from=$thisepisode.embeds key=id item=val name=titles}
    						<li class="selector {if $smarty.foreach.titles.first} selected {/if}" id="selector{$val.id}" style="list-style:none !important;">
    							<a href="javascript:void(0);" onclick="changeEmbed({$val.id});"><span>{$val.type}</span></a>
    						</li>
    					{/foreach}
    				</ul>
    				<div style="clear:both;"></div>
    				<div class="embeds" style="padding:0px !important; overflow: hidden !important; width:100% !important;">
    					<ul>						
    						<li id="embedcontainer" style="margin:0px !important;">
    							
    						</li>
    					</ul>
    				</div>
    			</div>
    			<br style="clear:both;" />
    			<iframe src="http://www.facebook.com/plugins************href={$fullurl}&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;colorscheme=light&amp;height=40" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:40px;" allowTransparency="true"></iframe>
    		</div>
    	</div>
    	
    	<script>
    		var embeds = [];
    		{foreach from=$thisepisode.embeds key=id item=val name=embeds}
    		embeds[{$val.id}] = '{$val.embed|replace:"'":'"'}';
    		{/foreach}
    		changeEmbed(0);
    	</script>
    	
    	<div id="commentsbox">
    		<div id="respond" class="rounded">
    			<h3 id="comments">Submit a link for this episode</h3>
    			{if $loggeduser_id eq 0}
    				<center><br />You must be logged in to submit a link<br /><br /><br /></center>
    			{else}
    				<form action="{$current_url}" method="post" id="commentform" class="comments">
    					{if $linkerror neq ''}
    						<span style="color:#aa0000">{$linkerror}</span><br style="clear:both;" /><br />
    					{/if}
    					{if $linksuccess eq 1}
    						<span style="color:#00aa00">Thank you! We will review your submission shortly</span><br style="clear:both;" /><br />
    					{/if}
    					<label for="linktitle">Link title: </label><input type="text" name="linktitle" style="width: 96%"/>
    					<label for="link">URL: </label><input type="text" name="link" style="width: 96%" />
    					<input type="submit" value="Submit link" name="addlink" id="commentSubmit" />
    				</form>
    			{/if}
    		</div>
    	</div>
    	
    	{if $links neq ''}
    	<div id="commentsbox">
    		<div id="respond" class="rounded">
    			<h3 id="comments">{$link_title}</h3>
    			<ol class="commentlist">
    				{foreach from=$links key=key item=val}
    					<li class="comment even thread-even depth-1">
    						<div class="comment-body">
    							<div class="comment-author vcard">
    								<cite class="fn"><strong>{$val.username}</strong> submitted: </cite>
    							</div>
    							<p><a href="{$val.link}" target="_blank">{$val.linktitle}</a> (on {$val.linkdomain})</p>
    						</div>
    					</li>
    				{/foreach}
    			</ol>
    			<br style="clear:both;" />
    		</div>
    	</div>
    	{/if}
    	
    	<div id="commentsbox">
    		<div id="respond" class="rounded">
    			<h3 id="comments">What do you think?</h3>
    			{if $loggeduser_id eq 0}
    				<center><br />You must be logged in to leave a comment<br /><br /><br /></center>
    			{else}
    				<form action="{$current_url}" method="post"  class="comments" id="commentform">
    					<textarea name="comment" style="width:98%; height: 80px"></textarea><br /><br />
    					<input type="submit" value="Leave comment" name="addcomment" id="commentSubmit" />
    				</form>
    			{/if}
    		</div>
    	</div>
    	
    	{if $comments neq ''}
    	<div id="commentsbox">
    		<div id="respond" class="rounded">
    			<h3 id="comments">{$comment_title}</h3>
    			<ol class="commentlist">
    				{foreach from=$comments key=key item=val}
    
    
    					<li class="comment even thread-even depth-1">
    						<div class="comment-body">
    							<div class="comment-author vcard">
    								<cite class="fn"><strong>{$val.username}</strong> says:</cite>
    							</div>
    							<p>{$val.comment}</p>
    						</div>
    					</li>
    				{/foreach}
    			</ol>
    			<br style="clear:both;" />
    		</div>
    	</div>
    	{/if}
    </div>
    
    <div id="modal" style="display:none">
     <a href='javascript:void(0)' onclick="$('#backgroundPopup').hide(); $('#modal').hide(); $('object').show(); $('iframe').show();" style="float:right;margin-right: 10px; margin-bottom: 10px;">Close</a>
     <br style="clear: both;" />
     <div id="reportcontent">
     Please describe the problem in few words<br style="clear:both;" />
     <input type="text" id="problem" style="width:98%" /> <input type="button" value="Submit" onClick="doReportEpisode({$thisepisode.episodeid});" />
     </div>
    </div>
    <div id="backgroundPopup"></div>
    
    {else}
    	<center><br /><br />Invalid episode ID</center>
    {/if}
    
    <script>
    {literal}$(function(){{/literal}
    {literal}$('.auto-submit-star').rating({{/literal}
    {literal}callback: function(value, link){{/literal}
      $.get("{$baseurl}/ajax/addrating.php",
    {literal}{{/literal}
    		episode: {$thisepisode.episodeid},
    		rating: value
    {literal}}, function(resp) {{/literal}
    {literal}}); {/literal}
    {literal}}{/literal}
    {literal}});{/literal}
    {literal}});{/literal}
    </script>
    {include file="footer.tpl" title=footer}
    Code (markup):
     
    msk19994, Sep 6, 2011 IP