diff --git a/addentry.php b/addentry.php index f96d965..7704989 100644 --- a/addentry.php +++ b/addentry.php @@ -44,7 +44,7 @@ Overview:* -

Description:*
+ +

+ + + \ No newline at end of file diff --git a/deleteentry.php b/deleteentry.php index 1bd633c..9d17251 100644 --- a/deleteentry.php +++ b/deleteentry.php @@ -1,6 +1,6 @@
-

Delete an Entry

- will be permanatly deleted

+

Delete an extension

+ will be permanently deleted

diff --git a/images/dislike_mod.png b/images/dislike_mod.png deleted file mode 100644 index ab6655a..0000000 Binary files a/images/dislike_mod.png and /dev/null differ diff --git a/images/dislike_mod_high.png b/images/dislike_mod_high.png deleted file mode 100644 index b175b75..0000000 Binary files a/images/dislike_mod_high.png and /dev/null differ diff --git a/images/like.png b/images/like.png new file mode 100644 index 0000000..fb46cb0 Binary files /dev/null and b/images/like.png differ diff --git a/images/like_high.png b/images/like_high.png new file mode 100644 index 0000000..9a6d43c Binary files /dev/null and b/images/like_high.png differ diff --git a/images/like_high_over.png b/images/like_high_over.png new file mode 100644 index 0000000..993de05 Binary files /dev/null and b/images/like_high_over.png differ diff --git a/images/like_mod.png b/images/like_mod.png deleted file mode 100644 index 95ac942..0000000 Binary files a/images/like_mod.png and /dev/null differ diff --git a/images/like_mod_high.png b/images/like_mod_high.png deleted file mode 100644 index 08637ca..0000000 Binary files a/images/like_mod_high.png and /dev/null differ diff --git a/images/like_over.png b/images/like_over.png new file mode 100644 index 0000000..9afac8a Binary files /dev/null and b/images/like_over.png differ diff --git a/images/wp5533b116.gif b/images/wp5533b116.gif deleted file mode 100644 index 1af5f06..0000000 Binary files a/images/wp5533b116.gif and /dev/null differ diff --git a/images/wp70bdea63_06.png b/images/wp70bdea63_06.png deleted file mode 100644 index 3499336..0000000 Binary files a/images/wp70bdea63_06.png and /dev/null differ diff --git a/images/wp796e836f_06.png b/images/wp796e836f_06.png deleted file mode 100644 index ce75e13..0000000 Binary files a/images/wp796e836f_06.png and /dev/null differ diff --git a/images/wp8da89ed3_06.png b/images/wp8da89ed3_06.png deleted file mode 100644 index 4e1f0f1..0000000 Binary files a/images/wp8da89ed3_06.png and /dev/null differ diff --git a/images/wp906af827_06.png b/images/wp906af827_06.png deleted file mode 100644 index 967a09a..0000000 Binary files a/images/wp906af827_06.png and /dev/null differ diff --git a/images/wp9f108e24_06.png b/images/wp9f108e24_06.png deleted file mode 100644 index cdb705e..0000000 Binary files a/images/wp9f108e24_06.png and /dev/null differ diff --git a/images/wpae096824_06.png b/images/wpae096824_06.png deleted file mode 100644 index e2ceb31..0000000 Binary files a/images/wpae096824_06.png and /dev/null differ diff --git a/images/wpc5e55123_06.png b/images/wpc5e55123_06.png deleted file mode 100644 index 7b876e1..0000000 Binary files a/images/wpc5e55123_06.png and /dev/null differ diff --git a/index.php b/index.php index 34f7a22..4b1ec45 100644 --- a/index.php +++ b/index.php @@ -35,35 +35,12 @@ include "scripts/pageheader.php";

Welcome to Minetest Extensions

- Welcome to Minetest Extensions, the Mod, texture pack, sound pack and other things database. - - Statistics + Minetest's full potential can only be obtained by installing mods, and other stuff. So shall we get started?

- -".$title.":$msg\n"; -} - -echo "

"; - -echo "

\n77 users contributing ".getNoTopics("",$handle)." extensions\n

\n"; - -echo "\n"; - -tabCol("Mods",getNoTopics("mod",$handle)); -tabCol("Games",getNoTopics("game",$handle)); -tabCol("Code Mods",getNoTopics("code",$handle)); -tabCol("Texture Packs",getNoTopics("texture",$handle)); -tabCol("Visitors","380 a week"); -tabCol("Extension Views","unknown"); -tabCol("Downloads","unknown"); -echo "

\n"; -?> -

- If you have any questions at all, do not hesitate to contact us on this project's forum topic + Here's how to install: + mods, + texture packs

@@ -72,7 +49,12 @@ echo "

\n";
-

Featured

+

Random Extension

+

+ Why dont you try something new? Click the above link to go randomly to one of our extensions. +

+ +
@@ -88,11 +70,11 @@ echo "

\n";
-

Random Extension

+

Hottest Extensions

@@ -126,6 +108,37 @@ echo "

\n"; + +

+ Statistics +

+ + ".$title.":$msg\n"; + } + + echo "

"; + + echo "

\n77 users contributing ".getNoTopics("",$handle)." extensions\n

\n"; + + echo "\n"; + + tabCol("Mods",getNoTopics("mod",$handle)); + tabCol("Games",getNoTopics("game",$handle)); + tabCol("Code Mods",getNoTopics("code",$handle)); + tabCol("Texture Packs",getNoTopics("texture",$handle)); + tabCol("Visitors","380 a week"); + tabCol("Extension Views","unknown"); + tabCol("Downloads","unknown"); + echo "

\n"; + ?> + +

+ If you have any questions at all, do not hesitate to contact us on this project's forum topic +

+ \ No newline at end of file diff --git a/review.php b/review.php index c25359e..06e6b35 100644 --- a/review.php +++ b/review.php @@ -12,8 +12,8 @@ $row = mysql_fetch_array($res) or SQLerrorFancy("Row Error","No results where fo if (!$row) SQLerrorFancy("Result error","No results where found for a review with the id $id"); -$mres = mysql_query("SELECT * FROM mods WHERE mod_id={$row['mod_id']}",$handle) or SQLerrorFancy("MySQL Query Error","Error on searching database.mods.mod_id for '$id'"); -$mod = mysql_fetch_array($mres) or SQLerrorFancy("Row Error","No results where found for a mod with the id $gen_num"); +$mres = mysql_query("SELECT * FROM mods WHERE mod_id={$row['mod_id']}",$handle) or SQLerrorFancy("MySQL Query Error","Error on searching database.mods.mod_id for '{$row['mod_id']}'"); +$mod = mysql_fetch_array($mres) or SQLerrorFancy("Row Error","No results where found for a mod with the id {$row['mod_id']}"); if (!$mod) SQLerrorFancy("Result error","No results where found for a mod with the id {$row['mod_id']}"); diff --git a/scripts/setup.php b/scripts/setup.php index 1567f0c..4fbd5dc 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -173,15 +173,15 @@ return false; } function getDownload($mod){ -if ($mod['repotype']=="git"){ - return $mod['file']."/zipball/master"; -}else if ($mod['repotype']=="archive"){ - if (strstr($mod['tags'],"code")==true){ - return "code_mod.php?url=".$mod[9]; - }else{ - return $mod['file']; - } -}else{ + if ($mod['repotype']=="git"){ + return $mod['file']."/zipball/master"; + }else if ($mod['repotype']=="archive"){ + if (strstr($mod['tags'],"code")==true){ + return "code_mod.php?url=".$mod[9]; + }else{ + return $mod['file']; + } + }else{ } return ""; diff --git a/scripts/show_reviews.php b/scripts/show_reviews.php index 7463524..c62b47b 100644 --- a/scripts/show_reviews.php +++ b/scripts/show_reviews.php @@ -1,39 +1,45 @@ \n"; - +$res = mysql_query("SELECT * FROM reviews WHERE mod_id=$id",$handle); $reviews=false; -while ($hash = mysql_fetch_assoc($res)){ +if ($res){ + echo "\n"; - $reviews=true; + while ($hash = mysql_fetch_assoc($res)){ + $reviews = true; - echo ""; + 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']; - } + $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 "\n"; + echo "\n"; - echo ""; + echo ""; + } + echo "
$owner
".$hash['overview']."\n"; - echo "

Read More

"; - echo "
$owner
".$hash['overview']."\n"; + echo "

Read More

"; + echo "
\n"; } -echo "\n"; if ($reviews==false){ echo "No reviews available"; + + echo "

\n\tBe the first to review this mod\n

"; +}else{ + echo "

\n\tReview this mod\n

"; } ?> \ No newline at end of file diff --git a/style.css b/style.css index 9fd7cdc..08e81bc 100644 --- a/style.css +++ b/style.css @@ -269,4 +269,24 @@ top:-18px; text-align:center; width:100%; +} + +.like_button{ + display:block; + width:93px; + height:32px; + background-size:cover; + background-repeat:no-repeat; + text-align: center; + vertical-align: middle; + margin-left:20px; + margin-right:20px; +} + +.big_link{ + display:block; + width:61px; + height:24px; + padding-left:32px; + padding-top:8px; } \ No newline at end of file diff --git a/viewmod.php b/viewmod.php index 8189a50..70ee435 100644 --- a/viewmod.php +++ b/viewmod.php @@ -3,9 +3,11 @@ include "scripts/setup.php"; include "scripts/voters.php"; +// Get commands $id=$_GET['id']; $act=$_GET['action']; +// Check action if ($act=="like"){ echo "Liking"; likeMod($id,$_SESSION['user'],$handle,true); @@ -14,9 +16,11 @@ if ($act=="like"){ header("location: viewmod.php?id=$id"); } +// Mod handlers $res=0; $gen_num=$id; +// Get the mod query if ($id=="random"){ $gen_num= rand(0,getNoTopics("",$handle)); $res = mysql_query("SELECT * FROM mods LIMIT $gen_num, 1",$handle); @@ -26,74 +30,76 @@ if ($id=="random"){ SQLerror("Non Integer","Non integers are not allowed in the id field.
Back to home"); } -$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']}"; +// Get the mod row +$row = mysql_fetch_array($res) or SQLerrorFancy("Unable to display extension","No results where found for an extension with the id $gen_num"); $id=$row['mod_id']; $page_keywords=$row['tags']; -// Substitute owner ID with owner name (by Phitherek_): +// Get the owner's name 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']; + $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['owner']; + $owner = $row['owner']; } -// End of Phitherek_' s code +// Get the page description $page_description=$row['overview']; +// Set pageheader.php attributes +$page_title="View mod - {$row['name']}"; $dnw_content=true; +// Run pageheader.php include "scripts/pageheader.php"; - +// Get control panel content if (is_member_moderator($_SESSION['user'],$handle) || getUserId($_SESSION['user'],$handle)==$row['owner']){ - -$links="
  • Edit
  • "; -$links.="
  • Increase 3m Release
  • "; -$links.="
  • Delete
  • "; - + $links="
  • Edit
  • "; + $links.="
  • Increase 3m Release
  • "; + $links.="
  • Delete
  • "; }else{ -$links=""; + $links=""; } +// Extension banner echo "
    "; - echo "

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

    \n"; // Title and User Link - echo "
    "; - -if ($row['mod_id']==38){ -echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this.
    "; -} ?>
    \n"; + // Download section echo "
    \n"; echo "Download\n"; echo "
    \n"; + $like_ext=""; + if (is_logged_in()==true){ - $like_ext=""; if (likeMod($id,$_SESSION['user'],$handle,false)==true) $like_ext="_high"; - echo "

    \"like\"

    "; + echo "

    "; + }else{ + echo "

    {$row['likes']}

    "; } - echo "

    {$row['overview']}

    "; + echo "

    {$row['overview']}

    "; function tabCol($title,$msg){ echo "".$title.":$msg\n"; } + // Details section echo "
    \n"; echo "Details\n"; echo "
    \n"; @@ -112,7 +118,7 @@ echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this. progressBar($row['progress'],260,$row['progress']."% completed"); echo "
    "; - + // Control panel section if ($links!=""){ echo "
    \n"; echo "Control Panel\n"; @@ -120,6 +126,8 @@ echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this. echo "
      $links
    \n"; } + + // Admin section if (is_member_moderator($_SESSION['user'],$handle)){ echo "
    \n"; echo "Admin Scripts\n"; @@ -131,12 +139,12 @@ echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this. echo "
    \n"; } + // Recommended section echo "

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

    "; + // Reviews section echo "
    \n"; echo "Reviews\n"; echo "
    \n"; @@ -145,16 +153,18 @@ echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this. include "scripts/show_reviews.php"; echo "

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

    $parsed

    "; ?> @@ -165,5 +175,6 @@ echo "

    Similar Code Part of 0.4.4

    Only use this for versions before this.