Microsoft Word(.doc) Microsoft RichText(.doc) Microsoft Excel(.xls) HTML(.htm*) Microsoft Блокнот(.txt) Adobe Acrobat(.pdf)
Название Документа
Размер файл не может превышать 500Kb.
Если Вы не видите кнопку "Browse..." (Обзор), то Ваш броузер не поддерживает прикрепление файлов.
*/?>
}
}
function enter_post($author,$title,$intro,$more,$category,$attach_head="",$attach_shortname="",$attach_type="") {
$sql="INSERT INTO an_news VALUES(NULL,'".$title."','".$intro."','".$more."','".$author."','".$category."','".$attach_head."','".$attach_shortname."','".$attach_type."',CURDATE(),CURTIME())";
mysql_query($sql);
$id=mysql_insert_id();
mysql_query("INSERT INTO an_rates VALUES(".$id.",0)");
}
function display($category,$order="") {
$cat_str="";
if($order=="rates")$order="an_rates.rate DESC";
else $order="an_news.date DESC, an_news.time DESC";
if($category!="")$cat_str="AND \t an_news.category='".$category."'";
if($_REQUEST["action"]=="search" && strlen($_REQUEST["query"])<4){?>
Задан неправильный запрос!
PageFooter();
exit;
}
$sql = "
SELECT
an_news.id,
an_news.title,
an_news.intro,
an_news.date,
DATE_FORMAT(an_news.date,'%d.%m.%Y') as date,
an_news.time,
an_rates.rate,
an_authors.author_name,
an_authors.author_email,
regions.region
FROM an_news,an_rates,an_authors,regions
WHERE
an_news.id=an_rates.id
AND
an_news.author=an_authors.id
AND
an_news.category=regions.code
".$cat_str."
AND
";
if($_REQUEST["action"]=="calendar")$sql.=" an_news.date='".$_REQUEST["aDate"]."' ";
else if($_REQUEST["action"]=="search")$sql.=" an_news.more like '%".Mysql_escape_string(urldecode($_REQUEST["query"]))."%' AND TO_DAYS(an_news.date) BETWEEN TO_DAYS('".$_REQUEST["sYear"]."-".$_REQUEST["sMonth"]."-".$_REQUEST["sDay"]."') AND TO_DAYS('".$_REQUEST["eYear"]."-".$_REQUEST["eMonth"]."-".$_REQUEST["eDay"]."') ";
else $sql.=" (TO_DAYS(NOW())-TO_DAYS(an_news.date)) <= '5' ";
$sql.="\n\tORDER BY ".$order;
//an_news.title like '%".$_REQUEST["query"]."%' OR an_news.intro like '%".$_REQUEST["query"]."%' OR
//echo $sql;
$result = mysql_query($sql);
?>
while($row = mysql_fetch_array($result)) {
$id=$row[0];
$comment_count= mysql_num_rows(mysql_query("select * from an_comments where news = '".$row["id"]."'"));
?>
}
}
function add_comment($id) {
global $HTTP_COOKIE_VARS;
?>
}
function insert_comments ($id,$user_name,$pass,$comments) {
validation_size(strlen($comments));
FireWall($comments);
$data=DBFetch("select * from an_users where user_name = '".$user_name."' and user_password='".$pass."'");
if(count($data)<1){
?>
Неправильное Имя Пользователя!
Нажмите кнопку "НАЗАД" и попробуйте еще раз.
exit;
PageFooter();
}
DBExec("INSERT INTO an_comments VALUES (NULL, '".$id."','".$data[0]["id"]."','".addslashes($comments)."')");
?>
Спасибо за комментарий!
more($id);
show_comments($id);
}
function signup($signup, $user_name, $user_email, $user_password) {
global $HTTP_COOKIE_VARS;
?>
Пожалуйста заполняйте регистрационную форму для добавления комментариев :
}
?>
}
function AuthorRegist($regist,$region,$author_surname,$author_name,$author_login,$author_password1,$author_sex,$author_age,$author_educaon,$author_job,$author_occupaon,$author_languages,$author_experience,$author_hobby,$author_add,$author_email,$author_url,$author_icq){
global $bgcolor_dark,$bgcolor_mid,$bgcolor_ligth,$admin;
?>
if($regist=="enter_author"){
//Insert new author without permission
validation_email($author_email);
validation_name($author_surname.$author_name);
validation_username($author_login);
$sql="insert into an_authors VALUES(NULL, '".addslashes($author_name)." ".addslashes($author_surname)."', '".addslashes($author_email)."', '".addslashes($author_login)."', '".addslashes($author_password1)."', 0, '".addslashes($region)."')";
mysql_query($sql);
//Send Blank to Admin
mail($admin, "New Author Registration for ApsnyNews",
"
region=$region
author_surname=$author_surname
author_name=$author_name
author_login=$author_login
author_password1=$author_password1
author_password2=$author_password2
author_sex=$author_sex
author_age=$author_age
author_educaon=$author_educaon
author_job=$author_job
author_occupaon=$author_occupaon
author_languages=$author_languages
author_experience=$author_experience
author_hobby=$author_hobby
author_add=$author_add
author_email=$author_email
author_url=$author_url
author_icq=$author_icq
",
"From: ".$admin."$SERVER_NAME\nReply-To: bg1205@mail.ru$SERVER_NAME\nX-Mailer: PHP/" . phpversion());
echo "
Спасибо за регистрацию!
";
}
else{
?>
";
}
function AuthorName($id){
$sql="select id,author_name,author_login from an_authors where id=".$id;
$result=mysql_query($sql);
$data=mysql_fetch_array($result);
return $data;
}
function DateForm($date){
$b_months["01"]="Января";
$b_months["02"]="Февраля";
$b_months["03"]="Марта";
$b_months["04"]="Апреля";
$b_months["05"]="Мая";
$b_months["06"]="Июня";
$b_months["07"]="Июля";
$b_months["08"]="Августа";
$b_months["09"]="Сентября";
$b_months["10"]="Октября";
$b_months["11"]="Ноября";
$b_months["12"]="Декабря";
$date_array=explode("-",$date);
$month_id=$date_array[1];
$month=$b_months[$month_id];
$df=$date_array[2]." ".$month." ".$date_array[0]."г.";
return $df;
}
function CheckForms($title,$intro,$more){
$error=0;
$statment="";
if(!$title||!$intro||!$more){
if(!$title){
$statment="
Поле \"Заголовок\" не заполен
\n";
$error=1;
}
elseif(!$intro){
$statment="
Поле \"Обзор\" не заполен
\n";
$error=1;
}
elseif(!$more){
$statment="
Поле \"Подробно\" не заполен
\n";
$error=1;
}
return $statment;
}
}
function RegionSelect($cat_id){
return mysql_fetch_array(mysql_query("SELECT code,region FROM regions WHERE code='".$cat_id."'"));
}
function show_visits($id) {
$sql = "select * from an_rates where id = ".$id;
$result = mysql_query($sql);
$data = mysql_fetch_array($result);
echo "
Количество обращений: ".$data["rate"]."
\n";
}
function genCalendar($year,$month,$day){
global $defavail,$eurl,$fieldname,$formname,$str_common;
$lday=date("w",mktime(0,0,0,$month,0,$year));
$start=$lday;
$mdays=date("t",mktime(0,0,0,$month,1,$year));
$weeks=floor(($mdays+$start)/7)+1;
$all=($weeks*7)-$start;
$from=0-$start;
($formname!="")?$fname=$formname.".".$fieldname:$fname=$fieldname;
setlocale(LC_TIME,"ru_RU.CP1251");
?>