Countless Changes including Help Docs

master
Rubenwardy 2012-10-06 18:30:21 +01:00
parent 2b0a24a665
commit 4cfc24c717
15 changed files with 204 additions and 38 deletions

View File

@ -9,7 +9,7 @@ if ((include('scripts/addentry.php'))==1){
}
?>
Help: <a href="help/markup.php" target="_blank">Description Markup</a> - <a href="help/tags.php" target="_blank">Tags</a>. Not creating? Make sure you fill in all *ed sections.
Help: <a href="help/entries.php" target="_blank">Guidelines and Tutorial</a> <a href="help/markup.php" target="_blank">Description Markup</a> - <a href="help/tags.php" target="_blank">Tags</a>. Not creating? Make sure you fill in all *ed sections.
<hr />
<form method="post" action="<?php echo curPageURL();?>">
<?php
@ -23,7 +23,8 @@ if (is_member_moderator($_SESSION['user'],$handle)==true){
<!--Mod Name and Version-->
<tr>
<td width="60%">Mod Name:* <input type="text" size="50" name="mod_name" placeholder="The name of this entry" value="<?php echo $name;?>"></td>
<table width="100%"><tr>
<td width="60%">Mod Name:* <input type="text" size="35" name="mod_name" placeholder="The name of this entry" value="<?php echo $name;?>"></td>
<!-- 3m release (by Phitherek_) -->
<td width="40%">
<table width="100%"><tr><td>Version:* <input type="text" size="10" placeholder="This entries version (ie: 1.0 or git)" name="mod_version" value="<?php echo $version;?>"></td><td>
@ -31,10 +32,11 @@ if (is_member_moderator($_SESSION['user'],$handle)==true){
<!-- End of Phitherek_ s change -->
</table>
</td>
</tr></table>
<tr>
<td colspan="2">
<br />
Overview:* <input type="text" size=100 name="mod_ov" placeholder="a short one line explanation of this entry" value="<?php echo $overview;?>">
Overview:* <input type="text" size="70" name="mod_ov" placeholder="a short one line explanation of this entry" value="<?php echo $overview;?>">
</td>
</tr>
<tr>
@ -69,14 +71,17 @@ Delete these notes before adding the entry-->
<!--License and File-->
<tr>
<table width="100%"><tr>
<!--3m Repotype (by Phitherek_)-->
<td>3m Repotype: <select name="mmmrt" size="1">
<td><a href="help/entries.php#download">Type</a>: <select name="mmmrt" size="1">
<option value="archive" selected>Archive</option>
<option value="git">Git</option>
</select></td>
<!--End of Phitherek_ s code-->
<td>File URL*: <input type="text" size="50" name="mod_file" placeholder="Web address to the GitHub page or archive (.zip, etc)" value="<?php echo $file;?>"></td>
</tr></table>
</tr>
<tr>
<td colspan=2>
<br />
@ -87,22 +92,33 @@ License: <input type="text" size="60" placeholder="The entries license." name="m
<!--Depends and Basename-->
<tr>
<td>Depends: <input type="text" placeholder="default,bucket - Separated by a comma ','. blank for no dependency" size="70" name="mod_dep" value="<?php echo $depend;?>"></td>
<table width="100%"><tr>
<td>Depends: <input type="text" placeholder="default,bucket - Separated by a comma ','. blank for no dependency" size="45" name="mod_dep" value="<?php echo $depend;?>"></td>
<td>Mod Namespace: <input type="text" placeholder="Mod folder to be placed in" size="30" name="mod_base" value="<?php echo $basename;?>"></td>
</tr>
</table>
</tr>
<!--Tags-->
<tr><td colspan="2"><br /><br /><center><b>Tags</b> Users use tags to search and find mods</center></td></tr>
<tr>
<table width="100%"><tr>
<td>*
<input type="radio" name="mod_tag_type" value="mod"> Mod
<input type="radio" name="mod_tag_type" value="mdpack"> Mod Pack
<input type="radio" name="mod_tag_type" value="texture"> Texture Pack
</td>
<td>
<a href="help/tags.php" target="_blank">Other Tags</a>: <input type="text" placeholder="separated by commas" size=30 name="mod_tag_msc" value="<?php echo $tags_msc;?>">
<a href="help/tags.php" target="_blank">Other Tags</a>: <input type="text" placeholder="separated by commas" size=30 name="mod_tag_msc" value="<?php
if ($tags_msc==""){
echo "0.4,0.4.1,0.4.2,0.4.3";
}else{
echo $tags_msc;
}
?>">
</td>
</tr></table>
</tr>
<tr>
@ -118,4 +134,4 @@ License: <input type="text" size="60" placeholder="The entries license." name="m
<?php
include "scripts/pagefooter.php";
?>
?>

View File

@ -49,12 +49,14 @@ $owner=$owar['name'];
// End of Phitherek_' s change
$desc=$_POST['mod_desc'];
if ($desc=="")
$desc=$row[4];
if ($desc==""){
echo "getting desc<br />";
$desc=str_replace("\\'","'",$row[4]);
}
$overview=$_POST['mod_ov'];
if ($overview=="")
$overview = $row[22];
$overview = str_replace("\\'","'",$row[22]);
$tags=$_POST['mod_tags'];
if ($tags=="")
@ -84,7 +86,7 @@ if ($basename=="")
$basename=$row[11];
if ($do==true){
include "scripts/entry_adders_sql_safe.php";
include "scripts/entry_adders_sql_safe.php";
mysql_query("UPDATE mods SET version='$version' WHERE name='$name'",$handle);
// 3m release (by Phitherek_)
mysql_query("UPDATE mods SET 3m_rele='$mmmrel' WHERE name='$name'",$handle) or SQLerror("Error on 3m_specific:rel","");
@ -189,4 +191,4 @@ Tags: <input type="text" size=100 name="mod_tags" value="<?php echo $tags;?>">
<?php
include "scripts/pagefooter.php";
?>
?>

19
help/articles.php Normal file
View File

@ -0,0 +1,19 @@
<?php
include "../scripts/setup.php";
$page_title="Articles - Help";
include "../scripts/pageheader.php";
?>
<h1>Article Requirements</h1>
An entrie's description has basically the same requirements as on the minetest forum.<br />
All entry descriptions must contain the following things:
<ul>
<li>A link to the minetest forum post. <i>[url=www.minetest.net/forum/...<b>=url</b>][/url]</i></li>
<li>A screenshot (If applicable)</li>
<li>How to use it, installing structions</li>
</ul>
<?php
include "../scripts/pagefooter.php";
?>

64
help/entries.php Normal file
View File

@ -0,0 +1,64 @@
<?php
include "../scripts/setup.php";
$page_title="Adding and Entry - Help";
include "../scripts/pageheader.php";
?>
<h1>Entries</h1>
<h2>What is an Entry?</h3>
An entry is a mod, texture pack or sound pack that is in this website.
<h2>How do I add an Entry?</h3>
To add an entry you need a register user account. To get one, click "register" at the top-right side of any page.<br />
Go to the home page by clicking "home" in the top-left. Click "Add an Entry".
<hr />
<p>
<table width="100%">
<tr>
<td style="vertical-align:top;" width="400">
<img src="help.jpeg" width="375" alt="The add a mod menu" title="The add a mod menu"" />
</td>
<td style="vertical-align:top;">
<h3><u>Name</u></u></h3>
Your entry needs a <b>unique</b> name. Enter the entries name in the name field
<h3><u>Version</u></h3>
The version can be in any format from major-minor format (ie: 0.4.3) to date-based format (20120608).<br />
Enter the current version of the entry.
<h3><u>3m Release</u></h3>
3m is used by the 3m mod manager, and is a integer (whole number) that increases each time a new version is released.
</td></tr></table>
<h3><u>Overview</u></h3>
The overview is a one line description that can not contain mark up code.
<h3><u>Description</u></h3>
The description is an article, much like a minetest forum article. This may use <a href="markup.php">mark up code</a>. See <a href="articles.php">here</a> for the requirements in a description.
<h3><u><a name="download">Download URL and Type</a></u></h3>
Put a direct link to the latest download in the "file url" text box.
<p>
<b>Type</b><br />
There are two types: <b>git</b> and <b>archive</b>.<br />
<b>Archive</b> is a direct link to a (.zip, .rar, .7y, etc) file.<br />
<b>Git</b> is a link to the GitHub page, which is automatically processed when downloading.
</p>
<h3><u>License</u></h3>
The license is the license of the entry.
<h3><u>Depends</u></h3>
Depends is only for mod entries, and is what mods this mod depends on.
<h3><u>Mod Namespace</u></h3>
Mod Namespace is only for mod entries, and is the mod code for that mod.
A mod code is the name of the folder it is saved to, and is also what precedes each node registeration, ie: <b>moreblocks</b>:superglowglass.
<h3><u>Tags</u></h3>
<a href="tags.php">Tags</a> are used to categorise entries, and to sort them.<br />
You must select an entry type using the select boxes
</p>
<?php
include "../scripts/pagefooter.php";
?>

BIN
help/help.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

17
help/index.php Normal file
View File

@ -0,0 +1,17 @@
<?php
include "../scripts/setup.php";
$page_title="Index - Help";
include "../scripts/pageheader.php";
?>
<h1>Help</h1>
<ul>
<li><a href="entries.php">Adding an Entry</a></li>
<li><a href="markup.php">Description Markup</a></li>
<li><a href="tags.php">Entry Tags</a></li>
</ul>
<?php
include "../scripts/pagefooter.php";
?>

View File

@ -10,12 +10,12 @@ include "../scripts/pageheader.php";
<tr><td>[i]italic[/i]</td><td>Italic</td><td><i>italic</i></td></tr>
<tr bgcolor="#FFFFBD"><td>[u]underline[/u]</td><td>Under Lined</td><td><u>underline</u></td></tr>
<tr><td>[h]header[/h]</td><td>Header (title)</td><td><h1>header</h1></td></tr>
<tr bgcolor="#FFFFBD"><td>[code]The code[/code]</td><td>Adds a code box</td><td><code>The code</code></td></tr>
<tr bgcolor="#FFFFBD"><td>[code]The code[/code]</td><td>Adds a code box</td><td><code style="border:solid;">The code</code></td></tr>
<tr><td>[img]url_for_img[/img]</td><td>Adds an image</td><td><img height="20" src="../images/header.png"></td></tr>
<tr bgcolor="#FFFFBD"><td>[url=the_links_url=url]The Link Text[/url]</td><td>Adds an hyperlink</td><td><a href="the_links_url">The Links Text</a></td></tr>
<tr bgcolor="#FFFFBD"><td>[<b>url=</b><i>the_links_url</i><b>=url</b>]The Link Text[/url]</td><td>Adds an hyperlink</td><td><a href="the_links_url">The Links Text</a></td></tr>
<tr><td>[list]<br />[*]An Item[/*]<br />[*]Another Item[/*]<br />[/list]</td><td>A list</td><td><ul><li>An Item</li><li>Another Item</li></ul></td></tr>
</table>
<?php
include "../scripts/pagefooter.php";
?>
?>

View File

@ -68,10 +68,11 @@
listSearch("hd-txt","HD Textures","HD Texture packs",$handle);
}
seperator(4);
listSearch("0.4.2","0.4.2","for 0.4.2-rc1",$handle);
listSearch("0.4.1","0.4.1","for 0.4 Stable",$handle);
listSearch("0.4","0.4","for 0.4",$handle);
/*seperator(4);
listSearch("0.4.3","0.4.3","for 0.4.3 stable",$handle);
listSearch("0.4.2","0.4.2","for 0.4.2",$handle);
listSearch("0.4.1","0.4.1","for 0.4 stable",$handle);
listSearch("0.4","0.4","for 0.4",$handle);*/
echo "</table>";
//listSearch("0.3","0.3","for 0.3",0);

View File

@ -2,6 +2,8 @@
function formatbb($input){
$result=$input;
$result=str_replace("\\'","'",$result);
$result=str_replace("[img]","<img style=\"max-width:900px;\" src=\"",$result);
$result=str_replace("[/img]","\" />",$result);
$result=str_replace("[/img-enforce]","\" />",$result);
@ -32,7 +34,7 @@ $result=str_replace("[/list]","</ul>",$result);
$result=str_replace("[*]","<li>",$result);
$result=str_replace("[/*]","</li>",$result);
$result=str_replace("[code]","<p><code>",$result);
$result=str_replace("[code]","<p><code style=\"border:solid;\">",$result);
$result=str_replace("[/code]","</code></p>",$result);
$result=str_replace("[color=red]","<font color=\"#FF0000\">",$result);
@ -40,4 +42,4 @@ $result=str_replace("[/color]","</font>",$result);
return $result;
}
?>
?>

View File

@ -27,7 +27,8 @@ while ($hash = mysql_fetch_assoc($res)){
// Owner name instead of id (by Phitherek_)
echo "<tr bgcolor=\"$bgcolor\"><td width=16><img width=16 height=16 src=\"images/topicicon_read.jpg\" /></td><td><a href=\"viewmod.php?id={$hash['mod_id']}\">{$hash['name']}</a><br />by $name</td>";
// End of Phitherek_' s change
echo "<td>{$hash['overview']}</td>";
$overview=str_replace("\\'","'",$hash['overview']);
echo "<td>$overview</td>";
echo "<td>{$hash['tags']}</td>";
echo "<td>{$hash['likes']}</td></tr>\n";

View File

@ -2,4 +2,18 @@
<img src="<?php echo $serverpath;?>/images/header.png" width="900" height="50" border="0" alt="" style="left:0px;">
</div>
</body>
</html>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://multa.bugs3.com/piwik/" : "http://multa.bugs3.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://multa.bugs3.com/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</html>

View File

@ -35,9 +35,9 @@ if (is_logged_in()){
echo "<a href=\"$serverpath/user.php\"><font color=\"#FFFFFF\"><u>User List</u></font></a>";
?></div>
<div style="position:relative;left:670px;top:70px;width:400px;">
<div style="position:relative;left:500px;top:70px;width:400px;text-align:right;">
<form method="get" action="<?php echo $serverpath;?>/search.php">
<input type="text" name="id"> <input type="submit" value="Search">
<input type="text" placeholder="search for something" name="id"> <input type="submit" value="Search">
</form>
</div>

View File

@ -117,7 +117,11 @@ function addUser($user,$pass,$passcon,$email,$handle){
function getUserId($user,$handle){
$qu = mysql_real_escape_string ($user);
$res = mysql_query("SELECT * FROM users WHERE name='$qu'",$handle);
$row = mysql_fetch_row($res) or die("row error");
$row = mysql_fetch_row($res);
if (!$row)
return false;
return $row[0];
}
@ -142,4 +146,4 @@ function cat_read($id,$handle){
return false;
}
?>
?>

View File

@ -7,7 +7,11 @@ function likeMod($id,$user,$handle){
}
$res = mysql_query("SELECT * FROM mods WHERE mod_id=$id",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.mod_id for '$id'");
$row = mysql_fetch_row($res) or die("row error");
$row = mysql_fetch_row($res);
if (!$row)
return false;
$user_d = getUser($user,$handle);
if (!$user_d){
@ -31,7 +35,11 @@ function changeLikes($id,$user,$amount,$handle){
echo "\n\n\n function changeLikes($id,$user,$amount,$handle) is executing\n";
$res = mysql_query("SELECT * FROM mods WHERE mod_id=$id",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.mod_id for '$id'");
$row = mysql_fetch_row($res) or die("row error");
$row = mysql_fetch_row($res);
if (!$row)
return false;
$user_d = getUser($user,$handle);
if (!$user_d){
@ -56,7 +64,11 @@ function changeDislikes($id,$user,$amount,$handle){
echo "\n\n\n function changeDislikes($id,$user,$amount,$handle) is executing\n";
$res = mysql_query("SELECT * FROM mods WHERE mod_id=$id",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.mod_id for '$id'");
$row = mysql_fetch_row($res) or die("row error");
$row = mysql_fetch_row($res);
if (!$row)
return false;
$user_d = getUser($user,$handle);
if (!$user_d){
@ -76,4 +88,4 @@ function changeDislikes($id,$user,$amount,$handle){
mysql_query("UPDATE mods SET dislikes=$tmp WHERE mod_id=$id",$handle) or die("Error on searching database.mods.mod_id for '$id'");
}
}
?>
?>

View File

@ -1,22 +1,28 @@
<?php
include "scripts/setup.php";
include "scripts/voters.php";
$id=$_GET['id'];
$act=$_GET['action'];
if ($act=="like"){
echo "Liking";
likeMod($id,$_SESSION['user'],$handle);
}
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>");
}
$res = mysql_query("SELECT * FROM mods WHERE mod_id=$id",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.mod_id for '$id'");
$row = mysql_fetch_row($res) or die("row error");
$row = mysql_fetch_row($res) or SQLerror("Row Error","No results where found for a mod with the id $id");
$page_title="View mod - {$row[1]}";
// Substitute owner ID with owner name (by Phitherek_):
if (is_numeric($row[3])==true){
$r = mysql_query("SELECT name FROM users WHERE id=".$row[3],$handle) or SQLerror("MySQL Query Error","Error on getting owner name from users");
@ -38,19 +44,27 @@ $links="<a href=\"editentry.php?id=$id\">Edit</a> <a href=\"3mrelinc.php?id=$id\
$links="";
}
echo "<table width=\"100%\"><tr bgcolor=\"#FFFFBD\"><td><a href=\"{$row[9]}\">Download</a></td><td>"; // Download Link
echo "<h1 align=center>{$row[1]} - by <a href=\"user.php?name={$owner}\">{$owner}</a></h1></td>"; // Title and User Link
echo "<td width=150>{$row[2]}</td></tr>"; // Version
echo "<tr><td colspan=2><div style=\"width:900px;text-wrap: suppress;\"><p>".formatbb($row[4])."</p></div></td>"; // Description
echo "<table width=\"100%\"><tr><td>";
echo "<table width=\"100%\" bgcolor=\"#FFFFBD\"><tr><td width=\"100\"><a href=\"{$row[9]}\">Download</a></td>";
echo "<td width=\"650\">"; // Download Link
echo "<h1 align=center>{$row[1]} - by <a href=\"user.php?name={$owner}\" target=\"_blank\">{$owner}</a></h1></td>"; // Title and User Link
echo "<td width=150>{$row[2]}</td></tr></table></td></tr>"; // Version
echo "<tr><td><table width=\"100%\"><tr><td colspan=2><div style=\"width:900px;text-wrap: suppress;\"><p>".formatbb($row[4])."</p></div></td>"; // Description
if (is_logged_in()==true){
echo "<td><a href=\"viewmod.php?id=$id&action=like\">+</a></td></tr>"; // Likes
}else{
echo "<td></td></tr>"; // Likes
}
echo "<tr height=30 bgcolor=\"#FFFFBD\"><td colspan=3 style=\"text-align:right;\">$links&#32;&#32;&#32;&#32;</td></tr>";
echo "</table></td></tr>";
echo "<tr height=30 bgcolor=\"#FFFFBD\"><td style=\"text-align:right;\">$links&#32;&#32;&#32;&#32;</td></tr>";
include "scripts/loadposts.php";
include "scripts/pagefooter.php";
?>
?>