示例#1
0
<div id="center-column">
<div class="top-bar">
<h1>Cpanel - Insert Code</h1>
<div class="breadcrumbs"><a href="index.php?act=addmedia" title="Ad Media">Add Media</a> / <a href="index.php?act=managegames" title="Manage Games">Manage Games</a> / <a href="index.php?act=uploadgames" title="Upload Games">Upload Games</a> / <a href="index.php?act=brokenfiles" title="Broken Files">Broken Files</a></div>
</div><br />
<div class="select-bar">
<label>
<h3>Add Embed Code</h3>
</label>
</div>
<?php 
if (isset($_POST['add'])) {
    $title = yasDB_admin($_POST['title']);
    $desc = yasDB_admin($_POST['description']);
    $thumb = yasDB_admin($_POST['thumbnail']);
    $code = yasDB_admin($_POST['code']);
    yasDB_insert("INSERT INTO games (title, description, category, thumbnail, code, height, width, type) values ('{$title}', '{$desc}', '{$_POST['category']}', '{$thumb}', '{$code}', '', '', 'CustomCode')", false);
    echo '<center>Embed Code successfully added!<br/><br/>';
    echo '<a href="index.php?act=addmedia">Click here to proceed</a><center>';
} else {
    ?>
<div class="table">
		<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	    <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
		<form enctype="multipart/form-data" action="" method="post">
		<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
	    <th class="full" colspan="2">Add Code</th>
	    </tr>
		<tr>
		<td class="first" width="172"><strong>Title</strong></td>
示例#2
0
            move_uploaded_file($_FILES["thumbnail"]["tmp_name"], $setting['sitepath'] . "/img/" . $num . preg_replace('/[^a-zA-Z0-9.-_]/', '', $_FILES["thumbnail"]["name"]));
            move_uploaded_file($_FILES["file"]["tmp_name"], $setting['sitepath'] . "/swf/" . $num . preg_replace('/[^a-zA-Z0-9.-_]/', '', $_FILES["file"]["name"]));
            $img = yasDB_admin("img/" . $num . preg_replace('/[^a-zA-Z0-9.-_]/', '', $_FILES["thumbnail"]["name"]));
            $file = yasDB_admin("swf/" . $num . preg_replace('/[^a-zA-Z0-9.-_]/', '', $_FILES["file"]["name"]));
            $desc = yasDB_admin(trim($_POST['description']));
            $title = yasDB_admin($_POST['title']);
            $height = intval($_POST['height']);
            $width = intval($_POST['width']);
            $instr = yasDB_admin(trim($_POST['instructions']));
            $keywords = yasDB_admin($_POST['keywords']);
            if ($file_ext == 'swf') {
                if ($_POST['height'] or $_POST['width'] <= 0) {
                    list($width, $height, $type, $attributes) = getimagesize($setting['sitepath'] . '/' . $file);
                }
            }
            $query = yasDB_insert("INSERT INTO games (title, description, instructions, keywords, category, thumbnail, file, height, width, type) VALUES ('{$title}', '{$desc}', '{$instr}', '{$keywords}', " . intval($_POST['category']) . ", '{$img}', '{$file}', {$height}, {$width}, '" . yasDB_admin($_POST['type']) . "')", false);
            if ($query) {
                echo '<center><p align="center"><b>Game successfully added!</b></p></center>';
            } else {
                echo '<center><p align="center"><b>Error updating game database!</b></p></center>';
            }
        }
    } else {
        echo '<center>File or thumbnail type not supported</center>';
        exit;
    }
}
?>
 <div class="table">
		<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	    <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
示例#3
0
 $compress = $zip->open($filecompress, ZIPARCHIVE::CREATE);
 if ($compress === true) {
     $zip->addFile($_FILES['file']['tmp_name'][0], $num . $_FILES['file']['name'][0]);
     $zip->addFile($_FILES['file']['tmp_name'][1], $num . $_FILES['file']['name'][1]);
     $zip->addFromString('description.txt', $file_desc);
     $zip->close();
     echo "Zipped successfully";
 } else {
     echo "Zip failed";
 }
 copy($_FILES['file']['tmp_name'][0], $setting['sitepath'] . "/ourgames/img/" . $_FILES['file']['name'][0]);
 $gamename = yasDB_admin($_POST["gamename"]);
 $gamedescript = yasDB_admin($_POST["description"]);
 $thumbpath = yasDB_admin("../ourgames/img/" . $_FILES['file']['name'][0]);
 $gamefilepath = yasDB_admin('../ourgames/games/' . $num . str_replace(GetFileExtension($_FILES['file']['name'][1]), 'zip', $_FILES['file']['name'][1]));
 $mochilink = yasDB_admin($_POST['mochigame']);
 $query = yasDB_insert("INSERT INTO downgames (title, description, thumbnail, file, mochi) VALUES ('{$gamename}', '{$gamedescript}', '{$thumbpath}', '{$gamefilepath}', '{$mochilink}')", false);
 if (!$query) {
     echo "Database Error!";
 } else {
     echo "<center>Files uploaded succesfuly!</center>";
     echo '<br/><center><a href="index.php?act=managedowngame">Click here to to go back</a></center>';
 }
 if (isset($_POST['notify'])) {
     $select_emails = yasDB_select("SELECT * FROM notifydown ORDER BY `id` ", false);
     while ($emails = $select_emails->fetch_array(MYSQLI_ASSOC)) {
         $message = 'New game for your website available for download at ' . $setting['siteurl'] . "\r\n";
         $message .= 'Click here to go to the download section: ' . $setting['siteurl'] . '/index.php?act=download' . "\r\n";
         $message .= 'Name of the game: ' . $gamename . "\r\n";
         $message .= 'Description: ' . $gamedescript . "\r\n";
         $message .= 'To unsubscribe from the notification list please visit this link: ' . $setting['siteurl'] . 'index.php?act=unsubscribe&id=' . $emails['email'];