Files
Testing/js/act/youtube_form.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

264 lines
7.5 KiB
PHP

<?php if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
include(PATHTOINCLUDES."base.php");
$em="";
$sql="SELECT
`you_x_tube`.`id`,
`you_x_tube`.`vid_id`,
`you_x_tube`.`width`,
`you_x_tube`.`height`,
`you_x_tube`.`vid_desc`,
`you_x_tube`.`vid_title`,
`you_x_tube`.`thesort`,
`you_x_tube`.`vid_active`,
`you_x_tube`.`theclicks`,
`you_x_tube`.`ytfeatured`
FROM
`you_x_tube`
WHERE
`you_x_tube`.`youtube` = 'Y'
ORDER BY `you_x_tube`.`thesort` ASC";
$result=$database->database_query($sql) or $em=$em.$database->database_error();
?>
<div class="xmlform" id="youtube_links">
<div class="xmlform_container">
<div class="xmlform_pad">
<?php
$rownum=0;
while ($row = $database->database_fetch_assoc($result)) {$rownum=$rownum+1;?>
<div id="youtube_info_<?php echo $row["id"];?>">
<div style="clear:both;"><label style="float:none;">Active: </label>
<input type="checkbox" class="checkbox"
name="vid_active_<?php echo $rownum;?>" id="vid_active_<?php echo $rownum;?>" value="Y"
onclick="submit_form_item('<?php echo $rownum;?>','vid_active_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','','N');"
<?php if($row["vid_active"]== "Y"){echo "checked=\"checked\"";}?>
/>
<label style="float:none;"> Featured: </label>
<input type="checkbox" class="checkbox ytfeatured"
name="ytfeatured_<?php echo $rownum;?>" id="ytfeatured_<?php echo $rownum;?>" value="Y"
onclick="submit_form_item('<?php echo $rownum;?>','ytfeatured_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','','N');"
<?php if($row["ytfeatured"]== "Y"){echo "checked=\"checked\"";}?>
/>
</div>
<div style="clear:both;"><label>Video ID: </label><input type="text" required pattern="\S" class="text"
size="40" name="vid_id_<?php echo $rownum;?>" id="vid_id_<?php echo $rownum;?>" value="<?php echo $row["vid_id"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','vid_id_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter youtube video id','N');" />
<input type="button"
class="bl_delbutton"
name="preview_<?php echo $rownum;?>"
id="preview_<?php echo $rownum;?>"
value="P" onclick="preview_youtube('<?php echo $rownum;?>');" />
</div>
<div style="clear:both;"><label>Title: </label><input type="text" required pattern="\S" class="text"
size="40" name="vid_title_<?php echo $rownum;?>" id="vid_title_<?php echo $rownum;?>" value="<?php echo stripslashes($row["vid_title"]);?>"
onblur="submit_form_item('<?php echo $rownum;?>','vid_title_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter youtube video title','N');" />
</div>
<div style="clear:both;"><label>Description: </label><textarea
rows=2" cols="30" maxlength="250" required pattern="\S" class="text"
name="desc_<?php echo $rownum;?>" id="desc_<?php echo $rownum;?>" style="padding-left:2px;margin-left:0px;width:200px;"
onblur="submit_form_item('<?php echo $rownum;?>','desc_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter youtube video title','N');
"><?php echo stripslashes($row["vid_desc"]);?></textarea>
<input type="button"
class="bl_delbutton"
name="del_<?php echo $rownum;?>"
id="del_<?php echo $rownum;?>"
value="D" onclick="del_youtube('<?php echo $row["id"];?>','<?php echo $rownum;?>');" />
</div>
<div style="clear:both;">
<label>Sort Order: </label><input type="text" required pattern="\S" class="text" style="width:40px;"
size="4" maxlength="4" name="thesort_<?php echo $rownum;?>" id="thesort_<?php echo $rownum;?>" value="<?php echo $row["thesort"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','thesort_<?php echo $rownum;?>','/js/act/youtube_update.php','id_<?php echo $rownum;?>','you_x_tube','Please enter video order','N');" />
<span style="padding-left:10px;color:#000;"><?php echo $row["theclicks"];?> Clicks</span>
</div>
<div style="clear:both;">
</div>
<input type="hidden" name="id_<?php echo $rownum;?>" id="id_<?php echo $rownum;?>" value="<?php echo $row["id"];?>" />
<input type="hidden" name="o_vid_id_<?php echo $rownum;?>" id="o_vid_id_<?php echo $rownum;?>" value="<?php echo $row["vid_id"]; ?>" />
<input type="hidden" name="o_desc_<?php echo $rownum;?>" id="o_desc_<?php echo $rownum;?>" value="<?php echo $row["vid_desc"]; ?>" />
<input type="hidden" name="o_vid_title_<?php echo $rownum;?>" id="o_vid_title_<?php echo $rownum;?>" value="<?php echo $row["vid_title"]; ?>" />
<input type="hidden" name="o_thesort_<?php echo $rownum;?>" id="o_thesort_<?php echo $rownum;?>" value="<?php echo $row["thesort"]; ?>" />
<input type="hidden" name="o_vid_active_<?php echo $rownum;?>" id="o_vid_active_<?php echo $rownum;?>" value="" />
<input type="hidden" name="o_ytfeatured_<?php echo $rownum;?>" id="o_ytfeatured_<?php echo $rownum;?>" value="" />
<hr />
</div>
<?php }?>
</div>
</div>
<div style="background:red;color:#fff;width:400px;" id="youtube_add">
<div style="padding:10px;">
<div style="clear:both;"><label>Video Id: </label><input type="text" required pattern="\S" class="text"
name="vid_id" id="vid_id" size="40"
onblur="getyoutubevid()" />
<input type="button"
class="bl_delbutton"
name="preview_<?php echo 0;?>"
id="preview_<?php echo 0;?>"
value="P" onclick="preview_youtube('');" />
</div>
<div style="clear:both;"><label>Title: </label><input type="text" required pattern="\S" class="text"
name="vid_title" id="vid_title" size="40" maxlength="60"
onblur="" />
</div>
<div style="position:relative;clear:both;"><label>Description: </label><textarea required pattern="\S" class="textarea"
name="desc" id="desc" cols="30" rows="2" maxlength="250"
onblur="" style="padding-left:2px;margin-left:0px;width:200px;" /></textarea>
<div style="clear:both;"><label>Sort:</label>
<input type="text" required pattern="^[0-9]+$" class="text"
name="thesort" id="thesort" size="4" maxlength="4" style="width:40px;"
onblur="" />
<label style="float:none;padding-left:10px;">Active: </label><input type="checkbox" class="checkbox"
name="vid_active" id="vid_active" value="Y"
onblur="" />
<input type="button" value="Add Video" onclick="add_youtube();" style="position:absolute;right:5px;bottom:0px;" /></div>
</div>
</div>
</div>
</div>