"PHP" / Говнокод #6142 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
if (is_dir($read_dir)) {
	if ($open_dir = @opendir($read_dir)) {
		while (false !== ($dir_temp = readdir($open_dir))){
			if ($dir_temp != "." && $dir_temp != ".." && is_dir($read_dir.'/'.$dir_temp) && $filtre == '') {
				if(!(file_exists("../templates/".$dir_temp."/parameter/info.php"))) {
					echo messStop(LG_DIR.' ' . $dir_temp . ' '.LG_MOD_ERROR_IS_FILE_);
				} else {
					require("../templates/".$dir_temp."/parameter/info.php");
					echo "<tr><td>";
					if(!(file_exists("../templates/".$dir_temp."/parameter/previews.jpg"))) {
						echo "<a href=\"?am=mod[template]&template=[edit]&name=$dir_temp\" OnMouseOver=\"Tip('<img width="175" src="../images/all/no_prewies.png" >')\" />$temp_name</a>";
					} else {
						echo "<a href=\"?am=mod[template]&template=[edit]&name=$dir_temp\" OnMouseOver=\"Tip('<img width="175" src="../templates/$dir_temp/parameter/previews.jpg" >')\" />$temp_name</a>";
					}
					echo "</td><td>$temp_version</td><td>$temp_date</td><td>$temp_autor</td></tr>";
				}
			} elseif ($dir_temp != "." && $dir_temp != ".." && is_dir($read_dir.'/'.$dir_temp) && $dir_temp == $filtre) {
				if(!(file_exists("../templates/".$dir_temp."/parameter/info.php"))) {
					echo messStop(LG_DIR.' ' . $dir_temp . ' '.LG_MOD_ERROR_IS_FILE_);
				} else {
					require("../templates/".$dir_temp."/parameter/info.php");
					echo "<tr><td>";
					if(!(file_exists("../templates/".$dir_temp."/parameter/previews.jpg"))) {
						echo "<a href=\"?am=mod[template]&template=[edit]&name=$dir_temp\" OnMouseOver=\"Tip('<img width="175" src="../images/all/no_prewies.png" >')\" />$temp_name</a>";
					} else {
						echo "<a href=\"?am=mod[template]&template=[edit]&name=$dir_temp\" OnMouseOver=\"Tip('<img width="175" src="../templates/$dir_temp/parameter/previews.jpg" >')\" />$temp_name</a>";
					}
					echo "</td><td>$temp_version</td><td>$temp_date</td><td>$temp_autor</td></tr>";
				}
			} elseif(!is_dir($read_dir.'/'.$filtre) && $filtre != '' && $filtre != $dir_temp) {
				$returnMessWarn = messSearch(LG_ERR_FILTRE_NULL);
			}
		}
	closedir($open_dir);
	}
}

Данный код выводит списком шаблоны от системы.... Самое страшное, когда спустя некоторое время, со свежими мозгами потребовалось усовершенствовать всё это, в итоге проблема решилась просто, всё переписатьс нуля по человечески.

Запостил: nethak nethak, (Updated )

Комментарии (1) RSS

  • >> всё переписать с нуля по человечески. - А это очень частый метод решения проблем, если наткнулся на ГК! =)
    Ответить

Добавить комментарий

Переведи на "PHP", guest!

    А не использовать ли нам bbcode?


    8