All pastes #831194 Raw Edit

Miscellany

public text v1 · immutable
#831194 ·published 2007-12-24 17:40 UTC
rendered paste body
<xar:set name="forms">#xarTplSetPageTemplateName('forms')#</xar:set>

<xar:set name="$loo">xarVarFetch('textfield', 'str', $youtube, NULL, XARVAR_NOT_REQUIRED)</xar:set>
<xar:set name="$lop">xarVarFetch('vho', 'str', $vho, NULL, XARVAR_NOT_REQUIRED)</xar:set>
<xar:set name="$lor">xarVarFetch('vdec', 'str', $vdec, NULL, XARVAR_NOT_REQUIRED)</xar:set>


#$youtube# <br>
#$vho#  <br>
#$vdec#  <br>




<xar:comment>
<xar:if condition="!empty($vhoster) and !empty($vdec)"><xar:set name="foo"> xarmodapifunc('dynamicdata','admin','create',array('modid' => xarModGetIDFromName('dynamicdata'), 'itemtype' => '3', 'itemid' => '0', 'values' => array('vhoster' => $vhoster, 'vidid' => 'vdec', 'vowner' => xarusergetvar('uid'), 'vdate' => time() , 'vartcon' => 'bos', 'vtype' => 'not ready', 'vfav' => 'buda bos', 'valbum' => 'op1', 'vsong' => 'opt2', 'vdescr' => 'op3', 'vrdate' => 'vclip date')))</xar:set></xar:if>
</xar:comment>


<xar:comment>
<xar:set name="$bamya">xarVarFetch('submit', 'str', $submit, '', XARVAR_NOT_REQUIRED)</xar:set>
<xar:if condition="!empty($submit)">
</xar:if>
</xar:comment>
















<h1><em>ADD VIDEO </em></h1><br>
<form name="profile_form" id="form" method="post" action="#xarservergetcurrenturl()#" enctype="application/x-www-form-urlencoded"> 
<div id="ClientValidationSummary"></div>

<em> Youtube Adress: </em> <input name="textfield" type="text" class="textbox validator-required" id="adrs" title="Field Required" value="#$youtube#" size="48"> 
<xar:comment> trimmed --> (http://)www.youtube.com/watch?v= </xar:comment>
<xar:if condition="!empty($youtube)">
<xar:set name="$webhead">'http://'</xar:set>
<xar:set name="$youhead">substr($youtube,0,7)</xar:set>
<xar:if condition="$webhead eq $youhead">
<xar:set name="$viddat">str_replace($webhead,'',$youtube)</xar:set>
<xar:else/>
<xar:set name="$viddat">$youtube</xar:set>
</xar:if>
</xar:if>

<xar:comment> trimmed --> (www.)youtube.com/watch?v= </xar:comment>
<xar:if condition="!empty($viddat)">
<xar:set name="$webwww">'www.'</xar:set>
<xar:set name="$youwww">substr($viddat,0,4)</xar:set>
<xar:if condition="$webwww eq $youwww">
<xar:set name="$vdat">str_replace($webwww,'',$viddat)</xar:set>
<xar:else/>
<xar:set name="$vdat">$viddat</xar:set>
</xar:if>
</xar:if>

<xar:comment> trimmed --> really that one? (youtube.com)/watch?v= </xar:comment>
<xar:if condition="!empty($vdat)">
<xar:set name="$vidserv">'youtube.com'</xar:set>
<xar:set name="$curserv">substr($vdat,0,11)</xar:set>
<xar:if condition="$vidserv eq $curserv">
<xar:set name="$vho">'Y'</xar:set>
<xar:set name="$vdec">str_replace('youtube.com/watch?v=','',$vdat)</xar:set>
<xar:else/>
<xar:set name="$vdec">''</xar:set>
Not a valid video hoster.
</xar:if>
</xar:if>
<input type="submit" name="submit" value="Add">
</form> 


<xar:if condition="!empty($vdec)">
<div align="center"> 
<embed src="http://www.youtube.com/v/#$vdec#" type="application/x-shockwave-flash" wmode="transparent" width="300" height="243"></embed> 
</div>
<xar:else/>
<div align="center">
<img src="&xar-baseurl;#xarTplGetThemeDir()#/style/images/video.gif">
</div>
</xar:if>


<xar:if condition="!empty($vdec)">
<xar:set name="$rssfile">'http://gdata.youtube.com/feeds/api/videos/'.$vdec</xar:set>
<xar:set name="$entry">simplexml_load_file($rssfile)</xar:set>
<xar:set name="$ytitle">$entry->xpath('//media:title')</xar:set><em>Title:</em> #$ytitle[0]# <br>
<xar:set name="$ydescription">$entry->xpath('//media:description')</xar:set><em>Description:</em> #$ydescription[0]# <br>
<xar:set name="$ykeywords">$entry->xpath('//media:keywords')</xar:set><em>Keywords:</em> #$ykeywords[0]# <br>
</xar:if>
<hr>













<br><br>
//Todo (hidden data)<br>
*give a unique id for this video <br>
*youtube video? record Y to database -->will define video hoster when many video hoster supported <br>
*record video id to database <br>
*record who added this video <br>
*record when this video submitted<br><br>

<form name="profile_formb" id="form" method="post" action="#xarservergetcurrenturl()#" enctype="application/x-www-form-urlencoded"> 
<em>Artist Connection:</em>  <input name="housepage" type="text" value="" size="24">
//Todo Ajax powered textfield, autocomplete artist, required field* <br>
<em>Video Type: <select name="vtype"><option selected="selected">videoclip</option><option>concert</option><option>documentary</option><option>other</option></select></em>// required field <br> 
<em>Album Connection:</em>  <input name="house" type="text" value="" size="24"><br>
<em>Description:</em>  <input name="hous" type="text" value="" size="24"><br>
<em>Song Name:</em>  <input name="houe" type="text" value="" size="24"><br>
<em>Vclip Release Date:</em>  <input name="houe" type="text" value="" size="24"><br>
<em>Add to favorite videos?</em> <input name="hide" type="checkbox" value="" /><br>
<input type="submit" name="submitab" value="Add" /><br>
</form> 
<br><br>
<hr>
<xar:data-view module="dynamicdata" itemtype="3" fieldlist="vuid,vhoster,vidid,vowner,vdate,vartcon,vtype,vfav,valbum,vsong,vdescr,vrdate" layout="list" linkfield="N/A" numitems="20" startnum="1" />
<br>