Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include "head.php";
- include "config.php";
- global $_CONFIG;
- define("MONO_ON", 1);
- require "class/class_db_{$_CONFIG['driver']}.php";
- $db=new database;
- $db->configure($_CONFIG['hostname'],
- $_CONFIG['username'],
- $_CONFIG['password'],
- $_CONFIG['database'],
- $_CONFIG['persistent']);
- $db->connect();
- $c=$db->connection_id;
- $set=array();
- $settq=$db->query("SELECT * FROM settings");
- while($r=$db->fetch_row($settq))
- {
- $set[$r['conf_name']]=$r['conf_value'];
- }
- print <<<EOF
- <script language="JavaScript">
- <!--
- function getCookieVal (offset) {
- var endstr = document.cookie.indexOf (";", offset);
- if (endstr == -1)
- endstr = document.cookie.length;
- return unescape(document.cookie.substring(offset, endstr));
- }
- function GetCookie (name) {
- var arg = name + "=";
- var alen = arg.length;
- var clen = document.cookie.length;
- var i = 0;
- while (i < clen) {
- var j = i + alen;
- if (document.cookie.substring(i, j) == arg)
- return getCookieVal (j);
- i = document.cookie.indexOf(" ", i) + 1;
- if (i == 0) break;
- }
- return null;
- }
- function SetCookie (name,value,expires,path,domain,secure) {
- document.cookie = name + "=" + escape (value) +
- ((expires) ? "; expires=" + expires.toGMTString() : "") +
- ((path) ? "; path=" + path : "") +
- ((domain) ? "; domain=" + domain : "") +
- ((secure) ? "; secure" : "");
- }
- function DeleteCookie (name,path,domain) {
- if (GetCookie(name)) {
- document.cookie = name + "=" +
- ((path) ? "; path=" + path : "") +
- ((domain) ? "; domain=" + domain : "") +
- "; expires=Thu, 01-Jan-70 00:00:01 GMT";
- }
- }
- // -->
- </script>
- <script language="JavaScript">
- var usr;
- var pw;
- var sv;
- function getme()
- {
- usr = document.login.username;
- pw = document.login.password;
- sv = document.login.save;
- if (GetCookie('player') != null)
- {
- usr.value = GetCookie('username')
- pw.value = GetCookie('password')
- if (GetCookie('save') == 'true')
- {
- sv[0].checked = true;
- }
- }
- }
- function saveme()
- {
- if (usr.value.length != 0 && pw.value.length != 0)
- {
- if (sv[0].checked)
- {
- expdate = new Date();
- expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
- SetCookie('username', usr.value, expdate);
- SetCookie('password', pw.value, expdate);
- SetCookie('save', 'true', expdate);
- }
- if (sv[1].checked)
- {
- DeleteCookie('username');
- DeleteCookie('password');
- DeleteCookie('save');
- }
- }
- else
- {
- alert('You must enter a username/password.');
- return false;
- }
- }
- </script>
- <TITLE>{$set['game_name']}</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <style type="text/css">
- <!--
- body {
- background-color: #c1cdc1;
- }
- A:link {
- FONT-SIZE: 11px; COLOR: #197201; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
- }
- A:active {
- FONT-SIZE: 11px; COLOR: #197201; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
- }
- A:visited {
- FONT-SIZE: 11px; COLOR: #197201; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
- }
- A:hover {
- FONT-SIZE: 11px; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: underline overline
- }
- TD {
- FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
- }
- .input {
- BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 8px; BORDER-LEFT: #000000 1px solid; COLOR: #ffffff; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: verdana;
- }
- -->
- </style>
- </HEAD>
- EOF;
- print "
- <center>
- <legend>{$set['game_name']}</legend>
- <form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">
- Username: <input type=text name=username>
- Password: <input type=password name=password>
- <input type=submit value=Login></form><br />";
- $dir = "pictures/";
- $extensions = "gif,png,jpg,jpeg";
- $imagesPerPage = "{$set['perpage']}";
- if(!isset($_GET['page'])){
- $page = 1;
- }else{
- $page = $_GET['page'];
- }
- $images = glob($dir."*.{".$extensions."}", GLOB_BRACE);
- $totalImages = count($images);
- $totalPages = ceil($totalImages / $imagesPerPage);
- if($page > $totalPages){
- $page = $totalPages;
- }
- $from = ($page * $imagesPerPage) - $imagesPerPage;
- for($i = $from; $i < ($from + $imagesPerPage); $i++){
- if($i == $totalImages){
- echo "<td width='250' align='center'><img src='{$images[$i]}' alt='{$images[$i]}' width='450' height='250' />
- </td>";
- }
- if($i < $totalImages){
- $filename=$images[$i];
- $name = pathinfo($filename)['filename'];
- $tt=$db->query("SELECT * FROM images WHERE id=$name ORDER BY id ASC");
- $q=$db->fetch_row($tt);
- echo "<td width='250' align='center'>
- <h3><b>{$q['imagetitle']}</b></h3>
- <img src='{$images[$i]}' alt='{$images[$i]}' width='{$q['imagewidth']}' height='{$q['imageheight']}' /><br />
- <b>Owner:</b> {$q['owner']}<br/>
- <b>Description: </b>{$q['imagedesc']}<br />
- <b>Type: </b>{$q['imagetype']}<br />
- <b>Image Size:</b>{$q['imagewidtho']}x{$q['imageheighto']}<br />
- <b>Cost:</b> {$q['imagecost']} GBP<br />
- <form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
- <input type=hidden name=cmd value=_xclick>
- <input type='hidden' name='business' value='{$set['paypal']}'>
- <input type='hidden' name='item_name' value='{$domain}|Picture|{$q['imagetitle']}'>
- <input type='hidden' name='amount' value='{$q['imagecost']}'>
- <input type='hidden' name='shipping' value='0'>
- <input type='hidden' name='return' value='http://{$domain}/{$images[$i]}'>
- <input type='hidden' name='cancel_return' value='http://{$domain}/donatordone.php?action=cancel'>
- <input type='hidden' name='notify_url' value='http://{$domain}/ipn_donator.php'>
- <input type='hidden' name='cn' value='Your E-mail'>
- <input type='hidden' name='currency_code' value='GBP'>
- <input type='hidden' name='tax' value='0'>
- <input type='image' src='https://www.paypalobjects.com/webstatic/en_US/i/btn/png/gold-pill-paypalcheckout-26px.png' border='0' name='submit' alt='Make payments with PayPal - it's fast, free and secure!'>
- </form>
- </td>
- </tr><tr><td>
- ";
- }}
- for($p = 1; $p <= $totalPages; $p++){
- if($p == $page){
- $tmp_pages[] = "<font color='grey' size='+1'><strong>{$p}</strong></font>";
- }else{
- $tmp_pages[] = "<a href='?page={$p}'>{$p}</a>";
- }
- }
- echo "
- </td></tr></table>";
- echo "<br />" . implode(" . ", $tmp_pages);
- print "</center>";
- print <<<OUT
- </BODY>
- </HTML>
- OUT;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement