Example #1
0
        exit;
    }
    // check mailpost permission by group
    if (!isset($_tempGperm['allow_mailpost'][$req_uid])) {
        redirect_header(XOOPS_URL . '/index.php', 2, _MD_NOPERM_MAILPOST);
        exit;
    }
} else {
    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NOPERM_MAILPOST);
    exit;
}
$reg_time = '';
$allow_regdate = !empty($_tempGperm['allow_regdate']) ? isset($_tempGperm['allow_regdate'][$uid]) : false;
//$mPost->_err_msg .= $func->getpost_param('reg_time');
if ($allow_regdate == true && $func->getpost_param('reg_time')) {
    $reg_time = d3diary_reg_time($func->getpost_param('published'));
}
$connected = 0;
// check setting
if ($mpost_step >= 1) {
    // check mailpost manual use setting
    if ($dcfg->mailpost < 1 || $dcfg->mailpost > 2) {
        redirect_header(XOOPS_URL . '/modules/' . $mydirname . '/index.php?page=usr_config' . $query_req_uid, 2, _MD_NOSET_MAILMANUAL);
        exit;
    }
    if ($mPost->check_settings() == true) {
        // connect to server
        $connected = $mPost->connect();
    }
}
// define Template
Example #2
0
function d3diary_showform($mydirname){
	global $photoObj, $diary, $xoopsOption, $func, $myts, $mPerm, $gPerm, $eparam, $d3diary_header ;
	global $yd_data, $del_pname, $form_photos, $_oe, $mod_config;

		$yd_data['bid'] = $diary->bid;
		$yd_data['uid'] = $diary->uid;

	// preview or photodel
	if( $eparam['is_prev']==1 ){
		$yd_data['cid']=$func->getpost_param('cid');
		if($yd_data['cid']>0){
			$category =& D3diaryCategory::getInstance();
			$category->uid = $diary->uid;
			$category->cid = intval($yd_data['cid']);
			$category->readdb($mydirname);
			$yd_data['cname'] = htmlSpecialChars($category->cname, ENT_QUOTES);
		}else{
			$yd_data['cname'] = htmlSpecialChars($myts->stripslashesGPC($func->getpost_param('cname')), ENT_QUOTES);
		}
		$yd_data['title'] = htmlSpecialChars($myts->stripslashesGPC($func->getpost_param('title')), ENT_QUOTES);
		$yd_data['openarea'] = $func->getpost_param('openarea');
		$yd_data['dohtml'] = $func->getpost_param('dohtml');
		$yd_data['update_ping'] = intval($func->getpost_param('update_ping'));

		$yd_data['diary'] = $func->stripPb_Tarea($myts->stripslashesGPC($func->getpost_param('diary')), $yd_data['dohtml']);
		$yd_data['diary4edit']= htmlSpecialChars($myts->stripslashesGPC($func->getpost_param('diary')), ENT_QUOTES);

	} else {
		$yd_data['cid'] = $diary->cid;
		$yd_data['title'] = htmlSpecialChars($diary->title, ENT_QUOTES);
		$yd_data['diary'] = $yd_data['diary4edit'] =htmlSpecialChars($diary->diary, ENT_QUOTES);
		$yd_data['openarea']=$diary->openarea;	// naao added
		$yd_data['dohtml'] = $diary->dohtml;
	}

	if ($func->getpost_param('reg_time')) {	//post by specified time
		$yd_data['reg_time']   = 1;
		d3diary_reg_time();
		$tmp_time = $yd_data['create_time_unformat'];
	} elseif(!empty($diary->create_time)){		//existing posted time
		$yd_data['create_time']   = $diary->create_time;
		$ctime = preg_split("/[-: ]/", $diary->create_time);
		$tmp_time = mktime($ctime[3],$ctime[4],$ctime[5],$ctime[1],$ctime[2],$ctime[0]);
		$yd_data['create_time_unformat'] = $tmp_time;
	} else {
		$tmp_time = time();
	}
		$week = intval($func->myformatTimestamp($tmp_time, "w"));
		$yd_data['year']   = $func->myformatTimestamp($tmp_time, "Y");
		$yd_data['month']   = intval($func->myformatTimestamp($tmp_time, "m"));
		$yd_data['day']   = intval($func->myformatTimestamp($tmp_time, "d"));
		$yd_data['time']   = $func->myformatTimestamp($tmp_time, "H:i");

		list( $arr_weeks, $arr_monthes, $arr_dclass, $arr_wclass ) = $func->initBoxArr();
		$yd_data['week'] = $arr_weeks [$week];
		$yd_data['b_month'] = $arr_monthes [$yd_data['month'] -1];
		$yd_data['dclass'] = $arr_dclass [$week];
		$yd_data['wclass'] = $arr_wclass [$week];

		$yd_data['group_list'] = array();
		$_oe = (int)$mod_config['use_open_entry'];
		if( $_oe == 10 || $_oe == 20 ) {
			$g_selcted = explode( "|", trim( $diary->vgids ,"|" ) );
			$group_list = array();
			foreach ( $gPerm->group_list as $_gid => $_name) {
		    	    if($_gid >= 4 && (in_array($_gid, $mPerm->mygids) || $mPerm->isadmin)){
				$group_list[$_gid]['gname'] = $_name;
				$group_list[$_gid]['gsel'] = (in_array( $_gid, $g_selcted )) ? 1 : 0;
			    }
			}
			$yd_data['group_list'] = $group_list;
		}

		if( $_oe == 20 ) {
			$p_selcted = array_map("intval", explode( "|", trim( $diary->vpids ,"|" )) );
			$pperm_list = implode( "," , $p_selcted ) ;
			$yd_data['pperm_list'] = $pperm_list;
			$unames = array(); $names = array();

			foreach ($p_selcted as $vpid) {
				if( $vpid >1 ) {
					$rtn = $func->get_xoopsuname($vpid);
					$uname = $rtn['uname'];
					$name = (!empty($rtn['name'])) ? $rtn['name'] : "" ;
					$unames[] = htmlspecialchars( $uname.'['.$vpid.'] ', ENT_QUOTES );
					$names[] = htmlspecialchars( $name.'['.$vpid.'] ', ENT_QUOTES );
				}
			}
			if( $mod_config['use_name'] == 1 ) {
				$yd_data['pperm_names'] = $names;
			} else {
				$yd_data['pperm_names'] = $unames;
			}
		}
}