diff --git a/admin.php b/admin.php index 8185cfd..f7fe476 100644 --- a/admin.php +++ b/admin.php @@ -8,12 +8,18 @@ include "scripts/pageheader.php"; echo "

Admin

\n"; +$id=$_GET['id']; +$mode=$_GET['mode']; + +if ($id=="clear"){ + session_destroy(); +} + if (is_member_moderator($_SESSION['user'],$handle)==false){ die ("You do not have admin or moderator position on this forum."); } -$id=$_GET['id']; -$mode=$_GET['mode']; + if($mode=="owner"){ diff --git a/api/3m/getmodbyname.php b/api/3m/getmodbyname.php index ede5473..4dbd730 100644 --- a/api/3m/getmodbyname.php +++ b/api/3m/getmodbyname.php @@ -1,19 +1,13 @@ $tag$desc"; +echo "$tag$desc"; } -echo "

\n"; +echo "

TagDescription
\n"; add_tag("mod","A Mod (use \"type\" radio buttons)"); -add_tag("modpack","A Mod pack (use \"type\" radio buttons)"); +//add_tag("modpack","A Mod pack (use \"type\" radio buttons)"); add_tag("code","A C++ Code Modification (use \"type\" radio buttons)"); add_tag("texture","A texture pack (use \"type\" radio buttons)"); add_tag("sound","A sound pack (use \"type\" radio buttons)"); -seperator(2); +seperator(3); add_tag("deco","Adds decorative blocks"); add_tag("tech","Adds technical mods"); add_tag("fun","Experiemental Mods"); -add_tag("server","Mods ideal for servers (low lag, tools)"); add_tag("food","Mods that add food"); add_tag("growing","Mods that add Plants"); add_tag("mobs","Mods that add mobs"); add_tag("util","Mods that add new features and actions to the game (eg: bones,falling_items,throwing)"); add_tag("3d","Mods that use Node Boxes"); add_tag("* graphics","Mods that improve the graphics of Minetest (eg: animated_torches, different player textures)"); -add_tag("* adventure","Mods that add an adventurous theme to the game (eg: traps, magic)"); -seperator(2); +add_tag("* adventure","(Role Playing) Mods that add an adventurous theme to the game (eg: traps, magic)"); +seperator(3); +add_tag("admin","Admin tools"); +add_tag("grief","Griefing defence, and PvP mods"); +add_tag("* server","Mods ideal for servers (low lag, tools)"); +add_tag("* info","Informational - For those who love knowing all sorts of useful stuff about the server"); +add_tag("* econ","Economy - money and trading"); +add_tag("* chat","Chat Related - more commands, stuff like the IRC Mod"); +seperator(3); add_tag("envir","Changes the map generator"); add_tag("biome","Adds a new biome to the game"); -seperator(2); +seperator(3); add_tag("comic-txt","Cartoon Style Texture Packs"); add_tag("real-txt","Realistic Style Texture Packs"); add_tag("hd-txt","HD Texture Packs"); diff --git a/icon/admin.png b/icon/admin.png new file mode 100644 index 0000000..1502f16 Binary files /dev/null and b/icon/admin.png differ diff --git a/icon/biome.png b/icon/biome.png new file mode 100644 index 0000000..661c086 Binary files /dev/null and b/icon/biome.png differ diff --git a/icon/envir.png b/icon/envir.png new file mode 100644 index 0000000..dcc3822 Binary files /dev/null and b/icon/envir.png differ diff --git a/icon/fun.png b/icon/fun.png new file mode 100644 index 0000000..977c76f Binary files /dev/null and b/icon/fun.png differ diff --git a/icon/growing.png b/icon/growing.png new file mode 100644 index 0000000..7dc89a7 Binary files /dev/null and b/icon/growing.png differ diff --git a/icon/tech.png b/icon/tech.png new file mode 100644 index 0000000..2a75ef3 Binary files /dev/null and b/icon/tech.png differ diff --git a/images/feather.png b/images/feather.png new file mode 100644 index 0000000..5c2d7c1 Binary files /dev/null and b/images/feather.png differ diff --git a/listing.php b/listing.php index 5498974..a3c36ef 100644 --- a/listing.php +++ b/listing.php @@ -1,8 +1,10 @@ \n"; // Title and User Link + +echo ""; + +?> +
+
+
+ \n"; + + /*echo "
\n"; + echo "Details\n"; + echo "
\n";*/ + + echo "
\n"; + echo "Back to '{$mod['name']}'\n"; + echo "
\n"; + + echo "

{$mod['overview']}

"; + + echo "
\n"; + echo "Summary\n"; + echo "
\n"; + + echo "

{$row['overview']}

"; + + + echo "
\n\n"; + + echo "
"; + + + require_once('scripts/formatcode.php'); + $parser = new parser; + $parsed = $parser->p($row['description'],1); + + echo "

$parsed

"; + + include "scripts/pagefooter.php"; + ?> diff --git a/scripts/formatcode.php b/scripts/formatcode.php index 6275244..fc11faf 100644 --- a/scripts/formatcode.php +++ b/scripts/formatcode.php @@ -1119,7 +1119,7 @@ public function p($string, $toBr = 0, $justParse = 1, $useSmilies = 1, $simpleSm $s = preg_replace("#\[url\](.*)\[\/url\]#Ui", "$1", $s); - $s = preg_replace("#\[img\](.*)\[\/img\]#Ui", "", $s); + $s = preg_replace("#\[img\](.*)\[\/img\]#Ui", "", $s); $s = preg_replace("#\[email\=(.*)\](.*)\[\/email\]#Ui", "$2", $s); diff --git a/scripts/loadmods.php b/scripts/loadmods.php index cd20679..ef4ba94 100644 --- a/scripts/loadmods.php +++ b/scripts/loadmods.php @@ -3,7 +3,7 @@ echo "
TagDescription
"; @@ -39,43 +41,43 @@ //List Categories if ($id=="") - listSearch("","All","All Items in order of popularity",$handle,""); + listSearch("","All","All Items in order of popularity",$handle); if ($id=="mod" || $id==""){ - listSearch("mod","All Mods","All Mods in order of popularity",$handle,""); - listSearch("modpack","All Mod Packs","All Mod Packs in order of popularity",$handle,""); - listSearch("code","All C++ Code Mods","All C++ Code Mods in order of popularity",$handle,""); + listSearch("mod","All Mods","All Mods in order of popularity",$handle); + //listSearch("modpack","All Mod Packs","All Mod Packs in order of popularity",$handle); + listSearch("code","All C++ Code Mods","All C++ Code Mods in order of popularity",$handle); } if ($id=="texture" || $id=="") - listSearch("texture","All Texture Packs","All Texture Packs in order of popularity",$handle,""); + listSearch("texture","All Texture Packs","All Texture Packs in order of popularity",$handle); if ($id=="") - listSearch("sound","All Sound Packs","All Sound Packs and Sound Mods in order of popularity",$handle,""); + listSearch("sound","All Sound Packs","All Sound Packs and Sound Mods in order of popularity",$handle); if ($id=="mod" || $id==""){ seperator(4); - listSearch("deco","Block Adder Mods","Adds basic decorating blocks to the game (eg: moreblocks, homedecor)",$handle,""); + listSearch("deco","Block Adder Mods","Adds basic decorating blocks to the game (eg: moreblocks, homedecor)",$handle); listSearch("tech","Technical Mods","Technical Mods (eg: Mesecons, Technic)",$handle,"icon/mesecon.png"); - listSearch("fun","Experimental Mods","Experimental mods for the game (eg: Chess, Mesecons, Carts)",$handle,"icon/carts.png"); - listSearch("server","Server Interaction Mods","Mods ideal for servers (low lag, tools)(eg: antigrief, money)",$handle,"icon/worldedit.png"); - listSearch("food","Food Mods","Mods that add food",$handle,"icon/food.png"); - listSearch("growing","Growing Mods","Mods that add Plants",$handle,"icon/farming.png"); - listSearch("mobs","Mob Mods","Mods that add Mobs",$handle,""); - listSearch("graphics","Graphics","Mods that improve the graphics of Minetest (eg: animated_torches, different player textures)",$handle,""); - listSearch("util","Utility Mods","Mods that add new feature and actons to the game (eg: bones,falling_items,throwing)",$handle,""); - listSearch("3d","3D Object Mods","Mods that use NodeBoxes",$handle,""); + listSearch("fun","Experimental Mods","Experimental mods for the game (eg: Chess, Mesecons, Carts)",$handle); + listSearch("server","Server Interaction Mods","Mods ideal for servers (low lag, tools)(eg: antigrief, money)",$handle); + listSearch("food","Food Mods","Mods that add food",$handle); + listSearch("growing","Growing Mods","Mods that add Plants",$handle); + listSearch("mobs","Mob Mods","Mods that add Mobs",$handle); + listSearch("graphics","Graphics","Mods that improve the graphics of Minetest (eg: animated_torches, different player textures)",$handle); + listSearch("util","Utility Mods","Mods that add new feature and actons to the game (eg: bones,falling_items,throwing)",$handle); + listSearch("3d","3D Object Mods","Mods that use NodeBoxes",$handle); seperator(4); - listSearch("envir","Enviroment Mods","Changes the map generator",$handle,"icon/moreores.png"); - listSearch("biome","Biome Mods","Adds a new biome to the game",$handle,"icon/snow.png"); + listSearch("envir","Enviroment Mods","Changes the map generator",$handle); + listSearch("biome","Biome Mods","Adds a new biome to the game",$handle); } if ($id=="texture" || $id==""){ seperator(4); - listSearch("comic-txt","Comic Style Textures","Cartoon Style Texture Packs",$handle,"icon/haven.png"); - listSearch("real-txt","Realistic Textures","Realistic Styled Texture Packs",$handle,"icon/haven.png"); - listSearch("hd-txt","HD Textures","HD Texture packs",$handle,"icon/haven.png"); + listSearch("comic-txt","Comic Style Textures","Cartoon Style Texture Packs",$handle); + listSearch("real-txt","Realistic Textures","Realistic Styled Texture Packs",$handle); + listSearch("hd-txt","HD Textures","HD Texture packs",$handle); } /*seperator(4); diff --git a/login.php b/login.php deleted file mode 100644 index 62b86c9..0000000 --- a/login.php +++ /dev/null @@ -1,42 +0,0 @@ -Sign Up"; -} - -$page_title="Log In - Minetest Mods"; -include "scripts/pageheader.php"; -echo "

$message

"; -?> - -
-Username:
-Password:
- -
- - \ No newline at end of file diff --git a/logout.php b/logout.php deleted file mode 100644 index 165fecb..0000000 --- a/logout.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/mineteststyle.css b/mineteststyle.css new file mode 100644 index 0000000..cee18bf --- /dev/null +++ b/mineteststyle.css @@ -0,0 +1,479 @@ +html { + margin: 0; +} + +body { + background: #503000; + color: #000000; + font-family: Arial, Helvetica, sans-serif; + margin: 0; +} + +.constrain { + max-width: 60em; + margin: auto; +} + +/* + Navbar +*/ + +.navbar { + position: fixed; + /*margin: 0.2em 0 2.0em 0;*/ + height: 32px; + background: #333333; + /*width: auto;*/ + top: 0; + left: 0; + right: 0; +} + +.navbarbottom1 { + position: fixed; + top: 32px; + left: 0; + right: 0; + background-color: rgba(0,0,0,0.3); + height: 5px; + display: block; +} + +.inbar_main { + float: left; +} +.inbar_separator { + float: left; + padding-top: 4px; + font-size: 18px; + color: #666666; + display: block; + text-decoration: none; + margin-left: 10px; + margin-right: 10px; +} +.inbar_other { + float: left; +} + +.navbar ul { + list-style-type: none; + padding: 0; + margin: 0; + border: 0; +} + +.navbar ul li { + display: inline-block; + padding: 0px 7px 0px 7px; + padding-top: 4px; + font-size: 18px; +} + +#navbar ul li a { + color: #cccccc; + display: block; + text-decoration: none; +} + +#navbar ul li a:hover { + color: #ffffff; +} + +.navlink_normal { +} + +.navlink_special { +} + +.navlink_special2 { +} + +.contribclass { + font-weight: bold; +} + +/* + Logo +*/ + +#logo { + /*text-align: center;*/ + /*background: url("images/logo1.png") center top no-repeat;*/ + /*background: url("images/minetest-icon-120.png") left top no-repeat;*/ + background: #61ad6d; + color: #ffffff; + display: block; + height: 120px; + width: auto; + margin: 0px; + padding: 3em 0 1em 0; + border: 0px; +} + +#logo img { + margin: 0px; + border: 0px; +} + +#logoimage { + float: left; +} + +.bigheader { + text-align: left; + display: block; + padding: 15px 10px 10px 150px; +} + +.bigheader h1 { + margin: 0; + padding: 0; + font-size: 60px; + font-weight: bold; +} + +.bigheader h2 { + margin: 0 0 0 4px; + padding: 0; + font-size: 24px; + font-weight: bold; +} + +#headercomment { + text-align: right; + /*display: block;*/ + padding: 5px; + color: #fff; + font-size: 12px; +} + +#headercomment a { + color: #ffa; + /*text-decoration: none;*/ + font-weight: bold; +} + +/* + Content +*/ + +#content { + font-size: 90%; + margin: 0; + padding: 1em 0 2em 0; + background: #ffffff; +} + +#content img { + margin: 0.5em; +} + +#content a img { + border: 1px solid #666; +} + +#content a:hover img { + border: 1px solid #000; +} + +#content a { + text-decoration: none; + /*color: #61ad6d;*/ + /*color: #30569c;*/ + /*color: #1d34c4;*/ + /*color: #1d34a4;*/ +} + +#content a:visited { + /*color: #;*/ + /*color: #636893;*/ + /*color: #8844B9;*/ + /*color: #682469;*/ +} + +#content a:hover { + text-decoration: underline; +} + +#content h2 h3 h4 { + color: #222222; +} + +/* + Footer +*/ + +#footer { + display: block; + padding: 0em 0.2em 2em 0.2em; + margin-top: 1em; + clear: both; + background: #503000; + /*color: #edb;*/ + color: #ba9; + text-shadow: #210 -1px -1px 0px; +} + +.footerlogo { + margin: auto; + text-align: center; + /*margin-top: 3em;*/ +} + +.footerlogo img { + vertical-align: middle; +} +.footerlogo span { + vertical-align: middle; + margin: 1em; +} +.footermainlist { + vertical-align: middle; + display: inline-block; + text-align: left; +} + +#footer ul { + list-style: none; + padding: 0 0 0 1.5em; +} +#footer ul .the_li { + font-weight: bold; + font-size: 16px; +} + +#footer a { + /*color: #fec;*/ + color: #edb; + font-weight: bold; +} +#footer a:hover { + background-color: #201800; +} + +/* + Random stuff +*/ + +.bigdownload { + font-size: 130%; + /*background-color: #cfa;*/ +} + +.osdownload h3 { + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0px; + margin-bottom: 0px; +} + +.osdownload { + /*background-color: #eeeeff;*/ + border-bottom: 1px solid #888888; + margin: 10px; + padding: 5px 5px 5px 5px; +} + +.sourcetable { + margin: 1em; + margin-left: 3em; +} + +.sourcetable tr { + border: 0px; + padding: 0px; +} + +.sourcetable td { + border: 0px; + padding-left: 0.2em; + padding-right: 0.2em; + border-bottom: 1px solid #888888;; +} + +.serverinfo h3 { + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0px; + margin-bottom: 0px; +} + +.serverinfo { + /*background-color: #eeeeff;*/ + margin: 10px; + padding: 5px 5px 5px 5px; +} + +.buyitem h3 { + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0px; + margin-bottom: 0.5em; +} + +.buyitem { + background-color: #333; + color: #ddd; + margin: 50px 10px 50px 10px; + padding: 5px 5px 5px 5px; + border: 2px solid #000; +} + +.buyprice { + font-size: 25px; + text-align: center; + padding: 0 0.5em 0 0; + margin: 0.5em; + color: #fff; +} + +.buytd { + padding: 0em 2em 0em 2em; + width: 11em; +} + +.catbuybutton { + /*display: inline-block;*/ + /*padding: 0 0 0 9px;*/ +} + +.paypalcatbuybuttonimage { + padding: 0 0 0 1.5em; + margin: 0; +} + +.buydesc { + font-size: 12px; + text-align: center; + padding: 0 1em 0 0; + margin: 1em 0 0 0; + color: #fff; +} + +.note { + color: red; + margin-left: 2em; +} + +.smalltext { + font-size: 70%; +} + +#features li { + margin-bottom: 0.5em; +} + +.newsdate { + font-size: 70%; + float: left; + margin: 0em 1em 1em 0em; + padding: 0.1em; + background: #ffff33; +} + +.commentsdate { + font-size: 70%; + float: left; + margin: 0em 1em 1em 0em; + padding: 0.1em; + background: #ffff33; +} + +.commentsname { + font-weight: bold; + /*float: left; + margin: 0em 1em 1em 0em; + padding: 0.1em; + background: #ffff33;*/ +} + +.comment { + border-bottom: 1px solid #aaa; +} + +.examplecode { + border: 2px solid #dddddd; + padding: 0.3em; +} + +.reply { + font-weight: bold; +} + +.warning { + font-weight: bold; + color: #aa0000; +} + +.donationlistdiv { + /*background-color: #ddccff;*/ + border: solid #888888 1px; + padding: 0 0.5em 0.5em 0.5em; + margin: 0 0 2em 0; + /*float: right; + margin: -2em 1em 1em 1em; + width: 16em; + display: block;*/ +} + +.donationlistdiv h3 { + margin: 0.5em auto 0 auto; + text-align: center; +} + +.donationtable { + /*margin: 0 auto 0 auto;*/ + margin: 0 0 0 0; + border-collapse: collapse; + border-width: 0px; + /*border-width: 1px; + border-color: #888888;*/ + /*border-style: solid;*/ + /*width: 100%;*/ +} + +.donationtable th { + text-align: left; + /*padding: 1px 0.5em 3px 1em;*/ + padding: 1px 0.5em 3px 0.5em; +} + +.donationtable tr { + /*border-width: 1px; + border-color: #888888; + border-style: solid;*/ + /*border-width: 4px; + border-color: #ffffff; + border-style: solid;*/ +} + +.donationtable td { + border-width: 0px; + /*border-width: 1px; + border-color: #888888;*/ + /*border-style: solid;*/ + margin: 1px 0 0 0; + /*padding: 1px 5px 1px 5px;*/ + /*padding: 0px 5px 0px 5px;*/ + padding: 3px 5px 3px 5px; + /*background-color: #ffffaa;*/ + /*background-color: #ffffff;*/ +} + +.donationtable .amount { + text-align: right; +} + +.donor_ul { + list-style-type: none; + padding-left: 0.5em; + margin-left: 0.5em; +} + +.donor_ul li { + /*padding-top: 0.2em; + padding-bottom: 0.2em;*/ + padding: 0.5em 1em 0.5em 1em; + display: table-cell; +} diff --git a/review.php b/review.php new file mode 100644 index 0000000..c25359e --- /dev/null +++ b/review.php @@ -0,0 +1,81 @@ +"; + +echo "

A review of '{$mod['name']}' - by {$owner}

< $query= mysql_real_escape_string ($query); if ($mode=="tags"){ - $qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%'"; + $qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%' AND tags NOT LIKE '%dns%'"; }else if ($mode=="sb"){ if (is_numeric($query)==true){ echo ""; @@ -50,7 +50,7 @@ while ($hash = mysql_fetch_assoc($res)){ // End of Phitherek_' s change $overview=str_replace("\\'","'",$hash['overview']); echo ""; - echo ""; + echo ""; echo "\n"; $alternate=1-$alternate; diff --git a/scripts/messages.php b/scripts/messages.php index e0317e3..026981f 100644 --- a/scripts/messages.php +++ b/scripts/messages.php @@ -14,6 +14,14 @@ if ($_SESSION['msg']==0){ } if ($_SESSION['user']=="RAPHAEL"){ - printNotice("Message to RAPHAEL from the admin","You have not specified many tags for your mods.
Tags group similar mods together, and help users search for and find them. For help, see the tags reference"); + printNotice("Message to RAPHAEL from the admin","Some of your mods do not have their basename/names spaces defined, and so have been hidden from the listings. Hidden Mods\n

In addition to this, you have not specified many tags for your mods.
Tags group similar mods together, and help users search for and find them. For help, see the tags reference\n

"); +} + +if ($_SESSION['user']=="Zeg9"){ + printNotice("Message to Zeg9 from the admin","Some of your mods do not have their basename/names spaces defined, and so have been hidden from the listings. Hidden Mods\n

"); +} + +if ($_SESSION['user']=="hansuke123"){ + printNotice("Message to hansuke123 from the admin","One of your mods has been deleted as it is not applicable on this website"); } ?> \ No newline at end of file diff --git a/scripts/pagefooter.php b/scripts/pagefooter.php index b882a66..a7c23e5 100644 --- a/scripts/pagefooter.php +++ b/scripts/pagefooter.php @@ -20,7 +20,7 @@

  • - Minetest Mods by: Andrew "rubenwardy" Ward
    + Minetest Extensions by: Andrew "rubenwardy" Ward
    Website by: Perttu Ahola, celeron55 @ IRCnet, Freenode, gmail.com
  • diff --git a/scripts/pageheader.php b/scripts/pageheader.php index c8ea95b..76f3b86 100644 --- a/scripts/pageheader.php +++ b/scripts/pageheader.php @@ -10,7 +10,8 @@ echo $page_description; ?>" /> - + + <?php echo $page_title;?> - Minetest Extensions @@ -21,9 +22,6 @@ } #notice_bar { - /*text-align: center;*/ - /*background: url("images/logo1.png") center top no-repeat;*/ - /*background: url("images/minetest-icon-120.png") left top no-repeat;*/ background: #FACF73; color: #000000; display: block; @@ -32,6 +30,12 @@ padding: 1em 0 1em 0; border: 0px; } + +#review td +{ + vertical-align:top; + padding-left:10px; +} @@ -73,10 +77,8 @@ if ($forum_user['username']!="Guest"){ echo "
  • "; echo ""; }else{ -?> - - -Login"; +echo ""; } ?> @@ -92,12 +94,13 @@ echo "
    Mod NameDescription$overview{$hash['tags']}".tagLinks($hash['tags'])."{$hash['likes']}
    \n"; + + echo "
    \n"; + echo "Recommended\n"; + echo "
    \n"; + +echo "
    \n"; echo "\n"; $rec=explode(",",$row[23]); +$count=0; + for ($i=0;$i
    {$row_i[1]}\n"; + + $count++; + + if ($count>2){ + $count=0; + echo ""; + } } } diff --git a/scripts/settings.php b/scripts/settings.php index 832e606..8ff1bf4 100644 --- a/scripts/settings.php +++ b/scripts/settings.php @@ -9,16 +9,18 @@ $game="Minetest"; // The game's name $game_sh="MT"; // The game's name in short hand $logo=""; // The game's logo -$serverpath="http://localhost/minetest-forum"; // The base url to the mod forum +$serverpath="http://multa.bugs3.com/minetest/forum"; // The base url to the mod forum // SQL Database // Settings needed to connect to the MySql Database -$sql_url="localhost"; // The URL to the MySql Server -$sql_user="root"; // The username for the MySql Server -$sql_pass=""; // The password for the MySql Server -$sql_db="minetest"; +$sql_url="mysql.serversfree.com"; // The URL to the MySql Server +$sql_user="u372522788_admin"; // The username for the MySql Server +$sql_pass="password"; // The password for the MySql Server +$sql_db="u372522788_minetest"; + +$punbb_directory="../punbb"; // Email Address Settings @@ -29,5 +31,5 @@ $emailver_mod=true; // Require Email Vertification to post $emailver_login=false; // Require Email Vertification to log in $mt_lock_down=false; // if true, only admins can access forum -$mt_lock_msg=""; +$mt_lock_msg="Message from Rubenwardy: Changing several things involving viewmod.php"; ?> \ No newline at end of file diff --git a/scripts/setup.php b/scripts/setup.php index 51d0fab..72501b4 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -21,6 +21,17 @@ function SQLerror($title,$msg){ die("$msg"); } +function SQLerrorFancy($title,$msg){ + global $serverpath; + global $forum_user; + + $page_title=$title; + include_once "pageheader.php"; + + echo "

    $title

    \n $msg"; + + include_once "pagefooter.php"; +} $handle = mysql_pconnect($sql_url,$sql_user,$sql_pass) or SQLerror("MySQL Database", "Error connecting to the MySQL database"); @@ -30,6 +41,26 @@ SQLerror("MySQL Database", "Error connecting to the MySQL database"); mysql_select_db($sql_db,$handle) or die("Error Switching DB"); + + +//define('FORUM_QUIET_VISIT', 1); +//define('FORUM_TURN_OFF_MAINT', 1); +define('FORUM_DISABLE_CSRF_CONFIRM', 1); +define('FORUM_ROOT', $punbb_relative.$punbb_directory.'/'); +require FORUM_ROOT.'include/common.php'; + +if ($forum_user['username']!="Guest"){ + if (user_exists($forum_user['username'],$handle)==false){ + addUser($forum_user['username'],"x","x",$forum_user['email'],$handle); + } + login($forum_user['username']); +}else{ + $_SESSION['user']==""; + $_SESSION['auth']==""; +} + + + if ($mt_lock_down==true){ if (is_logged_in()==false || is_member_moderator($_SESSION['user'],$handle)==false){ echo ""; @@ -71,7 +102,8 @@ function login($user){ } function is_logged_in(){ - if ($_SESSION['auth']=="somerandomkey"){ + global $forum_user; + if ($forum_user['username']!="Guest"){ return true; } return false; @@ -96,7 +128,7 @@ function require_login(){ function getNoTopics($tag,$handle){ $qu = mysql_real_escape_string ($tag); - $res = mysql_query("SELECT * FROM mods WHERE tags LIKE '%$qu%' ORDER BY likes DESC",$handle); + $res = mysql_query("SELECT * FROM mods WHERE tags LIKE '%$qu%' AND tags NOT LIKE '%dns%'",$handle); return mysql_num_rows($res); } @@ -170,24 +202,15 @@ if ($mod[19]=="git"){ return ""; } -if ($pun_decl==false){ -$pun_decl=true; -//define('FORUM_QUIET_VISIT', 1); -//define('FORUM_TURN_OFF_MAINT', 1); -define('FORUM_DISABLE_CSRF_CONFIRM', 1); -define('FORUM_ROOT', '../forum/'); -require FORUM_ROOT.'include/common.php'; -} - -if ($forum_user['username']!="Guest"){ - if (user_exists($forum_user['username'],$handle)==false){ - addUser($forum_user['username'],"x","x",$forum_user['email'],$handle); - } - login($forum_user['username']); -}else{ - $_SESSION['user']==""; - $_SESSION['auth']==""; -} +function tagLinks($tags){ + $array=explode(",",$tags); + $result=""; + foreach ($array as &$a){ + $result.=" $a"; + } + + return $result; + } ?> diff --git a/scripts/show_reviews.php b/scripts/show_reviews.php new file mode 100644 index 0000000..7463524 --- /dev/null +++ b/scripts/show_reviews.php @@ -0,0 +1,39 @@ +\n"; + +$reviews=false; +while ($hash = mysql_fetch_assoc($res)){ + + + $reviews=true; + + echo ""; + + $owner=""; + if (is_numeric($hash['owner_id'])==true){ + $r = mysql_query("SELECT name FROM users WHERE id=".$hash['owner_id'],$handle) or SQLerror("MySQL Query Error","Error on getting owner name from users"); + $ra = mysql_fetch_array($r); + $owner = $ra['name']; + } + + echo "\n"; + echo "\n"; + + echo ""; +} +echo "
    ".$hash['overview']."\n"; + echo "

    Read More

    "; + echo "
    \n"; + +if ($reviews==false){ + echo "No reviews available"; +} + +?> \ No newline at end of file diff --git a/signup.php b/signup.php deleted file mode 100644 index eaabebf..0000000 --- a/signup.php +++ /dev/null @@ -1,53 +0,0 @@ -If you did not create an account, then it is likely an admin did to add your entry. Ask an admin for your password"; -?> - -
    -$message

    "; -?> -
    -Email:

    -Username:

    -Password:

    -Confirm:

    - -
    -
    -

    Sign Up for a Minetest Mod Forum account

    -

    Vote

    -Vote on which mod, mod pack, texture pack or sound pack is the best -

    Add a Mod

    -Add a mod, mod pack, texture pack or sound pack to this database -

    Secure

    -Your password is safe with SHA-1 encrypton, and we will never share your email address or other details -
    - - \ No newline at end of file diff --git a/slider.js b/slider.js new file mode 100644 index 0000000..29606f8 --- /dev/null +++ b/slider.js @@ -0,0 +1,12 @@ +// Slider Copyright (c) to Andrew Ward + +// get the slider div +var slider = document.getElementById('slider'); + +function slideLeft(){ + +} + +function slideRight(){ + +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..1a14fe7 --- /dev/null +++ b/style.css @@ -0,0 +1,123 @@ +#mod_main{ + max-width:800px; +} + +#mod_bar{ + float:right; + width:300px; + background-color:#E8E8E8; + text-align:center; + padding-bottom:10px; +} + +.bar_title{ + width:100%; + height:42px; + background-color: #333333; + padding-top:12px; + color: #cccccc; + font-size:x-large; +} +#bar_download{ + width:100%; + height:42px; + padding-top:12px; + font-size:x-large; + background-color:#61AD6D; + color:white; + margin-bottom:0; + background-image: url('images/feather.png'); + background-position: bottom; + background-repeat: repeat-x; +} + +#bar_download a { + color: #ffffff; + font-size:x-large; + display: block; + text-decoration: none; +} + +#bar_download a:hover { + color: #cccccc; +} + +#bar_stat{ + margin-left:20px; +} + +#mod_bar td { + text-align:left; +} + +.bar_p { + text-align:left; + padding-left:20px; +} + +.bar_p ul { + text-align:left; +} + +.bar_p ul li { + text-align:left; +} + +#slider { + width:640px; + height:280px; + position:relative; +} + +.slideItem { + position:absolute; + left:0px; + top:0px; + width:100%; + height:100%; + background-size: cover; + background-position: center; +} + +.slideTitle { + position:absolute; + left:0px; + top:0px; + width:630px; + min-height:32px; + padding:5px; + color:white; + background: rgba(97, 173, 109, 0.4); +} + +.slideTitle a { + color: #cccc00; + text-decoration: none; +} + +.slideTitle a:hover { + color: #ffffff; +} + +.slideTitle img { + width: 16px; + height: 16px; +} + +#slideLeft { + position:absolute; + left:0px; + top:124px; + width:32px; + height:32px; + background: rgba(97, 173, 109, 0.4); +} + +#slideRight { + position:absolute; + left:608px; + top:124px; + width:32px; + height:32px; + background: rgba(97, 173, 109, 0.4); +} \ No newline at end of file diff --git a/viewmod.php b/viewmod.php index 32c8211..bcb25d1 100644 --- a/viewmod.php +++ b/viewmod.php @@ -3,130 +3,148 @@ include "scripts/setup.php"; include "scripts/voters.php"; - $id=$_GET['id']; $act=$_GET['action']; - if ($act=="like"){ echo "Liking"; - likeMod($id,$_SESSION['user'],$handle); + likeMod($id,$_SESSION['user'],$handle); } $res=0; -$gen_num=0; +$gen_num=$id; if ($id=="random"){ $gen_num= rand(0,getNoTopics("",$handle)); $res = mysql_query("SELECT * FROM mods LIMIT $gen_num, 1",$handle); }else if (is_numeric($id)){ - $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'"); + $res = mysql_query("SELECT * FROM mods WHERE mod_id=$id",$handle) or SQLerrorFancy("MySQL Query Error","Error on searching database.mods.mod_id for '$id'"); }else{ SQLerror("Non Integer","Non integers are not allowed in the id field.
    Back to home"); } -$row = mysql_fetch_array($res) or SQLerror("Row Error","No results where found for a mod with the id $gen_num"); -$page_title="View mod - {$row[1]}"; -$id=$row[0]; +$row = mysql_fetch_array($res) or SQLerrorFancy("Row Error","No results where found for a mod with the id $gen_num"); +$page_title="View mod - {$row['name']}"; +$id=$row['mod_id']; // 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"); +if (is_numeric($row['owner'])==true){ +$r = mysql_query("SELECT name FROM users WHERE id=".$row['owner'],$handle) or SQLerror("MySQL Query Error","Error on getting owner name from users"); $ra = mysql_fetch_array($r); $owner = $ra['name']; }else{ - $owner = $row[3]; + $owner = $row['owner']; } // End of Phitherek_' s code -$page_description=$row[22]; +$page_description=$row['overview']; + +$dnw_content=true; + include "scripts/pageheader.php"; if (is_member_moderator($_SESSION['user'],$handle)){ -$links="Change Owner - Edit Increase 3m Release Delete"; -}elseif (getUserId($_SESSION['user'],$handle)==$row[3]){ -$links="Edit Increase 3m Release Delete"; + +$links="

  • Change Owner
  • "; +$links.="
  • Edit
  • "; +$links.="
  • Increase 3m Release
  • "; +$links.="
  • Delete
  • "; + +}elseif (getUserId($_SESSION['user'],$handle)==$row['owner']){ + +$links="
  • Edit
  • "; +$links.="
  • Increase 3m Release
  • "; +$links.="
  • Delete
  • "; + }else{ $links=""; } -echo "
    "; +echo "
    "; - - -echo "\n"; -echo "\n"; // Title and User Link - -echo ""; -echo ""; -echo "\n"; // Version -echo "\n"; // Version - -echo ""; - -echo ""; -echo ""; -echo ""; - -echo ""; - -echo ""; - -echo ""; -echo ""; - -echo ""; - -echo ""; -echo "
    \n"; -echo "

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

    Download: LatestVersion: {$row['version']}Name: {$row['basename']}
    Download Type: {$row['repotype']}3M Release: {$row['3m_rele']}License: {$row['license']}
    Tags: {$row['tags']}Depends: {$row['depend']}
    "; - -include_once "scripts/recommend.php"; - -echo "
    "; +echo "

    {$row['name']} - by {$owner}

    \n"; // Title and User Link echo "
    "; -?> - +?> +
    +
    +
    p($row[4], 1, 1, 0, 0, 0, 1, ""); -$parsed = $parser->p($row[4],1); + echo "\n
    \n"; -echo "
    "; + echo "
    \n"; + echo "Download\n"; + echo "
    \n"; -echo "Show/Hide More
    "; + if (is_logged_in()==true){ + $like_ext=""; + if (checkLike($_SESSION['user'],$id,5,$handle)==true) + $like_ext="_high"; -if (is_logged_in()==true){ - $like_ext=""; - if (checkLike($_SESSION['user'],$id,5,$handle)==true) - $like_ext="_high"; + echo "

    \"like\"

    "; + } -echo "\"like\""; -} - -echo "
    "; // Likes + echo "

    {$row['overview']}

    "; -echo "

    $parsed

    "; + function tabCol($title,$msg){ + echo "".$title.":$msg\n"; + } -echo "
    $links
    \n"; + echo "
    \n"; + echo "Details\n"; + echo "
    \n"; -include "scripts/loadposts.php"; + echo "

    \n"; + tabCol("Name",$row['basename']); + tabCol("Version",$row['version']); // Version + tabCol("Release",$row['3m_rele']); + tabCol("License",$row['license']); + tabCol("Method",$row['repotype']); + tabCol("Depends",$row['depend']); + tabCol("Tags",tagLinks($row['tags'])); + echo "

    \n"; + + + if ($links!=""){ + echo "
    \n"; + echo "Control Panel\n"; + echo "
    \n"; + + echo "

      $links

    \n"; + } + + echo "

    "; + + include_once "scripts/recommend.php"; + + echo "

    "; + + echo "
    \n"; + echo "Reviews\n"; + echo "
    \n"; + + echo "

    "; + include "scripts/show_reviews.php"; + echo "

    "; + + echo "
    \n\n"; + +echo "
    "; + + + require_once('scripts/formatcode.php'); + $parser = new parser; + $parsed = $parser->p($row['description'],1); + + echo "

    $parsed

    "; include "scripts/pagefooter.php"; ?>