Exemplo n.º 1
0
        return ajax_echo('no method:' . $f);
    }
}
if ($f = _get('k')) {
    if ($f != 'edit_article') {
        edit_article();
    }
    if (function_exists($f)) {
        call_user_func($f);
    } else {
        return ajax_echo('no method:' . $f);
    }
}
if ($f = _get('l')) {
    if ($f != 'addarticle') {
        addarticle();
    }
    if (function_exists($f)) {
        call_user_func($f);
    } else {
        return ajax_echo('no method:' . $f);
    }
}
if ($f = _get('m')) {
    if ($f != 'del_comment') {
        del_comment();
    }
    if (function_exists($f)) {
        call_user_func($f);
    } else {
        return ajax_echo('no method:' . $f);
Exemplo n.º 2
0
	}
	else{
		$newname=$newname;
	}

	$arr=array(
	"title"=>$_POST['title'],
	"classname"=>$_POST['classname'],
	"keywords"=>$_POST['keywords'],
	"ar_desc"=>$_POST['ar_desc'],
	"titlepic"=>$newname,
	"subdate"=>date("Y/m/d"),
	"content"=>$_POST['content']
	);
	//print_r($arr);
	addarticle("dw_article",$arr);		
	}
	
//编辑文章
if($act=="editarticle"){
	$id=$_GET['id'];
	$allowext=$allowext=array('jpeg','jpg','png','gif','bmp');
	$fileinfo=$_FILES['titlepic'];
	$sesfile=$_SESSION['titlepic'];	
	//echo "session的值是外围".$newname."<br/>"
//	if($fileinfo!=null)
//	{
//		$newname=uploadfile($fileinfo,'../uploads',$allowext);
//		}
	if($fileinfo['name']==null){
		$arr=array(
Exemplo n.º 3
0
<?php

if (tp('verif') == 1) {
    $id_chapitre = tp('chapitre');
    $titr_article = tp('titre');
    //Check if have same Titre and same Chapitre
    $titr_article_sql = str_replace(' ', '', $titr_article);
    $nbr_article_exist = $db->QuerySingleValue0("select count(id) from article where REPLACE(titre, ' ','') = '{$titr_article_sql}' and  article.id_chapitre = {$id_chapitre}  ");
    if ($nbr_article_exist > 0) {
        exit("3#{$nbr_article_exist}");
    }
    model::load('budget', 'budget');
    if (!addarticle(tp('chapitre'), tp('titre'))) {
        exit("2");
    } else {
        exit("1");
    }
} else {
    view::load('budget', 'addarticle');
}