if ($_GET['stype'] == "l") {
if (isset($_POST['submit_link'])) { if ($_POST['link_name'] != "" && $_POST['link_url'] != "" && $_POST['link_description'] != "" && $_POST['link_land'] != "" && $_POST['link_state'] != "" && $_POST['link_city'] != "" ) {
$submit_info['link_category'] = stripinput($_POST['link_category']);
$submit_info['link_name'] = stripinput($_POST['link_name']);
$submit_info['link_url'] = stripinput($_POST['link_url']);
$submit_info['link_description'] = stripinput($_POST['link_description']);
$submit_info['link_land'] = stripinput($_POST['link_land']);
$submit_info['link_state'] = stripinput($_POST['link_state']);
$submit_info['link_city'] = stripinput($_POST['link_city']);
////////////////////////////////////17.02.2015 Добавление параметров
$photo_types = array(".gif",".jpg",".jpeg",".png"); $photo_pic = $_FILES['link_logo'];
$photo_dest = PHOTOS."motoclubs/";
if (!preg_match("/^[-0-9A-Z_\[\]]+$/i", $photo_name)) { $error = 1;
} elseif ($photo_pic['size'] > 50000){
$error = 2;
} elseif (!in_array($photo_ext, $photo_types)) { $error = 3;
} else {
$photo_file = image_exists($photo_dest, $photo_name.$photo_ext);
chmod($photo_dest.$photo_file, 0644); if (!verify_image($photo_dest.$photo_file)) {
$error = 3;
unlink($photo_dest.$photo_file); } elseif ($imagefile[0] > 100 || $imagefile[1] > 100) {
$error = 4;
unlink($photo_dest.$photo_file); } else {
$submit_info['photo_file'] = $photo_file;
}
}
}
/////////////////////
$result = dbquery
("INSERT INTO ".DB_SUBMISSIONS
." (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES ('l', '".$userdata['user_id']."', '".time()."', '".addslashes(serialize($submit_info))."')"); add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
echo "<div style='text-align:center'><br />\n".$locale['410']."<br /><br />\n";
echo "<a href='submit.php?stype=l'>".$locale['411']."</a><br /><br />\n";
echo "<a href='index.php'>".$locale['412']."</a><br /><br />\n</div>\n";
closetable();
}
} else {
$opts = "";
add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
$result = dbquery("SELECT weblink_cat_id, weblink_cat_name FROM ".DB_WEBLINK_CATS." WHERE ".groupaccess("weblink_cat_access")." ORDER BY weblink_cat_name");
if (dbrows($result)) {
while ($data = dbarray($result)) {
$opts .= "<option value='".$data['weblink_cat_id']."'>".$data['weblink_cat_name']."</option>\n";
}
echo "<div class='submission-guidelines'>".$locale['420']."</div>\n";
echo "<form name='submit_form' method='post' action='".FUSION_SELF."?stype=l' onsubmit='return validateLink(this);'>\n";
echo "</br><table cellpadding='0' cellspacing='0' class='center'>\n";
echo "<tr>\n<td class='tbl'>".$locale['421']."</td>\n";
echo "<td class='tbl'><select name='link_category' class='textbox'>\n$opts</select></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['422']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_name' maxlength='100' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['423']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_url' value='http://' maxlength='200' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['424']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_description' maxlength='200' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n";
////////////////////////////////////17.02.2015 Добавление параметров
echo "<tr>\n";
echo "<td class='tbl'>".$locale['4250']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_land' maxlength='100' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['4251']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_state' maxlength='200' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['4252']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='link_city' maxlength='200' class='textbox' style='width:300px;' /></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='tbl' style='width:80px; vertical-align:top;'>".$locale['686']."<span style='color:#ff0000'>*</span></td>\n<td class='tbl' style='vertical-align:top;'>\n";
echo "<input type='file' name='link_logo' class='textbox' style='width:150px;' /><br />\n";
echo sprintf($locale['4253'])."<br />\n"; echo "</td>\n";
echo "</tr>\n";
////////////////////////////////////////
echo "<tr>\n";
echo "<td align='center' colspan='2' class='tbl'><br />\n";
echo "<input type='submit' name='submit_link' value='".$locale['425']."' class='button' />\n</td>\n";
echo "</tr>\n</table>\n</form>\n";
} else {
echo "<div style='text-align:center'><br />\n".$locale['551']."<br /><br />\n</div>\n";
}
closetable();
}