\n";
closetable();
} else {
$result = dbquery("SELECT * FROM ".$db_prefix."submissions WHERE submit_type='l' ORDER BY submit_datestamp DESC");
if (dbrows($result) != "0") {
while ($data = dbarray($result)) {
$submit_criteria = unserialize($data['submit_criteria']);
$links .= "\n".$submit_criteria['link_name']."
".$locale['417']." |
".$locale['418']." \n \n";
}
} else {
$links = "\n".$locale['414']." \n \n";
}
$result = dbquery("SELECT * FROM ".$db_prefix."submissions WHERE submit_type='n' ORDER BY submit_datestamp DESC");
if (dbrows($result) != "0") {
while ($data = dbarray($result)) {
$submit_criteria = unserialize($data['submit_criteria']);
$news .= "\n".$submit_criteria['news_subject']."
".$locale['417']." |
".$locale['418']." \n \n";
}
} else {
$news = "\n".$locale['415']." \n \n";
}
$result = dbquery("SELECT * FROM ".$db_prefix."submissions WHERE submit_type='a' ORDER BY submit_datestamp DESC");
if (dbrows($result) != "0") {
while ($data = dbarray($result)) {
$submit_criteria = unserialize($data['submit_criteria']);
$articles .= "\n".$submit_criteria['article_subject']."
".$locale['417']." |
".$locale['418']." \n \n";
}
} else {
$articles = "\n".$locale['416']." \n \n";
}
$result = dbquery("SELECT * FROM ".$db_prefix."submissions WHERE submit_type='p' ORDER BY submit_datestamp DESC");
if (dbrows($result) != "0") {
while ($data = dbarray($result)) {
$submit_criteria = unserialize($data['submit_criteria']);
$photos .= "\n".$submit_criteria['photo_title']."
".$locale['417']." |
".$locale['418']." \n \n";
}
} else {
$photos = "\n".$locale['420']." \n \n";
}
opentable($locale['410']);
echo "
".$locale['411']."
$links
".$locale['412']."
$news
".$locale['413']."
$articles
".$locale['419']."
$photos
\n";
closetable();
}
}
if ($stage == "2" && $t == "l") {
if (isset($_POST['add'])) {
$link_name = stripinput($_POST['link_name']);
$link_url = stripinput($_POST['link_url']);
$link_description = stripinput($_POST['link_description']);
$result = dbquery("INSERT INTO ".$db_prefix."weblinks (weblink_name, weblink_description, weblink_url, weblink_cat, weblink_datestamp, weblink_count) VALUES ('$link_name', '$link_description', '$link_url', '".$_POST['link_category']."', '".time()."', '0')");
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
opentable($locale['430']);
echo " \n";
closetable();
} else if (isset($_POST['delete'])) {
opentable($locale['432']);
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
echo " \n";
closetable();
} else {
$opts = "";
$result = dbquery("SELECT * FROM ".$db_prefix."weblink_cats ORDER BY weblink_cat_name");
if (dbrows($result) != 0) {
while($data = dbarray($result)) $opts .= "".$data['weblink_cat_name']." \n";
} else {
$opts .= "".$locale['434']." \n";
}
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$posted = showdate("longdate", $data['submit_datestamp']);
opentable($locale['440']);
echo "\n";
closetable();
}
}
if ($stage == "2" && $t == "n") {
if (isset($_POST['publish'])) {
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$news_subject = stripinput($_POST['news_subject']);
$news_cat = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$news_body = addslash($_POST['news_body']);
$news_breaks = ($_POST['news_breaks'] == "y") ? "y" : "n";
$result = dbquery("INSERT INTO ".$db_prefix."news (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_visibility, news_reads, news_allow_comments, news_allow_ratings) VALUES ('$news_subject', '$news_cat', '$news_body', '', '$news_breaks', '".$data['user_id']."', '".time()."', '0', '0', '0', '0', '1', '1')");
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
opentable($locale['490']);
echo " \n";
closetable();
} else if (isset($_POST['delete'])) {
opentable($locale['492']);
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
echo " \n";
closetable();
} else {
if ($settings['tinymce_enabled'] == 1) echo "\n";
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$news_subject = $submit_criteria['news_subject'];
$news_cat = $submit_criteria['news_cat'];
$news_body = phpentities(stripslashes($submit_criteria['news_body']));
$news_breaks = $submit_criteria['news_breaks'];
$news_cat_opts = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_name");
if (dbrows($result2)) {
while ($data2 = dbarray($result2)) {
if (isset($news_cat)) $sel = ($news_cat == $data2['news_cat_id'] ? " selected" : "");
$news_cat_opts .= "".$data2['news_cat_name']." \n";
}
}
opentable($locale['500']);
echo "\n";
closetable();
}
}
if ($stage == "2" && $t == "a") {
if (isset($_POST['publish'])) {
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$article_cat = $_POST['article_cat'];
$article_subject = $_POST['article_subject'];
$article_snippet = addslash($_POST['article_snippet']);
$article_body = addslash($_POST['article_body']);
$article_breaks = ($_POST['article_breaks'] == "y") ? "y" : "n";
$result = dbquery("INSERT INTO ".$db_prefix."articles (article_cat, article_subject, article_snippet, article_article, article_breaks, article_name, article_datestamp, article_reads, article_allow_comments, article_allow_ratings) VALUES ('$article_cat', '$article_subject', '$article_snippet', '$article_body', '$article_breaks', '".$data['user_id']."', '".time()."', '0', '1', '1')");
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
opentable($locale['530']);
echo " \n";
closetable();
} else if (isset($_POST['delete'])) {
opentable($locale['532']);
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
echo " \n";
closetable();
} else {
if ($settings['tinymce_enabled'] == 1) echo "\n";
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$article_cat = $submit_criteria['article_cat'];
$article_subject = $submit_criteria['article_subject'];
$article_snippet = phpentities(stripslashes($submit_criteria['article_snippet']));
$article_body = phpentities(stripslashes($submit_criteria['article_body']));
$article_breaks = $submit_criteria['article_breaks'];
$result2 = dbquery("SELECT * FROM ".$db_prefix."article_cats ORDER BY article_cat_name DESC");
$article_cat_opts = ""; $sel = "";
while ($data2 = dbarray($result2)) {
if (isset($article_cat)) $sel = ($article_cat == $data2['article_cat_id'] ? " selected" : "");
$article_cat_opts .= "".$data2['article_cat_name']." \n";
}
opentable($locale['540']);
echo "
\n";
closetable();
}
}
if ($stage == "2" && $t == "p") {
if (isset($_POST['publish'])) {
define("SAFEMODE", @ini_get("safe_mode") ? true : false);
require_once INCLUDES."photo_functions_include.php";
$photo_file = ""; $photo_thumb1 = ""; $photo_thumb2 = "";
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$photo_title = stripinput($_POST['photo_title']);
$photo_description = stripinput($_POST['photo_description']);
$album_id = isNum($_POST['album_id']) ? $_POST['album_id'] : "0";
$photo_name = strtolower(substr($submit_criteria['photo_file'], 0, strrpos($submit_criteria['photo_file'], ".")));
$photo_ext = strtolower(strrchr($submit_criteria['photo_file'],"."));
$photo_dest = PHOTOS.(!SAFEMODE ? "album_".$album_id."/" : "");
$photo_file = image_exists($photo_dest, $photo_name.$photo_ext);
copy(PHOTOS."submissions/".$submit_criteria['photo_file'], $photo_dest.$photo_file);
chmod($photo_dest.$photo_file, 0644);
unlink(PHOTOS."submissions/".$submit_criteria['photo_file']);
$imagefile = @getimagesize($photo_dest.$photo_file);
$photo_thumb1 = image_exists($photo_dest, $photo_name."_t1".$photo_ext);
createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb1, $settings['thumb_w'], $settings['thumb_h']);
if ($imagefile[0] > $settings['photo_w'] || $imagefile[1] > $settings['photo_h']) {
$photo_thumb2 = image_exists($photo_dest, $photo_name."_t2".$photo_ext);
createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb2, $settings['photo_w'], $settings['photo_h']);
}
$photo_order = dbresult(dbquery("SELECT MAX(photo_order) FROM ".$db_prefix."photos WHERE album_id='$album_id'"), 0) + 1;
$result = dbquery("INSERT INTO ".$db_prefix."photos (album_id, photo_title, photo_description, photo_filename, photo_thumb1, photo_thumb2, photo_datestamp, photo_user, photo_views, photo_order, photo_allow_comments, photo_allow_ratings) VALUES ('$album_id', '$photo_title', '$photo_description', '$photo_file', '$photo_thumb1', '$photo_thumb2', '".time()."', '".$data['submit_user']."', '0', '$photo_order', '1', '1')");
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
opentable($locale['580']);
echo " \n";
closetable();
} else if (isset($_POST['delete'])) {
opentable($locale['582']);
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'"));
$submit_criteria = unserialize($data['submit_criteria']);
@unlink(PHOTOS."submissions/".$submit_criteria['photo_file']);
$result = dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_id='$submit_id'");
echo " \n";
closetable();
} else {
$data = dbarray(dbquery(
"SELECT ts.*, user_id,user_name FROM ".$db_prefix."submissions ts
LEFT JOIN ".$db_prefix."users tu ON ts.submit_user=tu.user_id
WHERE submit_id='$submit_id'"
));
$submit_criteria = unserialize($data['submit_criteria']);
$photo_title = $submit_criteria['photo_title'];
$photo_description = $submit_criteria['photo_description'];
$photo_file = $submit_criteria['photo_file'];
$album_id = $submit_criteria['album_id'];
$photo_albums = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."photo_albums ORDER BY album_title");
if (dbrows($result2)) {
while ($data2 = dbarray($result2)) {
if (isset($album_id)) $sel = ($album_id == $data2['album_id'] ? " selected" : "");
$photo_albums .= "".$data2['album_title']." \n";
}
}
opentable($locale['500']);
echo "
\n";
closetable();
}
}
echo "\n";
require_once BASEDIR."footer.php";
?>