Corrected some stuff
This commit is contained in:
parent
429eed5cb7
commit
39925850dd
10
3mrelinc.php
10
3mrelinc.php
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
// 3m Release increasing (by Phitherek_)
|
||||
include "scripts/setup.php";
|
||||
$page_title="3m Release Increasing (by Phitherek_)";
|
||||
require_login();
|
||||
$id=$_GET['id'];
|
||||
|
||||
@ -9,14 +8,11 @@ if (is_numeric($id)==false){
|
||||
SQLerror("Non Integer","Non integers are not allowed in the id field. <br /> <a href=\"index.php\">Back to home</a>");
|
||||
}
|
||||
|
||||
include "scripts/pageheader.php";
|
||||
|
||||
$mmmres = mysql_query("SELECT rel FROM 3m_specific WHERE id=".$id, $handle) or SQLerror("SQL Error", "Could not find the entry!");
|
||||
$mmmres = mysql_query("SELECT rel FROM mods WHERE mod_id=".$id, $handle) or SQLerror("SQL Error", "Could not find the entry!");
|
||||
$mmmarr = mysql_fetch_array($mmmres);
|
||||
$mmmrel = $mmmarr['rel'];
|
||||
$mmmrel = $mmmarr['3m_rele'];
|
||||
$mmmrel = $mmmrel + 1;
|
||||
$q = mysql_query("UPDATE 3m_specific SET rel=".$mmmrel." WHERE id=".$id, $handle) or SQLerror("SQL Error", "Could not increase 3m release value!");
|
||||
echo("3m Release increased!<br />");
|
||||
$q = mysql_query("UPDATE mods SET 3m_rele=".$mmmrel." WHERE mod_id=".$id, $handle) or SQLerror("SQL Error", "Could not increase 3m release value!");
|
||||
|
||||
header("location: viewmod.php?id=$id");
|
||||
// End of Phitherek_' s code
|
||||
|
22
addentry.php
22
addentry.php
@ -25,13 +25,15 @@ if (is_member_moderator($_SESSION['user'])==true){
|
||||
<tr>
|
||||
<td width="60%">Mod Name:* <input type="text" size="50" name="mod_name" value="<?php echo $name;?>"></td>
|
||||
<!-- 3m release (by Phitherek_) -->
|
||||
<td width="20%">Version:* <input type="text" size="30" name="mod_version" value="<?php echo $version;?>"></td>
|
||||
<td width="20%">3m Release:* <input type="text" size="30" name="mmmrel" value="<?php echo $mmmrel;?>"></td>
|
||||
<!-- End of Phitherek_' s change -->
|
||||
</tr>
|
||||
<td width="40%">
|
||||
<table width="100%"><tr><td>Version:* <input type="text" size="10" name="mod_version" value="<?php echo $version;?>"></td><td>
|
||||
3m Release:* <input type="text" size="10" name="mmmrel" value="<?php echo $mmmrel;?>"></td>
|
||||
<!-- End of Phitherek_ s change -->
|
||||
</table>
|
||||
</td>
|
||||
<tr>
|
||||
|
||||
<!--Description-->
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<p>* Description<Br /><textarea name="mod_desc" cols="105" rows="25">
|
||||
<?php
|
||||
@ -72,9 +74,15 @@ Delete these notes before adding the entry-->
|
||||
<option value="archive" selected>Archive</option>
|
||||
<option value="git">Git</option>
|
||||
</select></td>
|
||||
<!--End of Phitherek_' s code-->
|
||||
<!--End of Phitherek_ s code-->
|
||||
<td>File URL*: <input type="text" size="50" name="mod_file" value="<?php echo $file;?>"></td>
|
||||
<td>License: <input type="text" size="30" name="mod_lic" value="<?php echo $license;?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<br />
|
||||
License: <input type="text" size="60" name="mod_lic" value="<?php echo $license;?>">
|
||||
<br /><br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!--Depends and Basename-->
|
||||
|
@ -5,16 +5,14 @@ $id=$_GET['id'];
|
||||
$id= mysql_real_escape_string ($id);
|
||||
$res = mysql_query("SELECT * FROM mods WHERE basename='$id'",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.mod_id for '$id'");
|
||||
header("Content-type: text/plain");
|
||||
$row = mysql_fetch_array($res) or die("Name:\nDepends:\nFile:\nVersion:\n");
|
||||
$mmmres = mysql_query("SELECT * FROM 3m_specific WHERE id=".$row['id']);
|
||||
$mmmarr = mysql_fetch_array($mmmres);
|
||||
$row = mysql_fetch_array($res) or die("error");
|
||||
|
||||
|
||||
echo "{{$row['basename']}}\n";
|
||||
echo "[description]\n";
|
||||
echo "{$row['desc']}\n";
|
||||
echo "[release]\n";
|
||||
echo "{$mmmres['rel']}\n";
|
||||
echo "{$row['3m_rele']}\n";
|
||||
echo "[deps]\n";
|
||||
$deps = $row['depend'];
|
||||
$parseddeps = "";
|
||||
@ -30,7 +28,7 @@ for($i=0; $i < strlen($deps); $i++) {
|
||||
echo "{$parseddeps}\n";
|
||||
echo "[depsend]\n";
|
||||
echo "[repotype]\n";
|
||||
echo "{$mmmres['repotype']}\n";
|
||||
echo "{$row['repotype']}\n";
|
||||
echo "[repoaddr]\n";
|
||||
echo "{$row['file']}\n";
|
||||
echo "{end}\n";
|
||||
|
@ -12,7 +12,7 @@ if ($version=="")
|
||||
//3m release (by Phitherek_)
|
||||
$mmmrel=$_POST['mmmrel'];
|
||||
if ($mmrel=="")
|
||||
return 0;
|
||||
$mmrel=1;
|
||||
//End of Phitherek_' s code
|
||||
|
||||
$desc=$_POST['mod_desc'];
|
||||
@ -29,6 +29,7 @@ if ($tags_msc=="")
|
||||
return 0;
|
||||
|
||||
$license=$_POST['mod_lic'];
|
||||
|
||||
//3m repotype
|
||||
$mmmrt=$_POST['mmmrt'];
|
||||
if($mmmrt=="")
|
||||
@ -60,15 +61,11 @@ $tags = "$tags_type,$tags_msc,";
|
||||
if (entry_exists($name,$handle))
|
||||
return 1;
|
||||
//Substitute owner with ownerid (by Phitherek_)
|
||||
mysql_query("INSERT INTO mods (name,version,owner,description,tags,likes,dislikes,license,file,depend,basename,date_released)
|
||||
VALUES ('$name','$version',$ownerid,'$desc','$tags',0,0,'$license','$file','$depend','$basename','$date')");
|
||||
mysql_query("INSERT INTO mods (name,version,owner,description,tags,likes,dislikes,license,file,depend,basename,date_released,repotype,3m_rele)
|
||||
VALUES ('$name','$version',$ownerid,'$desc','$tags',0,0,'$license','$file','$depend','$basename','$date','$mmmrt','$mmmrel')");
|
||||
//End of Phitherek_' s change
|
||||
|
||||
$the_id=mysql_insert_id($handle);
|
||||
|
||||
//3m specific adding (by Phitherek_)
|
||||
mysql_query("INSERT INTO 3m_specific VALUES($the_id,$mmmrel,'$mmmrt')");
|
||||
//End of Phitherek_' s code
|
||||
|
||||
header("location: viewmod.php?id=$the_id");
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user