Exemplo n.º 1
0
	$temp_psels = $func->getpost_param('psel');
	$psels = array(); $psel_names = array();
	if (!empty($temp_psels)) {
		foreach ( $temp_psels as $temp_psel ) {
			list( $psels[], $psel_names[] ) = explode( "::", $temp_psel );
		}
	}
	//var_dump($psels); echo "<br><br>"; var_dump($psel_names); echo "<br><br>";

// STEP 2: get registered diary and photos if existed
	if($diary->bid>0){
		$diary->readdb($mydirname);
		if ( $eparam['is_prev'] == 1 ) { $diary->diary = $func->getpost_param('diary'); }
		// get registered photos
		list( $yd_data['photo_num'] , $yd_photo )= d3diary_readdb_photo($mydirname);
		if ( 0 < count($form_photos) ) { d3diary_swap_photoinfo (); }
	} else {
		$yd_data['photo_num'] = 0 ;
		$yd_photo = array() ;
	}

// STEP 3: branch to each processing mode

switch ( $eparam['mode'] ) {

    	// delete photo
    case _D3DIARY_PROCMODE_PHOTODEL :

	if($uid != $req_uid && $diary->bid <= 0){
		redirect_header(XOOPS_URL.'/user.php',2,_MD_NOPERM_EDIT);
		exit();
Exemplo n.º 2
0
//var_dump($psels); echo "<br><br>"; var_dump($psel_names); echo "<br><br>";
// STEP 2: get registered diary and photos if existed
if ($diary->bid > 0) {
    $diary->readdb($mydirname);
    //overrides req_uid
    $req_uid = $diary->uid;
    $rtn = $func->get_xoopsuname($req_uid);
    $uname = $rtn['uname'];
    $name = !empty($rtn['name']) ? $rtn['name'] : "";
    if ($eparam['is_prev'] == 1) {
        $diary->diary = $func->getpost_param('diary');
    }
    // get registered photos
    list($yd_data['photo_num'], $yd_photo) = d3diary_readdb_photo($mydirname);
    if (0 < count($form_photos)) {
        d3diary_swap_photoinfo();
    }
} else {
    $yd_data['photo_num'] = 0;
    $yd_photo = array();
}
// STEP 3: branch to each processing mode
switch ($eparam['mode']) {
    // delete photo
    case _D3DIARY_PROCMODE_PHOTODEL:
        if ($uid != $req_uid && $diary->bid <= 0) {
            redirect_header(XOOPS_URL . '/user.php', 2, _MD_NOPERM_EDIT);
            exit;
        }
        $rtnurl = $d3dConf->urluppr . $d3dConf->urlbase . $d3dConf->url4_all;
        // delete registered photos ( $action == 5 )