Finished, just need to do the API

master
Rubenwardy 2012-11-02 18:45:39 +00:00
parent eaa347d7d9
commit 5c532fce7f
22 changed files with 35 additions and 67 deletions

View File

@ -1,3 +1,6 @@
<?php
include "../scripts/setup.php";
$user=$_GET['user'];
$side=$_GET['side'];
?>

View File

@ -1,6 +1,8 @@
<?php
include "scripts/setup.php";
require_login($forum_user);
$user=$forum_user['username'];
$set="";

BIN
files/Elmo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
files/Elmo_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

BIN
files/Nyan Cat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

BIN
files/Nyan Cat_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

BIN
files/Skinny Alien.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

BIN
files/Skinny Alien_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

BIN
files/Slender Man.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

BIN
files/Slender Man_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 392 B

View File

@ -7,6 +7,12 @@ include "scripts/pageheader.php";
?>
<?php
if ($forum_user['username']=="Guest"){
echo "<h1>Welcome</h1>";
echo "Log in to the Minetest forum to set and upload your avatars!<br />\n Until then, you can still <a href=\"gallery.php\">look around</a>";
die("");
}
echo "<h1>Hello, ".$forum_user['username']."</h1>\n";
if (file_exists("files/".$forum_user['cha_front'].".png")){

View File

@ -1,64 +0,0 @@
<?php
echo "<table width=\"100%\"><tr><th colspan=2>Mod Name</th><th>Description</th><th width=200>Tags</th><th>Likes</th></tr>\n";
$query= mysql_real_escape_string ($query);
if ($mode=="tags"){
$qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%'";
}else if ($mode=="sb"){
if (is_numeric($query)==true){
echo "<!--is numeric-->";
$qu_str="SELECT * FROM mods WHERE owner=$query";
}else{
$qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%' OR name LIKE '%$query%' OR overview LIKE '%$query%'";
}
}
$res = mysql_query($qu_str." ORDER BY likes DESC",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.tags for '$query'");
$alternate=1;
// Get projects loop
$is_result=false;
while ($hash = mysql_fetch_assoc($res)){
$is_result=true;
if ($alternate==0){
$bgcolor="#FFFFFF";
}else{
$bgcolor="#FFFFBD";
}
// Owner name from id (by Phitherek_)
$name="";
$q=0;
$q = mysql_query("SELECT name FROM users WHERE id=".$hash['owner']);
if ($q){
$qr = mysql_fetch_array($q) or print("");
$name=$qr['name'];
}
// End of Phitherek_' s code
$image="images/topicicon_read.jpg";
if ($hash['icon'])
$image="icon/".$hash['icon'];
// Owner name instead of id (by Phitherek_)
echo "<tr bgcolor=\"$bgcolor\"><td width=16><img width=16 height=16 src=\"$image\" /></td><td><a href=\"viewmod.php?id={$hash['mod_id']}\">{$hash['name']}</a><br />by $name</td>";
// End of Phitherek_' s change
$overview=str_replace("\\'","'",$hash['overview']);
echo "<td>$overview</td>";
echo "<td>{$hash['tags']}</td>";
echo "<td>{$hash['likes']}</td></tr>\n";
$alternate=1-$alternate;
}
if ($is_result==false){
echo "<tr><td colspan=5><center><i>no search results found</i></center></td></tr>";
}
echo "</table>";
?>

View File

@ -25,7 +25,10 @@ define('FORUM_DISABLE_CSRF_CONFIRM', 1);
define('FORUM_ROOT', '../../mtforum/');
require FORUM_ROOT.'include/common.php';
if ($forum_user['username']=="Guest")
header("location: ".FORUM_ROOT);
function require_login($forum_user){
if ($forum_user['username']=="Guest"){
header("location: ".FORUM_ROOT."login.html");
}
}
?>

View File

@ -15,6 +15,7 @@ $public=($public=="on");
$name=$_POST['name'];
$desc=$_POST['desc'];
$tags=$_POST['tags'];
if ($public==true && $name==""){
$message="You need to give your Avatar Textures a name!";
@ -62,6 +63,15 @@ if ($_FILES["back"]["error"] > 0){
if ($public==false){
header("location: change.php?f=$front_dest&b=$back_dest");
}else{
$name= mysql_real_escape_string ($name);
$desc= mysql_real_escape_string ($desc);
$front_dest= mysql_real_escape_string ($front_dest);
$tags= mysql_real_escape_string ($tags);
$owner= mysql_real_escape_string ($forum_user['username']);
mysql_query("INSERT INTO cha (name, description, file, owner, tags) VALUES ('$name', '$desc', '$front_dest', '$owner', '$tags')",$handle);
$the_id=mysql_insert_id($handle);
header("location: viewcha.php?id=$the_id");
}
}else{
$message="'".$_FILES["front"]["type"]."' is a invalid format. Only PNG files are allowed. ";

View File

@ -1,6 +1,8 @@
<?php
include "scripts/setup.php";
require_login($forum_user);
$page_title="Upload a Texture";
$message="This page is in development - it does not work yet.";
@ -30,6 +32,7 @@ Back: <input type="file" name="back" id="back">
<fieldset>
<legend>Only fill in if the above check box is ticked.</legend>
Name of Character pack: <input type="text" name="name" /><br />
Tags: <input type="text" name="tags" /><br />
Description:<br />
<textarea name="desc" cols=100 rows=7>
</textarea>

View File

@ -20,7 +20,12 @@ include "scripts/pageheader.php";
$links="";
echo "<table width=\"900\"><tr><td>\n";
echo "<table width=\"900\" bgcolor=\"#FFFFBD\"><tr><td width=\"100\"><a href=\"change.php?f={$row[3]}&b={$row[3]}_back\">Use This</a></td>\n";
echo "<table width=\"900\" bgcolor=\"#FFFFBD\"><tr><td width=\"100\">";
if ($forum_user['username']!="Guest")
echo "<a href=\"change.php?f={$row[3]}&b={$row[3]}_back\">Use This</a>";
echo "</td>\n";
echo "<td width=\"650\">\n"; // Download Link
echo "<h1 align=center>{$row[1]} - by {$row[4]}</h1></td>\n"; // Title and User Link