Front page
Split forum twig
GuestBook Twig
Youtube RSS Xtscript
Paged RSS Xtscript
This sites css
slottyslot
KMan2100
DemolitionMissions
VanossGaming
BadLipReading
Uploaded
Length
Views
Rating
||
••
1
••
Main function script
Copy to
/tube.xt
#exportable #<!-- function tube {{ $channels; $channel_button=Go; $youtube_user; $per_page=5; $uploaded=Uploaded; $length=Length; $views=Views; $rating=Rating; $sub=0; $layout=full; $theme=dark; $count=shown; }} # Other query string values get_or_default page;1 get vid # Set initial values var $count=1 var $offset=3 # Get rss feed var $raw_feed=<xt:feed feed="https://www.youtube.com/feeds/videos.xml?user=$youtube_user" number="0" template="||.title..description.¦.pubDate." >|| var $raw_feed_end=call strlen $val=$raw_feed # Create containers print <div class="xt_forum" style="padding:0px;margin:0px;" id="tube" > print <div id="tube"> # Channel selector and channel subscribe print <div class="controls compo"> # Channel subscribe if not $sub goto @no_sub endif print <script src="https://apis.google.com/js/platform.js"></script> var $sub_button=<div class="g-ytsubscribe" data-channel="$youtube_user" data-layout="$layout" data-theme="$theme" data-count="$count"></div> print <div style="margin-top:4px">$sub_button</div> @no_sub # Channel select if not $channels goto @main endif var $channels=$channels, var $action=<xt:url noquery="1" /> var $c_offset=0 print <form action="$action#tube" method="post"> print <div> print <select name="channel" > @ch_sel_loop var $ch_sep=call strpos $haystack=$channels;$needle=,;$offset=$c_offset if not $ch_sep goto @end_ch endif var $ch_option=call substr $val=$channels;$start=$c_offset;$length=($ch_sep-$c_offset) if $ch_option==$youtube_user print <option value="$ch_option" selected="selected"> else print <option value="$ch_option"> endif print $ch_option</option> var $c_offset=($ch_sep+1) goto @ch_sel_loop @end_ch print </select> print <input class="submit" style="display:inline" type="submit" value="$channel_button"/> print </div> print </form> @main print </div> print <div class="threads"> # Main loop var $device=<xt:get_device_template /> @loop # discard entries not on this page if $count > ($page*$per_page) goto @skip_output elseif $count <= ($page-1*$per_page) goto @skip_output endif # Chop up feed entry # Title var $start_video_title=($offset-1) var $end_video_title=call strpos $haystack=$raw_feed;$needle=<div;$offset=$offset var $youtube_video_title=call substr $val=$raw_feed;$start=$start_video_title;$length=($end_video_title-$start_video_title) # Id code var $start_video_code=call strpos $haystack=$raw_feed;$needle=?v=;$offset=$offset var $end_video_code=call strpos $haystack=$raw_feed;$needle=&;$offset=$offset var $youtube_video_code=call substr $val=$raw_feed;$start=($start_video_code+3);$length=($end_video_code-$start_video_code-3) # Description var $start_video_description=call strpos $haystack=$raw_feed;$needle=<span>;$offset=$offset var $end_video_description=call strpos $haystack=$raw_feed;$needle=</span>;$offset=$offset var $youtube_video_description=call substr $val=$raw_feed;$start=($start_video_description+6);$length=($end_video_description-$start_video_description-6) # Length var $start_video_length=call strpos $haystack=$raw_feed;$needle=Time:;$offset=$offset var $end_video_length=call strpos $haystack=$raw_feed;$needle=</span></td>;$offset=$offset var $youtube_video_length=call substr $val=$raw_feed;$start=($start_video_length+79);$length=($end_video_length-$start_video_length-79) # Views var $start_video_views=call strpos $haystack=$raw_feed;$needle=Views;$offset=$offset var $end_video_views=call strpos $haystack=$raw_feed;$needle=div style="white-space:;$offset=$offset var $youtube_video_views=call substr $val=$raw_feed;$start=($start_video_views+14);$length=($end_video_views-$start_video_views-22) # Rating images var $start_video_rating=call strpos $haystack=$raw_feed;$needle=<div style="white-space:;$offset=$offset var $end_video_rating=call strpos $haystack=$raw_feed;$needle=gif"></div>;$offset=$offset var $youtube_video_rating=call substr $val=$raw_feed;$start=$start_video_rating;$length=($end_video_rating+11-$start_video_rating) var $semi=call chr $val=59 var $youtube_video_rating=call str_replace $subject=$youtube_video_rating;$search=le=";$replace=le="display:inline$semi var $youtube_video_rating=call str_replace $subject=$youtube_video_rating;$search=align="top";$replace # Upload date var $start_upload_date=call strpos $haystack=$raw_feed;$needle=¦;$offset=$offset var $end_upload_date=call strpos $haystack=$raw_feed;$needle=+0000;$offset=$offset var $youtube_video_upload_date=call substr $val=$raw_feed;$start=($start_upload_date+2);$length=($end_upload_date-$start_upload_date-2) # Output entry using forum classes print <div id="vid$count" class="post"> print <div class="breadcrumbs compo" style="word-wrap:break-word;overflow:hidden;font-size:.9em"><b>$youtube_video_title</b></div> # Mobiles # direct youtube links if $device==mobile print <a href="http://m.youtube.com/watch?v=$youtube_video_code"><img alt="" src="http://i.ytimg.com/vi/$youtube_video_code/default.jpg"></a> # Embed current selected video (web/touch only) elseif $vid==$count print <xt:embed_video url="http://www.youtube.com/watch?v=$youtube_video_code" /> else # Web/touch # links to embed the video in the page print <div style="float:left;margin:0 3px 3px 3px"><a href="?vid=$count&page=$page#vid$count"><img alt="" src="http://i.ytimg.com/vi/$youtube_video_code/default.jpg"></a></div> endif # Entry details print <div style="word-wrap:break-word;overflow:hidden;float:left;max-width:440px;padding-top:.5em"> $youtube_video_description </div> # Meta data print <div class="meta" style="clear:both"> print <span style="display:inline-block"><b>$uploaded </b>$youtube_video_upload_date </span> print <span style="display:inline-block"><b>$length </b>$youtube_video_length </span> print <span style="display:inline-block"><b>$views </b>$youtube_video_views </span> print <span style="display:inline-block"><b>$rating </b>$youtube_video_rating</span> print </div> print </div> @skip_output # Move to next entry var $offset=call strpos $haystack=$raw_feed;$needle=||;$offset=($offset+3) var $offset=($offset+3) # loop back if still more entries if $offset < $raw_feed_end var $count=($count+1) goto @loop endif print </div> # Pagination print <div class="xt_pagination"> var $page_num=call ceil $num=($count/$per_page) if $page == 1 print <span><a><span>••</span></a></span> goto @current else print <span><a href="?page=1#tube"><span>« </span></a></span> endif if $page >3 print <span><a href="?page=($page-3)&#tube"><span> call floor $num=($page-3) print </span></a></span> endif if $page >2 print <span><a href="?page=($page-2)&#tube"><span> call floor $num=($page-2) print </span></a></span> endif print <span><a href="?page=($page-1)&#tube"><span> call floor $num=($page-1) print </span></a></span> @current print <span class="selected"><span>$page</span></span> if $page < ($count/$per_page) print <span><a href="?page=($page+1)#tube"><span> call floor $num=($page+1) print </span></a></span> endif if ($page+1) < ($count/$per_page) print <span><a href="?page=($page+2)#tube"><span> call floor $num=($page+2) print </span></a></span> endif if ($page+2) < ($count/$per_page) print <span><a href="?page=($page+3)#tube"><span> call floor $num=($page+3) print </span></a></span> endif if $page < $page_num print <span><a href="?page=$page_num#tube"><span>»</span></a></span> else print <span><a><span>••</span></a></span> endif print </div> # Close blog post list containers print </div></div> endfunction #-->
function calling script
This script Goes on the page
<!--parser:xtscript--> get channel if $channel call cookie::set $name=tube;$val=$channel ;$expire=86400;$force_current=1 endif var $youtube_channel=call cookie::get {{$name=tube; $default=VanossGaming; }} include tube.xt call @tube {{ $channels=slottyslot,KMan2100,DemolitionMissions,VanossGaming,BadLipReading; $channel_button=Go; $youtube_user=$youtube_channel; $per_page=3; $uploaded=Uploaded; $length=Length; $views=Views; $rating=Rating; $sub=1; $layout=full; $theme=dark; $count=shown; }} <!--/parser:xtscript-->
Log in