function Spider_Video_Player_Videos() { wp_enqueue_script('media-upload'); wp_admin_css('thickbox'); require_once "video_functions.php"; // add functions for Spider_Video_Player require_once "video_function.html.php"; // add functions for vive Spider_Video_Player /* ?> <form action="" method="post"> <input type="text" value="asdgadsfg" id="narek" /> <input type="button" onclick="alert(document.getElementById('narek').value);" /> <a href="<?php echo plugins_url("video_function.html.php",__FILE__) ?>?TB_iframe=1&width=640&height=394" class="thickbox add_media" id="content-add_media" title="Add Video" onclick="return false;">Insert Video</a> </form> <?php */ if (isset($_GET["task"])) { $task = htmlspecialchars($_GET["task"]); } else { $task = "default"; } if (isset($_GET["id"])) { $id = htmlspecialchars($_GET["id"]); } else { $id = 0; } switch ($task) { case 'video': show_video(); break; case 'add_video': add_video(); break; case 'published': $nonce_sp_vid = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) { die("Are you sure you want to do this?"); } published($id); show_video(); break; case 'Save': if (!$id) { check_admin_referer('nonce_sp_vid', 'nonce_sp_vid'); save_video(); } else { check_admin_referer('nonce_sp_vid', 'nonce_sp_vid'); apply_video($id); } show_video(); break; case 'Apply': if (!$id) { check_admin_referer('nonce_sp_vid', 'nonce_sp_vid'); save_video(); } else { check_admin_referer('nonce_sp_vid', 'nonce_sp_vid'); apply_video($id); } edit_video($id); break; case 'edit_video': edit_video($id); break; case 'remove_video': $nonce_sp_vid = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) { die("Are you sure you want to do this?"); } remove_video($id); show_video(); break; case 'publish_video': $nonce_sp_vid = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) { die("Are you sure you want to do this?"); } change_video(1); break; case 'unpublish_video': $nonce_sp_vid = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) { die("Are you sure you want to do this?"); } change_video(0); break; default: show_video(); break; } }
//Connect to the database $con = mysql_connect("localhost", "standardUser", "1102 orP kooBcaM"); $url = mysql_real_escape_string($_GET["url"]); //If the connection failed, just return the url if (!$con) { error_log(mysql_error()); echo $url; return; } //If the user can't use the database, return the url again if (!mysql_select_db("PlayApps", $con)) { error_log(mysql_error()); echo $url; return; } $lastFileName = published($con, $url); if ($lastFileName[0] == "") { //Gets the text file for the last used file name. If the program fails to open it, it will give the url distributed. $lastFileNameFile = fopen(dirname(__FILE__) . "/lastFileName.txt", "r+") or fopen(dirname(__FILE__) . "/lastFileName.txt", "x+") or exit($url); //The html for the redirect page $html = "<!DOCTYPE html><html><head><title>Redirecting...</title></head><body><script type='text/javascript'>window.location='" . $url . "';</script></body></html>"; //Get a new file name from the latest one $fileName = increased(file_get_contents("lastFileName.txt")); //Set it in the text file fwrite($lastFileNameFile, $fileName); fclose($lastFileNameFile); //Write the html file $htmlFile = fopen(dirname(__FILE__) . "/l/" . $fileName . ".html", "x"); fwrite($htmlFile, $html); fclose($htmlFile); $query = "INSERT INTO `sharedLinks` (`url`, `shortened`) VALUES ('" . $url . "', " . $fileName . ")";
<tfoot align="center"> <tr> <td colspan="11" style="text-align:center;"> <?php echo $pageNav->getListFooter(); ?> </td> </tr> </tfoot> <?php $k = 0; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row =& $rows[$i]; $checked = JHTML::_('grid.id', $i, $row->id); $published = published($row, $i, 'event'); // prepare link for id column $link = JRoute::_('index.php?option=com_spidercalendar&view=edit_event&calendar=' . JRequest::getVar('calendar') . '&module_id=' . JRequest::getVar('module_id') . '&cid[]=' . $row->id); echo '<tr class="row' . $k . '"> <td>' . $checked . '</td> <td align="center"><a href="' . $link . '">' . $row->id . '</a></td> <td align="center"><a href="' . $link . '">' . $row->title . '</a></td> <td align="center">' . $row->date; if ($row->date_end != "" and $row->date_end != '0000-00-00') { echo " - " . $row->date_end . ""; } echo '</td> <td align="center">' . $row->time . '</td>
public static function show_calendar(&$rows, &$pageNav, &$lists) { JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHtml::_('formbehavior.chosen', 'select'); ?> <script type="text/javascript"> Joomla.submitbutton=function(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel_calendar') { submitform( pressbutton ); return; } submitform( pressbutton ); } Joomla.tableOrdering= function ( order, dir, task ) { var form = document.adminForm; form.filter_order_calendar.value = order; form.filter_order_Dir_calendar.value = dir; submitform( task ); } </script> <form action="index.php?option=com_spidercalendar" method="post" name="adminForm" id="adminForm"> <a style="float:right;color: red;font-size: 19px;text-decoration: none;" target="_blank" href="http://web-dorado.com/products/joomla-calendar.html" > <img style="float:right" src="components/com_spidercalendar/elements/header.png" /><br> <span style="padding-left:25px;">Get the full version </span> </a> <p style="font-size:14px"> <a href="http://web-dorado.com/spider-calendar-guide-step-2.html" target="_blank" style="color:blue;text-decoration:none">User Manual</a><br> This section allows you to create calendars. You can add unlimited number of calendars.<a href="http://web-dorado.com/spider-calendar-guide-step-2.html" target="_blank" style="color:blue;text-decoration:none">More...</a> </p> <table width="100%"> <tr> <td align="left" width="100%"> <input type="text" name="search_calendar" id="search_calendar" value="<?php echo $lists['search_calendar']; ?> " class="text_area" placeholder="Search" style="margin:0px" /> <button class="btn tip hasTooltip" type="submit" data-original-title="Search"><i class="icon-search"></i></button> <button class="btn tip hasTooltip" type="button" onclick="document.id('search_calendar').value='';this.form.submit();" data-original-title="Clear"> <i class="icon-remove"></i></button> <div class="btn-group pull-right hidden-phone"> <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?> </label> <?php echo $pageNav->getLimitBox(); ?> </div> </td> </tr> </table> <table class="table table-striped" > <thead> <tr> <th width="30" class="title"><?php echo "#"; ?> </td> <th width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)"></th> <th width="30" class="title"><?php echo JHTML::_('grid.sort', 'ID', 'id', @$lists['order_Dir'], @$lists['order']); ?> </td> <th><?php echo JHTML::_('grid.sort', 'Title', 'title', @$lists['order_Dir'], @$lists['order']); ?> </th> <th width="30" class="title">Manage Events</td> <th nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort', 'Published', 'published', @$lists['order_Dir'], @$lists['order']); ?> </th> </tr> </thead> <tfoot> <tr> <td colspan="11"> <?php echo $pageNav->getListFooter(); ?> </td> </tr> </tfoot> <?php $k = 0; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row =& $rows[$i]; $checked = JHTML::_('grid.id', $i, $row->id); $published = published($row, $i, 'calendar'); $link = JRoute::_('index.php?option=com_spidercalendar&task=edit_calendar&cid[]=' . $row->id); $link2 = JRoute::_('index.php?option=com_spidercalendar&task=event&calendar=' . $row->id); ?> <tr class="<?php echo "row{$k}"; ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td><?php echo $checked; ?> </td> <td align="center"><?php echo $row->id; ?> </td> <td><a href="<?php echo $link; ?> "><?php echo $row->title; ?> </a></td> <td align="center"><a href="<?php echo $link2; ?> ">Manage events</a></td> <td align="center"><?php echo $published; ?> </td> </tr> <?php $k = 1 - $k; } ?> </table> <input type="hidden" name="option" value="com_spidercalendar"> <input type="hidden" name="task" value="calendar"> <input type="hidden" name="boxchecked" value="0"> <input type="hidden" name="filter_order_calendar" value="<?php echo $lists['order']; ?> " /> <input type="hidden" name="filter_order_Dir_calendar" value="<?php echo $lists['order_Dir']; ?> " /> </form> <?php }