Finished, just need to do the API
|
@ -1,3 +1,6 @@
|
|||
<?php
|
||||
include "../scripts/setup.php";
|
||||
|
||||
$user=$_GET['user'];
|
||||
$side=$_GET['side'];
|
||||
?>
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
include "scripts/setup.php";
|
||||
|
||||
require_login($forum_user);
|
||||
|
||||
$user=$forum_user['username'];
|
||||
|
||||
$set="";
|
||||
|
|
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 392 B |
After Width: | Height: | Size: 626 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 595 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 392 B |
|
@ -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")){
|
||||
|
|
64
loadmods.php
|
@ -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>";
|
||||
?>
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -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. ";
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|