function LOAD_MEDIA_RSS($t) { global $root; $folder = treat_string($t); $arr = search_folder($root . "user/uploads/" . $folder); if (!$arr) { echo "No files to display"; } else { foreach ($arr as $value) { $type = detect_type($value); $path = $folder . "/" . $value; show_media_rss($type, $path); } } }
function FILE_LOAD($file) { global $root, $entry_title; $path = $root . "user/uploads/" . treat_string($entry_title) . "/{$file}"; if (is_file($path)) { show_media(detect_type($file), treat_string($entry_title) . "/{$file}"); } }
debug(mysql_error(), 1); } if (mysql_num_rows($data) > 0) { while ($e = mysql_fetch_array($data)) { $entry_id = $e["entry_id"]; $entry_title = $e["entry_title"]; $entry_text = $e["entry_text"]; $entry_client = $e["entry_client"]; $entry_extra1 = $e["entry_extra1"]; $entry_extra2 = $e["entry_extra2"]; $entry_new = $e["entry_new"]; $entry_show = $e["entry_show"]; $entry_hits = $e["hits"]; $dirpath = $root . "user/uploads/" . treat_string($entry_title); if (is_dir($dirpath)) { $path = treat_string($entry_title); } else { debug("No folder connected to the entry found, creating one", 0); if (!mkdir($dirpath)) { debug("Failed to create content folder", 1); } } $full_path = $dirpath . "/"; if (is_file($dirpath . "/layout.php")) { $layout = "Edit custom layout"; } else { $layout = "Add custom layout"; } debug("Ending debug", 0); debug_echo(); ?>
error_reporting(0); require "_headr.php"; if ($_SESSION["password"] != $pass || $_SESSION["sessid"] != session_id()) { die(logout()); } debug("Password validated, logged in", 0); $entry_title = $_REQUEST["entry_title"]; $entry_text = $_REQUEST["entry_text"]; $entry_date = date("Y-m-d"); $entry_client = $_REQUEST["entry_client"]; $entry_extra1 = $_REQUEST["entry_extra1"]; $entry_extra2 = $_REQUEST["entry_extra2"]; if (strlen($entry_title) < 1) { debug("Entry title is blank", 1); } $newdir = $root . "user/uploads/" . treat_string($entry_title); if (is_dir($newdir)) { debug("Can not create directory at {$newdir}, already a folder with that name", 1); } if (!mkdir($newdir)) { debug("Failed to execute command mkdir({$newdir})", 1); } //set position $entry_p = 0; $content = mysql_query("SELECT e.* FROM core_entries e ORDER BY e.entry_position"); if (mysql_num_rows($content) > 0) { while ($data = mysql_fetch_array($content)) { $p = $data["entry_position"]; if ($p > $entry_p) { $entry_p = $p; }
} else { $isNew = false; } if ($nice_permalinks) { $entry_perma = "{$http}" . $entry_id; } else { $entry_perma = "{$http}" . "?entry={$entry_id}"; } $data_e2t = @mysql_query("SELECT e2t.tag_id FROM core_entry2tag e2t WHERE e2t.entry_id = {$entry_id}"); $tag_str = ""; while ($e2t = @mysql_fetch_array($data_e2t)) { $tag_id = $e2t["tag_id"]; $data_tags = @mysql_query("SELECT t.tag_text FROM core_tags t WHERE t.tag_id = {$tag_id}"); while ($t = @mysql_fetch_array($data_tags)) { $tag_text = $t["tag_text"]; $tag_str = $tag_str . "<a class=\"tag-link\" name=\"tag" . $tag_id . "\" href=\"#tag-" . _encode($tag_text) . "\">" . $tag_text . "</a>" . $separator_tags; } } $entry_tags = substr($tag_str, 0, strlen($tag_str) - strlen($separator_tags)); $layout_path = $root . "user/uploads/" . treat_string($entry_title) . "/layout.php"; if (is_file($layout_path) && @filesize($layout_path) > 0) { require $layout_path; } else { require $theme_path . "parts/entry.php"; } } mysql_query("UPDATE core_entries e SET\n\te.hits = {$entry_hits}\n\tWHERE e.entry_id = {$id}"); } if ($isPerma) { echo "<a class=\"index-link\" href=\"{$http}\">back to index</a>"; }