Profile
MAJ is an Open Source, PHP-based content management system (CMS) that can be deployed as a blog, bulletin or message board, Internet forum, and wiki. It is extensible via PHP panels and is HTML5 and CSS3 ready.
Git
This blob has been accessed 640 times via Git panel.

  1. <?php
  2.  
  3.  
  4. header("Cache-control: private");
  5.  
  6. error_reporting(E_ERROR);
  7.  
  8. require("core.php");
  9.  
  10. if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
  11.         header("Location: login.php");
  12. }
  13.  
  14. if (!isset($_REQUEST['entry']) or empty($_REQUEST['entry'])) {
  15.         exit();
  16. }
  17.  
  18. if (!isset($_REQUEST['show']) or empty($_REQUEST['show'])) {
  19.         exit();
  20. }
  21.  
  22. if (!file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
  23.         exit();
  24. }
  25.  
  26. $login_username = file_get_contents("data/username.txt");
  27.  
  28. //if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
  29. //      exit();
  30. //}
  31.  
  32. if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "delete")) {
  33.  
  34.         unlink("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}");
  35.  
  36.         if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
  37.                 unlink("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
  38.         }
  39.  
  40.         if (file_exists("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt")) {
  41.                 unlink("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt");
  42.         }
  43.  
  44.         if (count(glob("images/{$_REQUEST['entry']}/album/*")) < 1) {
  45.                 header("Location: index.php?entry={$_REQUEST['entry']}");
  46.         }
  47.        
  48.         header("Location: album.php?entry={$_REQUEST['entry']}&show={$_REQUEST['next']}");
  49. }
  50.  
  51. if (isset($_POST['filename']) and !empty($_POST['filename']) and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "rename") and !file_exists("images/{$_REQUEST['entry']}/album/{$_POST['filename']}")) {
  52.  
  53.         $filename = strtolower($_POST['filename']);
  54.         $filename = str_replace(" ","_",$filename);
  55.         $filename = trim($filename);
  56.  
  57.         rename("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}","images/{$_REQUEST['entry']}/album/{$filename}");
  58.  
  59.         if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
  60.                 rename("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt","data/items/{$_REQUEST['entry']}/album/captions/{$filename}.txt");
  61.         }
  62.  
  63.         if (file_exists("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt")) {
  64.                 rename("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt","data/items/{$_REQUEST['entry']}/album/views/{$filename}.txt");
  65.         }
  66.        
  67.         header("Location: album.php?entry={$_REQUEST['entry']}&show=$filename");
  68. }
  69.  
  70. if ((!isset($_POST['caption']) or empty($_POST['caption'])) and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "caption")) {
  71.  
  72.         if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
  73.                 unlink("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
  74.         }
  75. }
  76.  
  77. if (isset($_POST['caption']) and !empty($_POST['caption']) and isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_POST['edit']) and ($_POST['edit'] == "caption")) {
  78.         $caption_put = ucfirst($_POST['caption']);
  79.         $caption_put = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_put);
  80.         $caption_put = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_put);
  81.         $caption_put = str_replace(':|', '<img src="images/smileys/indifferent.png" border="0">', $caption_put);
  82.         $caption_put = str_replace(':D', '<img src="images/smileys/laughing.png" border="0">', $caption_put);
  83.         $caption_put = str_replace(':P', '<img src="images/smileys/lick.png" border="0">', $caption_put);
  84.         $caption_put = str_replace(':O', '<img src="images/smileys/ohno.png" border="0">', $caption_put);
  85.         $caption_put = str_replace(':)', '<img src="images/smileys/smile.png" border="0">', $caption_put);
  86.         $caption_put = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $caption_put);
  87.         $caption_put = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $caption_put);
  88.         $caption_put = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $caption_put);
  89.         $caption_put = str_replace('[code]', '<code>', $caption_put);
  90.         $caption_put = str_replace('[/code]', '</code>', $caption_put);
  91.         $caption_put = str_replace("\n", '<br />', $caption_put);
  92.         $caption_put = str_replace('[b]', '<b>', $caption_put);
  93.         $caption_put = str_replace('[/b]', '</b>', $caption_put);
  94.         $caption_put = str_replace('[i]', '<i>', $caption_put);
  95.         $caption_put = str_replace('[/i]', '</i>', $caption_put);
  96.         $caption_put = str_replace('[u]', '<u>', $caption_put);
  97.         $caption_put = str_replace('[/u]', '</u>', $caption_put);
  98.         $caption_put = str_replace('[strike]', '<strike>', $caption_put);
  99.         $caption_put = str_replace('[/strike]', '</strike>', $caption_put);
  100.         $caption_put = str_replace('[sup]', '<sup>', $caption_put);
  101.         $caption_put = str_replace('[/sup]', '</sup>', $caption_put);
  102.         $caption_put = str_replace('[sub]', '<sub>', $caption_put);
  103.         $caption_put = str_replace('[/sub]', '</sub>', $caption_put);
  104.         $caption_put = str_replace('[highlight]', '<highlight>', $caption_put);
  105.         $caption_put = str_replace('[/highlight]', '</highlight>', $caption_put);
  106.         $caption_put = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $caption_put);
  107.         $caption_put = str_replace('</highlight>', '</span>', $caption_put);
  108.  
  109.         if (!file_exists("data/items/{$_REQUEST['entry']}/album")) {
  110.                 mkdir("data/items/{$_REQUEST['entry']}/album");
  111.         }
  112.  
  113.         if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions")) {
  114.                 mkdir("data/items/{$_REQUEST['entry']}/album/captions");
  115.         }
  116.  
  117.         $open_caption_txt_file = fopen("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt","w");
  118.         fwrite($open_caption_txt_file,$caption_put);
  119.         fclose($open_caption_txt_file);
  120. }
  121.  
  122. echo "<title>{$_REQUEST['show']}</title>";
  123.  
  124. ?>
  125.  
  126. <style>
  127.  
  128. body {
  129.         color: #666666;
  130.         margin: 10px;
  131.         padding: 0px;
  132.         text-align: left;
  133.         font-family: <?php
  134.                                 if (file_exists("data/fonts/body.txt")) {
  135.                                         $font_body = file_get_contents("data/fonts/body.txt");
  136.                                         echo "{$font_body},";
  137.                                 }
  138.         ?> arial, helvetica, sans-serif;
  139.         background-color: #FFFFFF;
  140. }
  141.  
  142. p,td {
  143.         font-size: 11px;
  144. }
  145.  
  146. a {
  147.         font-weight: bold;
  148.         text-decoration: none;
  149. }
  150.  
  151. a:link, a:visited {
  152.         color: #666666;
  153. }
  154.  
  155. a:hover {
  156.         color: #336699;
  157. }
  158.  
  159. a:active {
  160.         color: #336699;
  161. }
  162.  
  163. .input {        
  164.         color: #666666;
  165.         background: #FFFFFF;
  166.         border: #999999 solid 1px;
  167.         width: 100%;
  168.         font-family: <?php
  169.                                 if (file_exists("data/fonts/input.txt")) {
  170.                                         $font_input = file_get_contents("data/fonts/input.txt");
  171.                                         echo "{$font_input},";
  172.                                 }
  173.         ?> arial, helvetica, sans-serif;
  174.         font-size: 11px;
  175. }
  176. </style>
  177.  
  178. <?php
  179.  
  180. if (file_exists("images/{$_REQUEST['entry']}/album")) {
  181.         if ($dh_album = opendir("images/{$_REQUEST['entry']}/album")) {
  182.                 while (($entry_album = readdir($dh_album)) !== false) {
  183.                         if ($entry_album != "." && $entry_album != ".." && fnmatch("*", $entry_album)) {
  184.                                 $sort_album[] = $entry_album;
  185.                         }
  186.                 }
  187.         closedir($dh_album);
  188.         }
  189.  
  190.         sort($sort_album);
  191.         reset($sort_album);
  192. }
  193.  
  194. $key_view = array_search($_REQUEST['show'],$sort_album);
  195.  
  196. $key_prev = $key_view - 1;
  197. $key_next = $key_view + 1;
  198.  
  199. $show_prev = $sort_album[$key_prev];
  200. $show_next = $sort_album[$key_next];
  201.  
  202. $count_album_entry = count($sort_album);
  203.  
  204. $album_image_colspan = 4;
  205.  
  206. // echo "$count_album_entry -> $key_prev | $key_view | $key_next";
  207.  
  208. if (file_exists("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}")) {
  209.  
  210.         if (!file_exists("data/items/{$_REQUEST['entry']}/album/views")) {
  211.                 mkdir("data/items/{$_REQUEST['entry']}/album/views");
  212.         }
  213.  
  214.         if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
  215.                 $fp_image_views_txt = fopen("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt","r");
  216.                 $image_views_value = fread($fp_image_views_txt,filesize("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt"));
  217.                 fclose($fp_image_views_txt);
  218.                 $image_views_value = $image_views_value + 1;
  219.                 $fp_image_views_txt = fopen("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt","w");
  220.                 fwrite($fp_image_views_txt, $image_views_value);
  221.                 fclose($fp_image_views_txt);
  222.         }
  223.  
  224.         echo "<table cellspacing=\"1\" cellpadding=\"2\" border=\"0\" bgcolor=\"#ffffff\"><tr><td valign=\"top\">";
  225.  
  226.         echo "<table cellspacing=\"1\" cellpadding=\"2\" border=\"0\" bgcolor=\"#cccccc\"><tr bgcolor=\"#ffffff\">";
  227.  
  228.         if ($key_prev >= 0) {
  229.  
  230.                 $album_image_colspan = $album_image_colspan + 1;
  231.        
  232.                 echo "<td align=\"left\" width=\"11\"><a href=\"album.php?entry={$_REQUEST['entry']}&show=$show_prev\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\"></a></td>";
  233.         }
  234.  
  235.         echo "<td align=\"center\"><b>{$_REQUEST['show']}</b></td><td align=\"center\">";
  236.  
  237.         $album_image_size = getimagesize("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}",$album_image_info);
  238.         $album_image_width = $album_image_size[0];
  239.         $album_image_height = $album_image_size[1];
  240.  
  241.         echo "$album_image_width x $album_image_height pixels";
  242.  
  243.         $size = filesize("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}");
  244.         $size_string = ($size > 512)?(  ($size/1024 > 512)  ?sprintf("%.02f MB",($size/1024)/1024)  :sprintf("%.02f KB",$size/1024))  :sprintf("%d B",$size);
  245.         echo "</td><td align=\"center\">$size_string</td><td align=\"center\">";
  246.  
  247.         $album_image_views = file_get_contents("data/items/{$_REQUEST['entry']}/album/views/{$_REQUEST['show']}.txt");
  248.         echo "$album_image_views view";
  249.  
  250.         if ($album_image_views > 1) {
  251.                 echo "s";
  252.         }
  253.  
  254.         echo "</td>";
  255.  
  256.         if ($key_next < $count_album_entry) {
  257.  
  258.                 $album_image_colspan = $album_image_colspan + 1;
  259.  
  260.                 echo "<td align=\"right\" width=\"11\"><a href=\"album.php?entry={$_REQUEST['entry']}&show=$show_next\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\"></a></td>";
  261.         }
  262.  
  263.         echo "</tr>";
  264.  
  265.         echo "<tr bgcolor=\"#ffffff\"><td colspan=\"$album_image_colspan\" align=\"center\">";
  266.         echo "<img src=images/{$_REQUEST['entry']}/album/{$_REQUEST['show']} width=$album_image_width height=$album_image_height border=0>";
  267.         echo "</td></tr>";
  268.         if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
  269.                 echo "<form enctype=\"multipart\/form-data\" action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">";
  270.                 echo "<input type=hidden name=entry value={$_REQUEST['entry']}>";
  271.                 echo "<input type=hidden name=show value={$_REQUEST['show']}>";
  272.                 echo "<input type=hidden name=next value=$show_next>";
  273.                 echo "<input type=hidden name=edit value=delete>";             
  274.                 echo "<tr bgcolor=#ffffff><td colspan=\"$album_image_colspan\"><input type=submit class=input value=\"click here to delete image\"></td></tr>";
  275.                 echo "</form>";
  276.                 echo "<form enctype=\"multipart\/form-data\" action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">";
  277.                 echo "<input type=hidden name=entry value={$_REQUEST['entry']}>";
  278.                 echo "<input type=hidden name=show value={$_REQUEST['show']}>";
  279.                 echo "<input type=hidden name=edit value=rename>";
  280.                 echo "<tr bgcolor=#ffffff><td colspan=\"$album_image_colspan\"><input type=text autocomplete=off class=input name=filename value={$_REQUEST['show']}></td></tr>";
  281.                 echo "<tr bgcolor=#ffffff><td colspan=\"$album_image_colspan\"><input type=submit class=input value=\"click here to rename image\"></td></tr>";
  282.                 echo "</form>";
  283.                 echo "<form enctype=\"multipart\/form-data\" action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">";
  284.                 echo "<input type=hidden name=entry value={$_REQUEST['entry']}>";
  285.                 echo "<input type=hidden name=show value={$_REQUEST['show']}>";
  286.                 echo "<input type=hidden name=edit value=caption>";
  287.                 echo "<tr bgcolor=#ffffff><td colspan=\"$album_image_colspan\">";
  288.                 echo "<textarea class=input name=caption rows=3>";
  289.                 if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
  290.                         $caption_get = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
  291.                         $caption_get = str_replace('<br />', "\n", $caption_get);
  292.                         $caption_get = str_replace('<img src="images/smileys/crying.png" border="0">', ':((', $caption_get);
  293.                         $caption_get = str_replace('<img src="images/smileys/frown.png" border="0">', ':(', $caption_get);
  294.                         $caption_get = str_replace('<img src="images/smileys/indifferent.png" border="0">', ':|', $caption_get);
  295.                         $caption_get = str_replace('<img src="images/smileys/laughing.png" border="0">', ':D', $caption_get);
  296.                         $caption_get = str_replace('<img src="images/smileys/lick.png" border="0">', ':P', $caption_get);
  297.                         $caption_get = str_replace('<img src="images/smileys/ohno.png" border="0">', ':O', $caption_get);
  298.                         $caption_get = str_replace('<img src="images/smileys/smile.png" border="0">', ':)', $caption_get);
  299.                         $caption_get = str_replace('<img src="images/smileys/surprised.png" border="0">', '=)', $caption_get);
  300.                         $caption_get = str_replace('<img src="images/smileys/undecided.png" border="0">', ':\\', $caption_get);
  301.                         $caption_get = str_replace('<img src="images/smileys/wink.png" border="0">', ';)', $caption_get);
  302.                         $caption_get = str_replace('<span style="background-color: #ffff00;">', '<highlight>', $caption_get);
  303.                         $caption_get = str_replace('</span>', '</highlight>', $caption_get);
  304.                         echo $caption_get;
  305.                 }
  306.                 echo "</textarea>";
  307.                 echo "<input type=submit class=input value=\"click here to update caption\">";
  308.                 echo "</td></tr></form>";
  309.         }
  310.         if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
  311.                 if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt")) {
  312.                         echo "<tr bgcolor=\"#ffffff\"><td colspan=\"$album_image_colspan\" width=\"$album_image_width\">";
  313.                         $caption_get = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$_REQUEST['show']}.txt");
  314.                         echo $caption_get;
  315.                         echo "</td></tr>";
  316.                 }
  317.         }
  318.  
  319.         echo "</table>";
  320.  
  321.         echo "</td><td rowspan=\"3\" width=\"10\"></td><td valign=\"top\" rowspan=\"3\">";
  322.  
  323.         //if(isset($album_image_info['APP13'])) {
  324.         //
  325.         //      $album_image_iptc = iptcparse($album_image_info['APP13']);
  326.         //
  327.         //      foreach (array_keys($album_image_iptc) as $album_image_iptc_array) {
  328.         //
  329.         //              $c = count($album_image_iptc[$album_image_iptc_array]);
  330.         //
  331.         //              for ($i=0; $i <$c; $i++) {
  332.         //                      echo $album_image_iptc_array . ' = ' . $album_image_iptc[$album_image_iptc_array][$i] .'<br>';
  333.         //              }
  334.         //      }
  335.         //}
  336.  
  337.         $album_image_exif = exif_read_data("images/{$_REQUEST['entry']}/album/{$_REQUEST['show']}", 0, true);
  338.        
  339.         foreach ($album_image_exif as $album_image_exif_key => $album_image_exif_section) {
  340.                
  341.                 foreach ($album_image_exif_section as $album_image_exif_name => $album_image_exif_value) {
  342.                        
  343.                         $album_image_exif_value = strip_tags($album_image_exif_value);
  344.  
  345.                         if ((($album_image_exif_key == "EXIF") or ($album_image_exif_key == "IFD0")) and !empty($album_image_exif_value) and ($album_image_exif_name != "MakerNote") and ($album_image_exif_name != "ComponentsConfiguration") and ($album_image_exif_name != "FileSource") and ($album_image_exif_name != "SceneType") and ($album_image_exif_name != "CFAPattern")) {
  346.                                 echo "<nobr>$album_image_exif_name: $album_image_exif_value</nobr><br>";
  347.                         }
  348.                 }
  349.         }
  350.  
  351.         echo "</td></tr><tr><td height=\"10\"></td></tr><tr><td valign=\"top\">";
  352.  
  353.         echo "<table cellspacing=1 cellpadding=2 border=0 bgcolor=#cccccc><tr bgcolor=#ffffff><td width=100%><p><b>Album</b></p></td></tr><tr bgcolor=#ffffff><td width=100%>";
  354.  
  355.         if (file_exists("images/{$_REQUEST['entry']}/thumbnails")) {
  356.                 if ($dh_album = opendir("images/{$_REQUEST['entry']}/thumbnails")) {
  357.                         while (($thumbnail_album = readdir($dh_album)) !== false) {
  358.                                 if ($thumbnail_album != "." && $thumbnail_album != ".." && fnmatch("*",$thumbnail_album)) {
  359.                                         $current_thumbnail = "images/{$_REQUEST['entry']}/thumbnails/$thumbnail_album";
  360.                                         $parent_image = str_replace("-thumbnail.jpg","",$thumbnail_album);
  361.                                         $parent_image = "images/{$_REQUEST['entry']}/album/$parent_image";
  362.                                         if (file_exists($current_thumbnail) and !file_exists($parent_image)) {
  363.                                                 unlink($current_thumbnail);
  364.                                         }
  365.                                 }
  366.                         }
  367.                 }
  368.         }
  369.        
  370.         if ($count_album_entry < 1) {
  371.                 rmdirr("images/{$_REQUEST['entry']}/album");
  372.                 rmdirr("images/{$_REQUEST['entry']}/thumbnails");                              
  373.         }
  374.         else {
  375.                 foreach($sort_album as $album_entry) {
  376.                         $current_image = "images/{$_REQUEST['entry']}/album/$album_entry";
  377.                         $current_image_size = getimagesize($current_image);
  378.                         $current_width = $current_image_size[0];
  379.                         $current_height = $current_image_size[1];
  380.                         $max_width = 98;
  381.                         $max_height = 73;
  382.        
  383.                         if (($current_width > $max_width) || ($current_height > $max_height)) {  
  384.  
  385.                                 if ($current_height > $current_width) {
  386.                                         $sizefactor = (double) ($max_height / $current_height);
  387.                                 }
  388.                                 else {
  389.                                         $sizefactor = (double) ($max_width / $current_width) ;
  390.                                 }
  391.  
  392.                                 $new_width = (int) ($current_width * $sizefactor);
  393.                                 $new_height = (int) ($current_height * $sizefactor);
  394.                         }
  395.                         else {
  396.                                 $new_width = $current_width;
  397.                                 $new_height = $current_height;
  398.                         }
  399.  
  400.                         if (!file_exists("images/{$_REQUEST['entry']}/thumbnails/{$album_entry}-thumbnail.jpg")) {
  401.        
  402.                                 $work_thumb = imagecreatetruecolor($new_width,$new_height);
  403.                                 $get_mimetype = image_type_to_mime_type(exif_imagetype($current_image));
  404.  
  405.                                 switch($get_mimetype) {
  406.                                         case "image/jpg":
  407.                                         case "image/jpeg":
  408.                                                 $work_image = imagecreatefromjpeg($current_image);
  409.                                                 break;
  410.                                         case "image/gif":
  411.                                                 $work_image = imagecreatefromgif($current_image);
  412.                                                 break;
  413.                                         case "image/png":
  414.                                                 $work_image = imagecreatefrompng($current_image);
  415.                                                 break;
  416.                                 }
  417.        
  418.                                 imagecopyresampled($work_thumb,$work_image,0,0,0,0,$new_width,$new_height,$current_width,$current_height);
  419.        
  420.                                 if (!file_exists("images/{$_REQUEST['entry']}/thumbnails")) {
  421.                                         mkdir("images/{$_REQUEST['entry']}/thumbnails");
  422.                                 }
  423.        
  424.                                 imagejpeg($work_thumb,"images/{$_REQUEST['entry']}/thumbnails/{$album_entry}-thumbnail.jpg",80);
  425.  
  426.                                 imagedestroy($work_thumb);
  427.                                 imagedestroy($work_image);
  428.                         }
  429.  
  430.                         echo "<a href=\"album.php?entry={$_REQUEST['entry']}&show=$album_entry\">";
  431.  
  432.                         if (!file_exists("images/{$_REQUEST['entry']}/thumbnails/{$album_entry}-thumbnail.jpg")) {
  433.                                 echo "<img src=\"images/{$_REQUEST['entry']}/album/$album_entry\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
  434.                         }
  435.                         else {
  436.                                 echo "<img src=\"images/{$_REQUEST['entry']}/thumbnails/{$album_entry}-thumbnail.jpg\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
  437.                         }
  438.  
  439.                         if (file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$album_entry}.txt")) {
  440.                                 echo ' alt="';
  441.                                 $img_alt = file_get_contents("data/items/{$_REQUEST['entry']}/album/captions/{$album_entry}.txt");
  442.                                 $img_alt = strip_tags($img_alt);
  443.                                 echo $img_alt;
  444.                                 echo '"';
  445.                         }
  446.                         echo "></a>";
  447.                 }
  448.         }      
  449.  
  450.         echo "</td></tr><form method=post action=index.php?entry={$_REQUEST['entry']}&show=album><tr bgcolor=#ffffff><td><input class=input type=submit value=\"click here to go to the main entry\"></td></tr></form><form method=post action=index.php><tr bgcolor=#ffffff><td><input class=input type=submit value=\"click here to go to the index page\"></td></tr></form></table>";
  451.  
  452.         echo "</td></tr></table>";
  453. }
  454.  
  455. if ($key_prev >= 0) {
  456.         echo "\n\n<script>\n\tvar img_prev = new Image();\n\timg_prev.src = \"images/{$_REQUEST['entry']}/album/$show_prev\";\n</script>";
  457. }
  458.  
  459. if ($key_next < $count_album_entry) {
  460.         echo "\n\n<script>\n\tvar img_next = new Image();\n\timg_next.src = \"images/{$_REQUEST['entry']}/album/$show_next\";\n</script>";
  461. }
  462.  
  463. ?>
  464.  
Credits
Sunday, Sep 18, 2005, 12:00 AM (Revision 11 - Thursday, Jul 14, 2011, 7:30 PM)
Open Source enables software developers to stand on the shoulders of giants instead of reinventing the wheel, so to speak. Kudos and many thanks to the folks who made their work freely available for reuse in MAJ.

read more
Bugs and Exploits
Friday, Aug 26, 2005, 12:00 AM (Revision 23 - Wednesday, May 29, 2013, 5:25 AM)
Although MAJ started as a family project, care has been taken to make it as "safe" as possible. With more people now working on MAJ, bugs and exploitable code may sometimes slip in. We invite you to poke around and see if you can find any. Generally, there are two things you can do when you find a MAJ or PHP-related bug or exploit:

1. Take advantage of it. But hey, what's so exciting about messing up someone's blog? Ho-hum, right?
2. Report it here so that we can work on a fix and make MAJ better.

read more
Search
Download
MAJ 2.0
75 files
33449 downloads
MAJ 1.0
26 files
13526 downloads
MAJ 0.14
45 files
35642 downloads