Commit Pertama setelah upload

This commit is contained in:
Muhammad Iqbal Rifai 2018-06-12 23:40:22 +07:00 committed by GitHub
parent ad9c8d7e05
commit c1bd269747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 1599 additions and 0 deletions

226
acp.php Normal file
View File

@ -0,0 +1,226 @@
<?php
session_start();
require_once('libs/lib.php'); //global used fonctions
@include('config.php'); //configuration file generated by install.php
if(!defined('CONFIG')) exit(setup());
clean_token(); //Destroy tokens for more security
if( !isset($_GET['crk']) )
clean_add_token();
elseif( isset($_GET['crk']) AND $_GET['crk'] != "addrelease" )
clean_add_token();
$wrong = '';
if(isset($_POST['pass']))
{
if($_POST['pass'] == $config['pass'])
{
$_SESSION['pass'] = $config['pass'];
}
else
{
$wrong = '<font color="red">Wrong Password !</font>';
}
}
ob_start();
if(isset($_SESSION['pass']) && $_SESSION['pass'] == $config['pass'])
{
define('ACPPAGE', true);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="design/default.css" media="screen,projection" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $config['team']; ?> Releases RSS Feed" href="rss.xml" />
<link rel="shortcut icon" href="design/favicon.ico" />
<title><?php echo $config['team']; ?> Release Portal</title>
<script>
function inputClick(valeur, obj)
{
if(valeur == obj.value) obj.value = '';
}
function getXhr()
{
var xhr = null;
if(window.XMLHttpRequest) // Firefox et autres
xhr = new XMLHttpRequest();
else if(window.ActiveXObject){ // Internet Explorer
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xhr;
}
function change(id)
{
document.getElementById('update' + id).style.display = 'inline';
document.getElementById('button' + id).value = "save";
}
function saverow(id)
{
var xhr = getXhr();
var name = document.getElementById('name' + id).value;
var url = document.getElementById('url' + id).value;
var fansuber = document.getElementById('fansuber' + id).value;
var token = document.getElementById('token').value;
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('button' + id).value = "saved";
}
}
xhr.open("GET","acpajax.php?id=" + encodeURI(id) + "&name=" + encodeURI(name) + "&url=" + encodeURI(url) + "&fansuber=" + encodeURI(fansuber) + "&token=" + encodeURI(token),true);
xhr.send(null);
xhr.open("GET","acpajax.php?id=" + encodeURI(id) + "&name=" + encodeURI(name) + "&url=" + encodeURI(url) + "&fansuber=" + encodeURI(fansuber) + "&token=" + encodeURI(token),true);
xhr.send(null);
}
function delrow(id)
{
var xhr = getXhr();
var name = document.getElementById('name' + id).value;
var url = document.getElementById('url' + id).value;
var fansuber = document.getElementById('fansuber' + id).value;
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('update' + id).style.display = 'none';
document.getElementById('sure' + id).style.display = 'inline';
}
}
xhr.open("GET","acpajax.php",true);
xhr.send(null);
}
function delrowsure(id)
{
var xhr = getXhr();
var name = document.getElementById('name' + id).value;
var url = document.getElementById('url' + id).value;
var fansuber = document.getElementById('fansuber' + id).value;
var hide = document.getElementById('hide' + id).value;
var token = document.getElementById('token').value;
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('sure' + id).style.display = 'none';
document.getElementById('hide' + id).style.display = 'none';
}
}
xhr.open("GET","acpajax.php?id=" + encodeURI(id) + "&name=" + encodeURI(name) + "&url=" + encodeURI(url) + "&fansuber=" + encodeURI(fansuber) + "&token=" + encodeURI(token) + "&delete",true);
xhr.send(null);
xhr.open("GET","acpajax.php?id=" + encodeURI(id) + "&name=" + encodeURI(name) + "&url=" + encodeURI(url) + "&fansuber=" + encodeURI(fansuber) + "&token=" + encodeURI(token) + "&delete",true);
xhr.send(null);
}
function notsure(id)
{
var xhr = getXhr();
var name = document.getElementById('name' + id).value;
var url = document.getElementById('url' + id).value;
var fansuber = document.getElementById('fansuber' + id).value;
var hide = document.getElementById('hide' + id).value;
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('update' + id).style.display = 'inline';
document.getElementById('sure' + id).style.display = 'none';
}
}
xhr.open("GET","acpajax.php",true);
xhr.send(null);
}
</script>
</head>
<body>
<div id="contentwrapper">
<div id="banner"><img src="<?php
$bannersListe = directoryToArray('design/banners'); //Récupère la liste des bannières
$rand = mt_rand( 0 , count($bannersListe)-1 ); //Choisir une bannière au hasard
echo $bannersListe[$rand];
unset($bannersListe, $rand);
?>" alt="banniere" /></div>
<div id="menu">
<ul>
<li><a href="index.php?crk=releases">[ &#1103;eleases ]</a></li>
<li><a href="acp.php?crk=modifabout">[ Edit About ]</a></li>
<li><a href="acp.php?crk=addrelease">[ Add a &#1103;elease ]</a></li>
<li><a href="acp.php?crk=modifrlz">[ Edit &#1103;eleases ]</a></li>
<li><a href="acp.php?crk=delrelease">[ Delete &#1103;eleases ]</a></li>
<li><a href="acp.php?crk=rss">[ Update RSS feed ]</a></li>
<li><a href="acp.php?crk=editconfig">[ Edit Configuration File ]</a></li>
<li><a href="acp.php?crk=uninstall">[ Uninstall CMS ]</a></li>
<li><a href="acp.php?crk=about">[ About ]</a></li>
<li><a href="acp.php?crk=logout">[ Logout ]</a></li>
</ul>
</div>
<div id="maincontent"><?php
if(!empty($_GET['crk']))
{
$file = CleanVar($_GET['crk']);
if( file_exists ( 'acp/' . $file . '.php' ) )
require_once( 'acp/' . $file . '.php' );
else
include_once( 'bugslogger.php' );
}
else
require_once('acp/accueil.php');
?></div>
<div id="footer">
<p><?php echo $config['team']; ?> &#1071;elease Portal v0.2.7</p>
<p>&copy; <?php echo date('Y'), ' ', $config['team']; ?></p>
</div>
</div>
</body>
</html>
<?php
}
else
{
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="design/default.css" media="screen,projection" />
<link rel="shortcut icon" href="design/favicon.ico" />
<title><?php echo $config['team']; ?> Release Portal</title>
</head>
<body>
<div id="maincontent" style="float:none; margin:auto">
<br /><br /><hr />
<form action="acp.php" method="post">
<center>Password</center>
<center><input type="password" name="pass" /></center>
<center><input type="submit" value="Enter"/></center>
</form>
<center><?php echo $wrong; ?></center>
<hr />
</div>
</body>
</html><?php
}
ob_end_flush();

56
acp/about.php Normal file
View File

@ -0,0 +1,56 @@
<h1>:: About ::</h1>
<p>This CMS is made for all Fansub, individuals, for all those who keep strugle the scene alive.<br />
And mainly for all guys who are site operators and are not good at PHP coding (cheers my friends!)<br />
I aimed for it because... nobody thought to make a release portal in CMS.<br />
If you dont like the code/design just edit it, i have tryed to make the PHP more simple than possible, with no vulnerability problem, clean and light code etc...<br />
I hope you will enjoy my release system :)</p>
<p>Final words: i've made a CMS, that a first one for me, and that represent also alot of work, finally, thanks you for your interest on this.</p>
<p>__<br />
Iqbal Rifai</p>
<form method="post" action="acp.php?crk=sendmail">
<hr />
<h1>:: Contact form ::</h1>
<?php
$ipi = getenv ("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi; ?>" />
<input type="hidden" name="httpref" value="<?php echo htmlentities($httprefi); ?>" />
<input type="hidden" name="httpagent" value="<?php echo htmlentities($httpagenti); ?>" />
<table width="389" border="0" cellspacing="0">
<tr>
<td width="103">Your Nick: </td>
<td width="282"><input name="visitor" type="text" size="40" maxlength="20" /></td>
</tr>
<tr>
<td>Your Email:</td>
<td><input name="visitormail" type="text" size="40" maxlength="30" /></td>
</tr>
<tr>
<td>Subject:</td>
<td><select name="attn" size="1">
<option value="I have found a bug in the CMS" selected>I have found a bug in the CMS</option>
<option value="I need help with the script">I need help with the script</option>
<option value="I just wanna says thank">I just wanna says thank</option>
<option value="I just want drink a beer with you">I just want drink a beer with you</option>
<option value="Other">Other</option>
</select></td>
</tr>
<tr>
<td>Mail Message: </td>
<td><textarea name="notes" rows="4" cols="40"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Send Mail" /></td>
</tr>
</table>
</form>
<hr />
<h1>:: Greetings ::</h1>
<p>Allah SWT <br />
Friends: Kaoru Mashiko, Zul Fikar, Widianto Nur Firmansyah And etc.<br />
</p>

15
acp/accueil.php Normal file
View File

@ -0,0 +1,15 @@
<?php if(!defined("ACPPAGE")) exit(); ?>
<h1>:: Administration Control Panel ::</h1>
<hr />
<ul>
<li><a href="acp.php?crk=addrelease">Add a Release</a></li>
<li><a href="acp.php?crk=modifrlz">Edit Releases</a></li>
<li><a href="acp.php?crk=delrelease">Delete Releases</a></li>
<li><a href="acp.php?crk=modifabout">Edit Fansub About</a></li>
--- Require database's password ---
<li><a href="acp.php?crk=uninstall">Uninstall CMS</a></li>
<li><a href="acp.php?crk=editconfig">Edit Configuration File</a></li>
</ul>
<p><b>CMS version:</b> 0.2.7</p>
<hr />

54
acp/addrelease.php Normal file
View File

@ -0,0 +1,54 @@
<?php
if(!defined("ACPPAGE")) exit();
if ( !isset($_POST['token']) )
{
$token = generate_token("add");
}
if(isset( $_POST['releasename'], $_POST['url'], $_POST['fansuber']) AND !empty($_POST['releasename']) AND !empty($_POST['url']) AND !empty($_POST['fansuber']) )
{
if ( check_token_post("add", 600) )
{
$query = 'INSERT INTO releases (name, url, fansuber, date) VALUES('
. '\'' . mysql_real_escape_string($_POST['releasename']) . '\', ' //releases.name
. '\'' . mysql_real_escape_string($_POST['url']) . '\', ' //releases.url
. '\'' . mysql_real_escape_string($_POST['fansuber']) . '\', ' //releases.fansuber
. time() . ')'; //releases.date
mysql_query($query);
$token = generate_token("add");
echo '<font color="green">Release added.</font>';
include('rss.php');
}
else
{
echo '<font color="red">Invalid Token !<br>Please try again.</font>';
}
}
?><h1>:: Add a new &#1103;elease ::</h1>
<hr />
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>?crk=addrelease" method="post">
<table cellpadding="4" cellspacing="0">
<tr>
<td><div align="right">Anime name:</div></td>
<td><input type="text" name="releasename" size="60" /></td>
</tr>
<tr>
<td><div align="right">Release link: </div></td>
<td><input type="text" name="url" size="60" /></td>
</tr>
<tr>
<td><div align="right">Fansuber : </div></td>
<td><input type="text" name="fansuber" /></td>
</tr>
<tr>
<td><div align="right"><input type="submit" value="Submit" /></div></td>
<td></td>
</tr>
</table>
<input type="hidden" name="token" value="<?php echo $token; ?>"/>
</form>

66
acp/delrelease.php Normal file
View File

@ -0,0 +1,66 @@
<?php
if(!defined("ACPPAGE")) exit();
$crackerName = (isset($_GET['cracker'])) ? mysql_real_escape_string($_GET['cracker']) : '';
$token = generate_token("delete");
?>
<h1><span class="Style1">:: Delete <?php echo $config['accro']; ?> &#1103;eleases ::<br /><br /></span><?php if($crackerName != '') echo ' from ' . htmlentities($crackerName); ?></h1>
<p>Total releases :
<?php
$donnees = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS nb_entry FROM releases"));
echo $donnees['nb_entry'];
$totalCracks = $donnees['nb_entry'];
if($crackerName != '')
{
$r = mysql_query("SELECT COUNT(*) AS nb_entry FROM releases WHERE cracker='" . $crackerName . "'");
$donnees = mysql_fetch_array($r);
echo '<br />Total releases of <b>' . htmlentities($crackerName) . '</b>: ' . $donnees['nb_entry'];
}
?></p>
<center><?php
$page = (isset($_GET['spg'])) ? (int)$_GET['spg'] : 1;
$page = $page < 0 ? 0 : $page;
if($page != 0) $premierMessageAafficher = ($page - 1) * $config['cracksparpage'];
$nombreDePages = ceil($totalCracks / $config['cracksparpage']);
echo '<span id="pagenums">Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
if($i != $page) echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?crk=delrelease&spg=' . $i . '">' . $i . '</a>';
else echo $i . ' ';
}
echo '</span>';
?></center>
<hr />
<form>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td><center>Release name</center></td><td><center>url</center></td><td>Date (m/d/Y)</td><td>Cracker</td>
<td>Delete</td>
</tr>
<?php
if($crackerName != '')
$r = mysql_query("SELECT * FROM releases WHERE cracker='" . $crackerName . "' ORDER BY date DESC");
elseif($page == 0)
$r = mysql_query("SELECT * FROM releases");
else
$r = mysql_query("SELECT * FROM releases ORDER BY date DESC LIMIT $premierMessageAafficher, {$config['cracksparpage']}");
while($donnees = mysql_fetch_array($r) )
{
echo '<input type="hidden" id="token" value="'.$token.'"/>';
echo '<tr id="hide'.$donnees['id'].'">';
echo '<td><input id="name' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['name']) , '" onkeypress="change(' , $donnees['id'] , ');" disabled/></span></td>';
echo '<td><input id="url' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['url']) , '" onkeypress="change(' , $donnees['id'] , ');" disabled/></td></span>';
echo '<td>' , date('m/d/Y', $donnees['date']) , '</td></span>';
echo '<td><input id="cracker' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['cracker']) , '" onkeypress="change(' , $donnees['id'] , ');" disabled/></td></span>';
echo '<td><span id="sure' , $donnees['id'] , '" style="display:none">Sure ?<br><input type="button" value="YES" id="button' , $donnees['id'] , '" onclick="delrowsure(' , $donnees['id'] , '); return false;" /> <input type="button" value="NO" id="button' , $donnees['id'] , '" onclick="notsure(' , $donnees['id'] , '); return false;" /> </span><span id="update' , $donnees['id'] , '"><input type="button" value="delete" id="button' , $donnees['id'] , '" onclick="delrow(' , $donnees['id'] , '); return false;" /></span></td>';
echo '</tr>';
}
?>
</table>
</form>
<hr />

62
acp/editconfig.php Normal file
View File

@ -0,0 +1,62 @@
<?php if(!defined("ACPPAGE")) exit(); ?>
<h1>:: Edit Configuration File ::</h1>
To verify that you are the administrator of the database, you must type your database's password below.<br><br>
<form method="POST">
<input name="DBpasswd" type="password"/> - <input type="submit" value="Check">
</form>
<?php
if ( isset($_POST['DBpasswd']) )
{
if ( $_POST['DBpasswd'] == $dbpass )
{
$filename = 'config.php';
if(isset($_POST['config']))
{
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'w')) {
echo "<font color=\"red\">Unable to open the file (".$filename.").</font>";
exit;
}
if (fwrite($handle, stripslashes($_POST['config'])) === FALSE) {
echo "<font color=\"red\">Unable to write in the file (".$filename.").</font>";
exit;
}
fclose($handle);
echo 'Changes were done.';
} else {
echo "<font color=\"red\">The file ".$filename." is not accessible in writing.</font>";
}
}
else
{
?>
<form method="post" action="acp.php?crk=editconfig">
<input type="hidden" name="DBpasswd" value="<?php echo $dbpass; ?>"/>
<textarea name="config" style="width:100%; height: 230px;">
<?php
echo htmlentities(file_get_contents($filename), ENT_QUOTES);
?>
</textarea><hr />
<input type="submit" value="Edit" />
</form>
<?php
}
}
else
{
echo '<font color="red">Wrong Password !</font>';
}
}
?>

10
acp/logout.php Normal file
View File

@ -0,0 +1,10 @@
<?php
session_destroy();
?>
Logout success, you will be redirected on 1 sec
<script type="text/javascript">
<!--
var obj = 'window.location.replace("index.php");';
setTimeout(obj,1000);
// -->
</script>

42
acp/modifabout.php Normal file
View File

@ -0,0 +1,42 @@
<?php if(!defined("ACPPAGE")) exit(); ?>
<h1>:: About Modification ::</h1>
<?php
$filename = 'libs/about.txt';
if(isset($_POST['about']))
{
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'w')) {
echo "<font color=\"red\">Unable to open the file (".$filename.").</font>";
exit;
}
if (fwrite($handle, stripslashes($_POST['about'])) === FALSE) {
echo "<font color=\"red\">Unable to write in the file (".$filename.").</font>";
exit;
}
fclose($handle);
echo 'Changes were done.';
} else {
echo "<font color=\"red\">The file ".$filename." is not accessible in writing.</font>";
}
}
else
{
?>
<form method="post" action="acp.php?crk=modifabout">
<p>HTML allowed</p>
<textarea name="about" style="width:100%; height: 230px;"><?php
echo htmlentities(file_get_contents($filename), ENT_QUOTES);
?>
</textarea><hr />
<input type="submit" value="Modify" />
</form>
<?php
}
?>

66
acp/modifrlz.php Normal file
View File

@ -0,0 +1,66 @@
<?php
if(!defined("ACPPAGE")) exit();
$fansuberName = (isset($_GET['fansuber'])) ? mysql_real_escape_string($_GET['fansuber']) : '';
$token = generate_token("edit");
?>
<h1><span class="Style1">:: Edit <?php echo $config['accro']; ?> &#1103;eleases ::<br /><br /></span><?php if($fansuberName != '') echo ' from ' . htmlentities($fansuberName); ?></h1>
<p>Total releases :
<?php
$donnees = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS nb_entry FROM releases"));
echo $donnees['nb_entry'];
$totalCracks = $donnees['nb_entry'];
if($fansuberName != '')
{
$r = mysql_query("SELECT COUNT(*) AS nb_entry FROM releases WHERE fansuber='" . $fansuberName . "'");
$donnees = mysql_fetch_array($r);
echo '<br />Total releases of <b>' . htmlentities($fansuberName) . '</b>: ' . $donnees['nb_entry'];
}
?></p>
<center><?php
$page = (isset($_GET['spg'])) ? (int)$_GET['spg'] : 1;
$page = $page < 0 ? 0 : $page;
if($page != 0) $premierMessageAafficher = ($page - 1) * $config['cracksparpage'];
$nombreDePages = ceil($totalCracks / $config['cracksparpage']);
echo '<span id="pagenums">Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
if($i != $page) echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?crk=modifrlz&spg=' . $i . '">' . $i . '</a>';
else echo $i . ' ';
}
echo '</span>';
?></center>
<hr />
<form>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td><center>Release name</center></td><td><center>url</center></td><td>Date (m/d/Y)</td><td>Cracker</td>
<td>Save</td>
</tr>
<?php
if($fansuberName != '')
$r = mysql_query("SELECT * FROM releases WHERE fansuber='" . $fansuberName . "' ORDER BY date DESC");
elseif($page == 0)
$r = mysql_query("SELECT * FROM releases");
else
$r = mysql_query("SELECT * FROM releases ORDER BY date DESC LIMIT $premierMessageAafficher, {$config['cracksparpage']}");
while($donnees = mysql_fetch_array($r) )
{
echo '<input type="hidden" id="token" value="'.$token.'"/>';
echo "\n<tr>";
echo '<td><input id="name' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['name']) , '" onkeypress="change(' , $donnees['id'] , ');" /></td>';
echo '<td><input id="url' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['url']) , '" onkeypress="change(' , $donnees['id'] , ');" /></td>';
echo '<td>' , date('m/d/Y', $donnees['date']) , '</td>';
echo '<td><input id="fansuber' , $donnees['id'] , '" class="acpinput" type="text" value="' , htmlentities($donnees['fansuber']) , '" onkeypress="change(' , $donnees['id'] , ');" /></td>';
echo '<td><span id="update' , $donnees['id'] , '" style="display:none"><input type="button" value="save" id="button' , $donnees['id'] , '" onclick="saverow(' , $donnees['id'] , '); return false;" /></span></td>';
echo '</tr> <!-- ' , $donnees['id'] , ' -->';
}
?>
</table>
</form>
<hr />

43
acp/rss.php Normal file
View File

@ -0,0 +1,43 @@
<?php
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
$xml .= "<?xml-stylesheet type=\"text/xsl\" href=\"rss_style.xsl\"?>\n";
$xml .= "<rss version=\"2.0\">\n";
$xml .= "<channel>\n";
$xml .= "<title>" . $config['accro'] . " Releases</title>\n";
$xml .= "<link>" . $config['path'] . "</link>\n";
$xml .= "<description>Latest " . $config['accro'] . " Releases</description>\n";
$xml .= "<copyright> " . $config['team'] . " 2009</copyright>\n";
$xml .= "<language>en</language>\n";
$xml .= "<image>\n";
$xml .= "<title> " . $config['accro'] . " Releases</title>\n";
$xml .= "<url>" . $config['path'] . "design/rss.png</url>\n";
$xml .= "<link>" . $config['path'] . "</link>\n";
$xml .= "</image>\n";
$today = date("D, d M Y H:i:s +0100");
//date du jour d'execution du fichier PHP
$xml .= "<pubDate>" . $today . "</pubDate>\n";
// Faîtes appel à vos fichier de connection à votre base de donnée MySQL
// Adaptez ces lignes à votre base de données / noms de table
$resultat_requete = mysql_query("SELECT * FROM releases ORDER BY date DESC limit 0, 10");
// extraction des 10 dernières releases
while ($lig = @mysql_fetch_assoc($resultat_requete))
{
$titre = $lig["name"];
$adresse = $lig["url"];
$date = $lig["date"];
$datephp = date("D, d M Y H:i:s +0100", $date);
$xml .= "<item>\n";
$xml .= "<title>" . $titre . "</title>\n";
$xml .= "<link>" . $config['path'] . "</link>\n";
$xml .= "<pubDate>" . $datephp . "</pubDate>\n";
$xml .= "<description>Visit our distro to download</description>\n";
$xml .= "</item>\n";
} //fin du while
$xml .= "</channel>\n";
$xml .= "</rss>\n";
$fp = fopen("rss.xml", 'w+');
fputs($fp, $xml);
fclose($fp);
echo '<br><br><p><font color="green">RSS Updated !</font></p><p><a href="rss.xml">Saw the file</a></p>';
?>

68
acp/sendmail.php Normal file
View File

@ -0,0 +1,68 @@
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
$t4pz = '<p><a href="acp.php?crk=about">Go back!</a></p>';
if (eregi('http:', $notes)) die ($t4pz);
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
echo "<h2>Feedback was NOT submitted</h2>\n";
die ($t4pz);
}
if(empty($visitor) || empty($visitormail) || empty($notes ))
{
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("<p><a href='acp.php?crk=about'>Go back!</a></p>");
}
$todayis = date("l, F j, Y, g:i a");
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Subject: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("phoenixbytes@live.fr", $subject, $message, $from);
//TODO fixer les XSS
?>
<html>
<body>
<div align="center">
Date: <?php echo $todayis; ?>
<br />
Thank You : <?php echo htmlentities($visitor); ?> ( <?php echo htmlentities($visitormail); ?> )
<br />
Subject: <?php echo htmlentities($attn); ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo htmlentities($notesout); ?>
<br />
<?php echo htmlentities($ip); ?>
<br /><br />
<p><a href="acp.php?crk=about">Go back!</a></p>
</div>
</body>
</html>

42
acp/uninstall.php Normal file
View File

@ -0,0 +1,42 @@
<?php if(!defined("ACPPAGE")) exit(); ?>
<h1>:: Uninstall XRS ::</h1>
<h4><font color="red">Do you really want to Uninstall XRS ?</font></h4>
To verify that you are the administrator of the database, you must type your database's password below.<br>
<form method="POST">
<input name="DBpasswd" type="password"/> - <input type="submit" value="Uninstall">
</form>
<?php
if ( isset($_POST['DBpasswd']) )
{
if ( $_POST['DBpasswd'] == $dbpass )
{
$sql = "DROP TABLE `releases`";
$about = '<h1>:: About Our team ::</h1>';
$about .= '<p>Our team are made up of a group of friends and reversers from around the world. We are here to have fun and make some quality releases.</p>';
$about .= '<p>You cant contact us and we probably wont contact you. Have fun and keep on learning.</p>';
$about .= '<p>"Life isnt about waiting for the storms to pass, its about learning to dance in the rain."</p>';
mysql_query($sql);
require("rss.php");
unlink("config.php");
chdir("libs");
unlink("about.txt");
$handle = fopen("about.txt", "a");
fputs($handle, $about);
fclose($handle);
echo '<font color="green">XRS has been Uninstalled...</font>';
}
else
{
echo '<font color="red">Wrong Password !</font>';
}
}
?>

15
acpajax.php Normal file
View File

@ -0,0 +1,15 @@
<?php
session_start();
@require_once 'config.php';
@require_once 'libs/lib.php';
if(!defined("CONFIG")) exit();
if(isset($_SESSION['pass'], $_GET['name'], $_GET['url'], $_GET['fansuber'], $_GET['id'], $_GET['token']) && ($_SESSION['pass'] == $config['pass']) )
{
require("acp/rss.php");
if ( isset($_GET['delete']) AND check_token_get("delete", 600) )
mysql_query("DELETE FROM releases WHERE id='".$_GET['id']."'");
else if (check_token_get("edit", 600))
mysql_query('UPDATE releases SET name=\'' . mysql_real_escape_string($_GET['name']) . '\', url=\'' . mysql_real_escape_string($_GET['url']) . '\', fansuber=\'' . mysql_real_escape_string($_GET['fansuber']) . '\' WHERE id=' . (int)$_GET['id']) ;
}

58
bugslogger.php Normal file
View File

@ -0,0 +1,58 @@
<p>You got a problem, we will redirect you on our main page<br />
We have logged your IP and your current url when you got this message for help us to identify the problem</p>
<?php
$referer = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'Unspecified';
if (strstr("Win", getenv("HTTP_USER_AGENT")))
$os = "Windows";
elseif ((strstr(getenv("HTTP_USER_AGENT"), "Mac")) || (strstr(getenv("HTTP_USER_AGENT"), "PPC")))
$os = "Mac";
elseif (strstr(getenv("HTTP_USER_AGENT"), "Linux"))
$os = "Linux";
elseif (strstr(getenv("HTTP_USER_AGENT"), "FreeBSD"))
$os = "FreeBSD";
elseif (strstr(getenv("HTTP_USER_AGENT"), "SunOS"))
$os = "SunOS";
elseif (strstr(getenv("HTTP_USER_AGENT"), "IRIX"))
$os = "IRIX";
elseif (strstr(getenv("HTTP_USER_AGENT"), "BeOS"))
$os = "BeOS";
elseif (strstr(getenv("HTTP_USER_AGENT"), "OS/2"))
$os = "OS/2";
elseif (strstr(getenv("HTTP_USER_AGENT"), "AIX"))
$os = "AIX";
elseif (strstr(getenv("HTTP_USER_AGENT"), "Android"))
$os = "Android";
else
$os = "Unknown";
$fp = fopen('logs.txt', 'a');
fwrite($fp, '+-[' . date('l jS \of F Y h:i:s A') . ']');
fwrite($fp, "\r\n");
fwrite($fp, '|');
fwrite($fp, "\r\n");
fwrite($fp, '|IP.................: ' . htmlentities($_SERVER["REMOTE_ADDR"]));
fwrite($fp, "\r\n");
fwrite($fp, '|User-Agent.........: ' . htmlentities($_SERVER["HTTP_USER_AGENT"]));
fwrite($fp, "\r\n");
fwrite($fp, '|OS.................: ' . $os);
fwrite($fp, "\r\n");
fwrite($fp, '|URi.Bugged.........: ' . htmlentities($_SERVER["REQUEST_URI"]));
fwrite($fp, "\r\n");
fwrite($fp, '|Variable.Bugged....: ' . htmlentities($_SERVER["QUERY_STRING"]));
fwrite($fp, "\r\n");
fwrite($fp, '|Accept-Language....: ' . htmlentities($_SERVER["HTTP_ACCEPT_LANGUAGE"]));
fwrite($fp, "\r\n");
fwrite($fp, '|Port...............: ' . htmlentities($_SERVER["REMOTE_PORT"]));
fwrite($fp, "\r\n");
fwrite($fp, '|Referer............: ' . htmlspecialchars("$referer"));
fwrite($fp, "\r\n");
fwrite($fp, "+----------------------------------------------------------------------------------");
fwrite($fp, "\r\n");
fclose($fp);
?>
<script type="text/javascript">
<!--
var obj = 'window.location.replace("index.php");';
setTimeout(obj,5000);
// -->
</script>

BIN
design/Thumbs.db Normal file

Binary file not shown.

BIN
design/banners/Thumbs.db Normal file

Binary file not shown.

BIN
design/banners/banner1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
design/banners/banner2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
design/banners/banner3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
design/banners/banner4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
design/banners/banner5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
design/banners/banner6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

196
design/default.css Normal file
View File

@ -0,0 +1,196 @@
@charset "ISO-8859-1";
body {
background-color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
color:#FFFFFF;
}
img {
border: none;
display: block;
margin-left: auto;
margin-right: auto;
}
#contentwrapper {
margin-left: auto;
margin-right: auto;
width:775px;
background-color: #000000;
border:1px solid #F1EFE2;
}
/* DEFINE BANNER STYLE*/
#banner {
margin-top: 10px;
margin-bottom: 20px;
}
/* DEFINE MENU STYLES */
#menu {
float:left;
width:150px;
margin-left: 0px;
padding-left: 0px;
text-align: left;
font-weight: bold;
font-size: 12px;
color: #EDEDED;
}
#menu ul {
width:140px;
margin-top: 40px;
margin-left: 10px;
padding-left: 0px;
list-style:none;
}
#menu ul li {
display:block;
margin-left: 0px;
padding-left: 0px;
}
#menu ul li a {
float:left;
width:140px;
background-color:#000000;
border:1px solid #F1EFE2;
margin:0px 0px 5px 0px;
padding:10px 1px 10px 5px;
text-decoration:none;
color:#909090;
text-align:center;
}
#menu ul li a:hover {
background-color:#252525;
color:#FFFFFF;
}
/* DEFINE MAIN CONTENT STYLES */
#maincontent {
float:right;
width: 565px;
margin-left: 25px;
margin-right: 25px;
padding-left: 0px;
padding-bottom: 25px;
}
#maincontent h1 {
text-align: center;
font-weight: bold;
font-size: 16px;
color: #909090;
}
#maincontent table {
width: 540px;
margin: 5px 0 20px 25px;
text-align: left;
font-size: 11px;
color: #909090;
}
#maincontent p {
text-align: left;
font-size: 11px;
color: #909090;
}
#maincontent form input, #maincontent form select{
background: #252525;
border:1px solid #FFFFFF;
font-size: 11px;
color: #FFFFFF;
}
.textinput {
width: 350px;
text-align: left;
}
.submitbutton {
width: 100px;
text-align: center;
}
.releasedate {
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
}
/* DEFINE FOOTER STYLES */
#footer {
clear: both;
margin-top: 20px;
margin-bottom: 10px;
}
#footer p {
margin: 0px;
text-align:center;
font-size: 10px;
color: #909090;
}
#pagenums {
color:green;
}
#pagenums a {
text-decoration:none;
color:#909090;
}
#pagenums a:hover {
color:#FFFFFF;
}
tr:hover
{
background-color: #555555;
}
tr a{
color:#909090;
text-decoration:none;
}
tr a:hover{
color:#FFFFFF;
text-decoration:underline;
}
#footerlinks
{
text-align:center;
}
#footerlinks a{
color:#909090;
text-decoration:none;
}
#footerlinks a:hover{
color:#FFFFFF;
text-decoration:underline;
}
#maincontent form .acpinput{
background: #252525;
border:none;
font-size: 11px;
color: #FFFFFF;
}
a
{
color:#909090;
text-decoration: none;
}
a:hover
{
color:white;
text-decoration: underline;
}

BIN
design/rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

66
index.php Normal file
View File

@ -0,0 +1,66 @@
<?php
require_once('libs/lib.php'); //global used fonctions
@include('config.php'); //configuration file generated by install.php
if(!defined('CONFIG')) exit(setup());
clean_token(); //Destroy tokens for more security
clean_add_token();
ob_start();
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="design/default.css" media="screen,projection" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $config['team']; ?> Releases RSS Feed" href="rss.xml" />
<link rel="shortcut icon" href="design/favicon.ico" />
<title><?php echo $config['team']; ?> Release Portal</title>
</head>
<body>
<div id="contentwrapper">
<div id="banner">
<?php
$bannersListe = directoryToArray('design/banners'); //Récupère la liste des bannières
$rand = mt_rand( 0 , count($bannersListe)-1 ); //Choisir une bannière au hasard
echo '<img src="', $bannersListe[$rand], '" alt="banniere" />';
unset($bannersListe, $rand);
?></div>
<div id="menu">
<ul>
<li><a href="index.php?crk=releases&spg=1">[ Latest Releases ]</a></li>
<li><a href="index.php?crk=search">[ Search Releases ]</a></li>
<li><a href="index.php?crk=about">[ About <?php echo $config['accro'] ?> ]</a></li>
<li><a href="rss.xml">[ RSS ]</a></li>
<li><a href="acp.php">[ Admin ]</a></li>
</ul>
</div>
<div id="maincontent"><?php
if(!empty($_GET['crk']))
{
$file = CleanVar($_GET['crk']);
if( file_exists ( 'portail/' . $file . '.php' ) )
require_once( 'portail/' . $file . '.php' );
else
include_once( 'bugslogger.php' );
}
else
require_once('portail/releases.php');
?></div>
<div id="footer">
<p><?php echo $config['team']; ?> &#1071;elease Portal v0.2.7</p>
<p>&copy; <?php echo date('Y'), ' ', $config['team']; ?></p>
</div>
</div>
</body>
</html>
<?php
ob_end_flush();

BIN
install/Thumbs.db Normal file

Binary file not shown.

143
install/install.php Normal file
View File

@ -0,0 +1,143 @@
<?php
@include("../config.php");
if(defined("CONFIG")) exit("<h2><font color=\"red\">Restricted Acces !</font></h2><p>If you are the administrator and if you want to Reinstall XRS, please go to the <a href=\"../acp.php\">Control Panel</a> and click on 'Unsinstall XRS'</p>");
if(isset($_POST['team'], $_POST['accro'], $_POST['pass'], $_POST['path'], $_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']))
{
sleep(3);
@mysql_connect($_POST['dbhost'],$_POST['dbuser'],$_POST['dbpass']);
$select_base=@mysql_selectdb($_POST['dbname']);
if (!$select_base)
echo '<font color="red">ERROR - Database\'s Informations</font>';
else
{
$query = file_get_contents('install.sql');
mysql_query($query) or exit(mysql_error());
$FileContent = "<?php\r\n\r\n";
$FileContent .= "define(\"CONFIG\", true);\r\n\r\n";
$FileContent .= "\$config['team'] = '" . htmlentities( $_POST['team'] , ENT_QUOTES) . "';\r\n";
$FileContent .= "\$config['pass'] = '" . htmlentities( $_POST['pass'] , ENT_QUOTES) . "';\r\n";
$FileContent .= "\$config['accro'] = '" . htmlentities( $_POST['accro'] , ENT_QUOTES) . "';\r\n\r\n";
$FileContent .= "\$config['path'] = '" . htmlentities( $_POST['path'] , ENT_QUOTES) . "';\r\n\r\n";
$FileContent .= "\$config['cracksparpage'] = 20;\r\n\r\n";
$FileContent .= "\$dbhost = '".$_POST['dbhost']."';\r\n";
$FileContent .= "\$dbuser = '".$_POST['dbuser']."';\r\n";
$FileContent .= "\$dbpass = '".$_POST['dbpass']."';\r\n";
$FileContent .= "\$dbname = '".$_POST['dbname']."';\r\n\r\n";
$FileContent .= "mysql_connect('" . htmlentities( $_POST['dbhost'] , ENT_QUOTES) . "', '" . htmlentities( $_POST['dbuser'] , ENT_QUOTES) . "', '" . htmlentities( $_POST['dbpass'] , ENT_QUOTES) . "');\r\n";
$FileContent .= "mysql_select_db('" . htmlentities( $_POST['dbname'] , ENT_QUOTES) . "');";
$FileContent .= "\r\n\r\n?>";
$filename = "../config.php";
if (is_writable($filename))
unlink($filename);
if (!$handle = fopen($filename, 'a')) {
echo "<font color=\"red\">Unable to open the file (".$filename.").</font>";
exit;
}
if (fwrite($handle, stripslashes($FileContent)) === FALSE) {
echo "<font color=\"red\">Unable to write in the file (".$filename.").</font>";
exit;
}
fclose($handle);
echo '<font color="green">The installation was completed successfully !<br><a href="../index.php">Click here</a> for continue.</font>';
}
}
?>
<html>
<head>
<title>Setup</title>
<script>
window.onload = function() {
var str = window.location.href;
str = str.replace("install/install.php","");
document.getElementById('path').value = str;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #000000;
}
body,td,th {
color: #FFFFFF;
}
-->
</style></head>
<body>
<?php $nbimages=7;
$nomimages[1]="xrs1.jpg";
$nomimages[2]="xrs2.jpg";
$nomimages[3]="xrs3.jpg";
$nomimages[4]="xrs4.jpg";
$nomimages[5]="xrs5.jpg";
$nomimages[6]="xrs6.jpg";
$nomimages[7]="xrs7.jpg";
srand((double)microtime()*1000000);
$affimage=rand(1,$nbimages);
?>
<center><form action="install.php" method="post"><table width="697" border="0">
<tr>
<td><center><img src="<?php echo $nomimages[$affimage]; ?>" border=0></center>
<fieldset>
<legend>Fansub Info</legend>
<table width="450">
<tr>
<td width="130">Fansub name : </td>
<td width="308"><input name="team" type="text" id="team" size="50" /></td>
</tr>
<tr>
<td>Fansub acronym : </td>
<td><input name="accro" type="text" id="accro" size="50" /></td>
</tr>
<tr>
<td>Fansub pass : </td>
<td><input name="pass" type="password" id="pass" size="50" /></td>
</tr>
<tr>
<td>Portal path : </td>
<td><input name="path" type="text" id="path" size="50" /></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>DataBase</legend>
<table width="450">
<tr>
<td width="128">Host </td>
<td width="310"><input name="dbhost" type="text" id="dbhost" value="localhost" size="50" /></td>
</tr>
<tr>
<td>User : </td>
<td><input name="dbuser" type="text" id="dbuser" size="50" /></td>
</tr>
<tr>
<td>Password : </td>
<td><input name="dbpass" type="password" id="dbpass" value="" size="50" /></td>
</tr>
<tr>
<td>Database's Name : </td>
<td><input name="dbname" type="text" id="dbname" size="50" /></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td><center><input value="Create your release system" type="submit" /></center></td>
</tr>
</table></form>
</center>
</body>
</html>

7
install/install.sql Normal file
View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS releases (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name TEXT NOT NULL ,
url TEXT NOT NULL ,
fansuber TEXT NOT NULL ,
date INT NOT NULL
) ENGINE = MYISAM ;

1
install/rss.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="rss_style.xsl"?><rss version="2.0"><channel><title> Releases</title><link></link><description>Latest Releases</description><copyright> 2009</copyright><language>fr</language><image> <title> Releases</title> <url>design/rss.png</url> <link></link></image><pubDate>Tue, 12 June 2018 15:56:42</pubDate></channel></rss>

10
libs/about.txt Normal file
View File

@ -0,0 +1,10 @@
This CMS is made for all Fansub, individuals, for all those who keep strugle the scene alive.
And mainly for all guys who are site operators and are not good at PHP coding (cheers my friends!)
I aimed for it because... nobody thought to make a release portal in CMS.
If you dont like the code/design just edit it, i have tryed to make the PHP more simple than possible, with no vulnerability problem, clean and light code etc...
I hope you will enjoy my release system :)
Final words: i've made a CMS, that a first one for me, and that represent also alot of work, finally, thanks you for your interest on this.
__
Iqbal Rifai

122
libs/lib.php Normal file
View File

@ -0,0 +1,122 @@
<?php
/**
* Permet d'avoir une chaine sécurisé pour les inclusions.
* @param $var la chaine à sécuriser
* @return string
*/
//TODO conventionner le nom de la fonction
function CleanVar($var)
{
$var = trim($var);
$RemoveChars = array( "([\40])" , "([^a-zA-Z0-9-])", "(-{2,})" );
$ReplaceWith = array("-", "", "-");
return preg_replace($RemoveChars, $ReplaceWith, $var);
}
/**
* Récupère la liste des fichiers / répertoires dans un array.
* @param $directory le répertoire à analyser
* @param $recursive boolean, si on doit parcourrir récursivement
* @return array
*/
function directoryToArray($directory, $recursive = false)
{
$array_items = array();
if ($handle = opendir($directory))
{
while (false !== ($file = readdir($handle)))
{
if ($file != '.' && $file != '..')
{
if (is_dir($directory. '/' . $file))
{
if($recursive)
{
$array_items = array_merge($array_items, directoryToArray($directory. '/' . $file, $recursive));
}
$file = $directory . '/' . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
else
{
$file = $directory . "/" . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
}
closedir($handle);
}
return $array_items;
}
function setup()
{
exit('<BODY BGCOLOR="#000000"><font color="Green"><center><h1>Please go on the <a href="./install/install.php">Setup Page</a></h1></center></font></body>');
}
function generate_token($name)
{
$token = md5(uniqid(rand(), true));
$_SESSION[$name.'_token'] = $token;
$_SESSION[$name.'_token_time'] = time();
return $token;
}
function check_token_post($name, $time)
{
if(isset($_SESSION[$name.'_token']) && isset($_SESSION[$name.'_token_time']) && isset($_POST['token']))
{
if($_SESSION[$name.'_token'] == $_POST['token'])
{
$old_timestamp = time() - $time;
if($_SESSION[$name.'_token_time'] >= $old_timestamp)
$return = true;
else
$return = false;
}
else
{
$return = false;
}
}
else
$return = false;
return $return;
}
function check_token_get($name, $time)
{
if(isset($_SESSION[$name.'_token']) && isset($_SESSION[$name.'_token_time']) && isset($_GET['token']))
{
if($_SESSION[$name.'_token'] == $_GET['token'])
{
$old_timestamp = time() - $time;
if($_SESSION[$name.'_token_time'] >= $old_timestamp)
$return = true;
else
$return = false;
}
else
$return = false;
}
else
$return = false;
return $return;
}
function clean_token()
{
$_SESSION['delete_token'] = "";
$_SESSION['edit_token'] = "";
}
function clean_add_token()
{
$_SESSION['add_token'] = "";
}

4
portail/about.php Normal file
View File

@ -0,0 +1,4 @@
<?php
if(!defined('CONFIG')) exit(setup());
readfile('libs/about.txt');
?>

68
portail/releases.php Normal file
View File

@ -0,0 +1,68 @@
<?php
if(!defined('CONFIG')) exit(setup());
$fansuberName = (!empty($_GET['fansuber'])) ? mysql_real_escape_string($_GET['fansuber']) : '';
?><h1>Latest <?php echo $config['accro']; ?> Releases<br /><br />
<?php if($fansuberName != '') echo ' from ' , htmlentities($fansuberName); ?>
</h1>
<?php
echo '<p>Total releases :';
$donnees = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS nb_entry FROM releases"));
echo $donnees['nb_entry'];
$totalCracks = $donnees['nb_entry'];
if($fansuberName != '')
{
$r = mysql_query("SELECT COUNT(*) AS nb_entry FROM releases WHERE fansuber='" . $fansuberName . "'");
$donnees = mysql_fetch_array($r);
echo '<br />Total releases of <b>' , htmlentities($fansuberName) , '</b>: ' , $donnees['nb_entry'];
}
echo '</p>';
$page = (isset($_GET['spg'])) ? (int)$_GET['spg'] : 1;
$page = $page < 0 ? 0 : $page;
//si on ne précise pas la page on va à la première page
if($page != 0) $premierMessageAafficher = ($page - 1) * $config['cracksparpage'];
$nombreDePages = ceil($totalCracks / $config['cracksparpage']);
echo '<span id="pagenums">Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
if($i != $page) echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?crk=releases&spg=' . $i . '">' . $i . '</a>';
else echo $i . ' ';
}
echo '</span>';
?>
<hr />
<table border="0" cellpadding="3" cellspacing="0">
<tr><td><center>Release name</center></td><td>Date (m/d/Y)</td><td>Fansuber</td></tr>
<?php
if($fansuberName != '')
$r = mysql_query("SELECT * FROM releases WHERE fansuber='" . $fansuberName . "' ORDER BY date DESC");
elseif($page == 0)
$r = mysql_query("SELECT * FROM releases");
else
$r = mysql_query("SELECT * FROM releases ORDER BY date DESC LIMIT $premierMessageAafficher, {$config['cracksparpage']}");
while($donnees = mysql_fetch_array($r) )
{
echo '<tr>';
echo '<td><a href="' . htmlentities($donnees['url']) , '">' , htmlentities($donnees['name']) , '</a></td>';
echo '<td>' , date('m/d/Y', $donnees['date']) , '</td>';
echo '<td><b><a href="index.php?crk=releases&fansuber=' , htmlentities($donnees['fansuber']) , '">' , htmlentities($donnees['fansuber']) , '</a></b></td>';
echo '</tr>';
}
?></table>
<hr />
<div id="footerlinks">
<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?crk=releases&spg=0"><font face="fixedsys" size="1">[All releases]</font></a>
</div>

68
portail/search.php Normal file
View File

@ -0,0 +1,68 @@
<?php if(!defined('CONFIG')) exit(setup()); ?>
<h1>:: Search <?php echo $config['accro']; ?> Releases ::</h1>
<p>Our database contains a list of all our official releases. Use the
form below to search it.</p>
<?php
$searchtype = "byname";
if ( isset($_POST['searchtype']) AND $_POST['searchtype'] == "byfansuber" )
$searchtype = "byfansuber";
$ent = array ( "'" => ' ' );
if (isset ( $_POST ['q'] ) && $_POST ['q'] != NULL)
{
$q = htmlentities( $_POST ['q'] );
$nobreak = htmlentities(strtr ( $q, $ent ));
$sql = "SELECT * FROM releases WHERE name LIKE '%$nobreak%' ORDER BY date DESC";
if ( $searchtype == "byfansuber" )
$sql = "SELECT * FROM releases WHERE fansuber LIKE '%$nobreak%' ORDER BY date DESC";
$query = mysql_query ($sql);
$nb_resultats = mysql_num_rows ( $query );
if ($nb_resultats != 0)
{
echo '<p>Your search: "<font color="green"><b>', $q, '</b></font>" matched ';
echo $nb_resultats , ($nb_resultats > 1) ? ' releases in our database!' : ' result';
echo '<br /><br />';
while ( $donnees = mysql_fetch_array ( $query ) )
{
echo '<a href="' . htmlentities ( $donnees ['url'] ) . '">' . htmlentities ( $donnees ['name'] ) . '</a> - ( Cracker : <font color="red">'.htmlentities( $donnees ['fansuber'] ).'</font> )<br/>';
}
echo '<br /><br />';
echo '<a href="index.php?crk=search">Make a new search</a></p>';
}
else
{
?>
<p>Your search: "<font color="red"><b><?php echo $q; ?></b></font>"
matched 0 releases in our database!<br>
<a href="index.php?crk=search">Click here if you want retry</a></p>
<?php
}
}
else
{
?>
<form action="index.php?crk=search" method="post">
<input id="textinput" class="textinput" name="q" value="XRS Search Engine" type="text" onclick="if(this.value=='XRS Search Engine')this.value = '';" onblur="if(this.value=='')this.value = 'XRS Search Engine'">
<input class="submitbutton" name="submit" value="Perform Search" type="submit">
<br><input type="radio" name="searchtype" value="byname" checked="checked"> Search by Release's Name
<br><input type="radio" name="searchtype" value="byfansuber"> Search by Fansuber's Name
</form>
<?php
}

23
rss.xml Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="rss_style.xsl"?>
<rss version="2.0">
<channel>
<title>Daijoubu Releases</title>
<link>https://0wo.me/daijoubu/</link>
<description>Latest Daijoubu Releases</description>
<copyright> Daijoubu CMS V2 2009</copyright>
<language>en</language>
<image>
<title> Daijoubu Releases</title>
<url>https://0wo.me/daijoubu/design/rss.png</url>
<link>https://0wo.me/daijoubu/</link>
</image>
<pubDate>Tue, 12 Jun 2018 16:33:37 +0100</pubDate>
<item>
<title>Akkun to Kanojo Episode 1 4 (Subtitle Indonesia)</title>
<link>https://0wo.me/daijoubu/</link>
<pubDate>Tue, 12 Jun 2018 16:33:37 +0100</pubDate>
<description>Visit our distro to download</description>
</item>
</channel>
</rss>

68
rss_style.xsl Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output method="html" version="4" encoding="iso-8859-1" indent="yes" />
<xsl:template match="channel">
<html>
<head>
<title><xsl:value-of select="title" /> - <xsl:value-of select="description" /></title>
<style type="text/css">
body {
font-family:"Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;
font-size:10pt;
}
td {
font-family:"Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;
font-size:10pt;
border: solid 1px rgb(200,200,200);
padding-left: 10px;
padding-right: 10px;
padding-top: 6px;
padding-bottom: 6px;
}
</style>
<meta http-equiv="refresh" content="3600" />
</head>
<body>
<div align="center">
<br />
<table width="80%">
<tr>
<td align="center" style="border: none !important;">
<a href="{link}"><big><big><b><xsl:value-of select="title" /></b></big></big></a><br />
<a href="{image/link}" target="_blank"><img src="{image/url}" alt="{image/title}" title="{description}" border="0" width="{image/width}" height="{image/height}" /></a>
</td>
<td style="border: none !important">
<b><big><xsl:value-of select="description" /></big></b><br/>
<br />
<a href="http://validator.w3.org/feed/check.cgi?url=http://www.pixtiz.com/fluxrss.xml"><img src="http://www.pixtiz.com/images/favicon.png" alt="[Valid RSS]" title="Validate my RSS feed" width="16" height="16" /></a><br />
Page ini menggunakan format RSS 2.0. <br />
flux RSS.<br />
<br />
</td>
</tr>
<xsl:call-template name="item" />
</table>
</div>
<hr />
</body>
</html>
</xsl:template>
<xsl:template match="item" name="item">
<xsl:for-each select="item">
<tr>
<td colspan="2">
<a href="{link}" target="_blank"><b><xsl:value-of select="title" /></b></a>
<br />
<xsl:value-of select="description" />
</td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>