From 0b54adfcc42bf02423e356f1ecbbc0fbfa370b48 Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Thu, 18 Oct 2012 17:28:49 +0100 Subject: [PATCH] Version 0.4 Released I did lots of stuff --- addentry.php | 3 ++- code_mod.php | 20 ++++++++++++++++++ login.php | 4 ++++ scripts/addentry.php | 5 +++++ scripts/formatcode.php | 2 +- scripts/loadmods.php | 8 +++++++ user.php | 27 ++++++++++++++++++++++-- user_password.php | 48 ++++++++++++++++++++++++++++++++++++++++++ viewmod.php | 2 +- 9 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 code_mod.php create mode 100644 user_password.php diff --git a/addentry.php b/addentry.php index af019c2..2a531a5 100644 --- a/addentry.php +++ b/addentry.php @@ -8,9 +8,10 @@ if ((include('scripts/addentry.php'))==1){ echo "Entry already exists.

"; } -?> +?> Help: Guidelines and Tutorial Description Markup - Tags. Not creating? Make sure you fill in all *ed sections.
+
+ +

Code Mod

+ +This Mod is a modification to the minetest engine's source, and needs to be compiled (built, turned in to something useable).
+If you do not know how to compile, there should be a pre-compiled version on the mod's page. If not, ask someone how to do it.
+ +

+Continue to the Source + + \ No newline at end of file diff --git a/login.php b/login.php index 5852964..62b86c9 100644 --- a/login.php +++ b/login.php @@ -10,7 +10,11 @@ $message=""; if (authcheck($user,$pass,$handle)==true){ login($user); if ($redir==""){ + if ($pass=="temp_pass"){ + header("location: user_password.php?auto=true&redir=user_email.php"); + }else{ header("location: index.php"); + } }else{ header("location: $redir"); } diff --git a/scripts/addentry.php b/scripts/addentry.php index e45cd75..d883812 100644 --- a/scripts/addentry.php +++ b/scripts/addentry.php @@ -8,6 +8,11 @@ $name=$_POST['mod_name']; if ($name=="") return 0; +if (strstr($name,"'")==true){ + $message="The name field may not contain '"; + return 0; +} + $version=$_POST['mod_version']; if ($version=="") return 0; diff --git a/scripts/formatcode.php b/scripts/formatcode.php index 45719fd..23c7ca5 100644 --- a/scripts/formatcode.php +++ b/scripts/formatcode.php @@ -8,7 +8,7 @@ $result=str_replace("[img]","",$result); $result=str_replace("[/img-enforce]","\" />",$result); -$result=str_replace("[url=","",$result); $result=str_replace("[/url]","",$result); diff --git a/scripts/loadmods.php b/scripts/loadmods.php index c1ecd81..17a2703 100644 --- a/scripts/loadmods.php +++ b/scripts/loadmods.php @@ -18,7 +18,10 @@ $res = mysql_query($qu_str." ORDER BY likes DESC",$handle) or SQLerror("MySQL Qu $alternate=1; // Get projects loop +$is_result=false; while ($hash = mysql_fetch_assoc($res)){ + + $is_result=true; if ($alternate==0){ $bgcolor="#FFFFFF"; @@ -47,5 +50,10 @@ while ($hash = mysql_fetch_assoc($res)){ $alternate=1-$alternate; } + +if ($is_result==false){ +echo "

no search results found
"; +} + echo ""; ?> diff --git a/user.php b/user.php index 6d3f6ab..af179f0 100644 --- a/user.php +++ b/user.php @@ -27,9 +27,32 @@ while ($hash = mysql_fetch_assoc($res)){ } $res = mysql_query("SELECT * FROM users WHERE id=$id",$handle) or SQLerror("MySQL Query Error","Error on getting database.users"); $hash = mysql_fetch_assoc($res); + + switch($hash['level']) + { + case 0: + $level=" normal member"; + break; + case 1: + $level=" vertified member"; + break; + case 2: + $level="n admin"; + break; + } + echo "

{$hash['name']}

"; - echo "{$hash['name']} is a level {$hash['level']} member."; - echo "

View {$hash['name']}'s mods

"; + echo "{$hash['name']} is a{$level}."; + echo "

Back to User List


"; + + $query=$id; + $mode="sb"; + if ($mode=="") + $mode="tags"; + + + include "scripts/loadmods.php"; + } include "scripts/pagefooter.php"; diff --git a/user_password.php b/user_password.php new file mode 100644 index 0000000..78b0027 --- /dev/null +++ b/user_password.php @@ -0,0 +1,48 @@ + +
+

Change your password

+ +Old Password: >
+
+New Password:
+Confirm Password:

+ + +
+ + \ No newline at end of file diff --git a/viewmod.php b/viewmod.php index d6f5f1c..b7cf505 100644 --- a/viewmod.php +++ b/viewmod.php @@ -49,7 +49,7 @@ echo ""; // Version
"; echo ""; echo ""; // Title and User Link +echo "

{$row[1]} - by {$owner}

"; // Title and User Link echo "
Download"; // Download Link -echo "

{$row[1]} - by {$owner}

{$row[2]}