"yd_uname" => $uname, "yd_name" => $name, "yd_openarea" => intval($d3dConf->dcfg->openarea), "yd_layout" => $yd_layout, "yd_use_friend" => intval($mod_config['use_friend']), "yd_photo_maxsize" => intval($mod_config['photo_maxsize']), "yd_photo_maxpics" => intval($mod_config['photo_maxpics']), "yd_useresize" => intval($mod_config['photo_useresize']), "yd_data" => $yd_data, "yd_photo" => $yd_photo, "popTagArr" => $pop_tags, "myTagArr" => $person_tags, "bTagArr" => $entry_tags, "yd_counter" => $func->get_count_diary($diary->uid), "yd_use_open_entry" => intval($mod_config['use_open_entry']), "catopt" => d3diary_get_category_foredit($mydirname, $req_uid), "mydirname" => $mydirname, "xoops_breadcrumbs" => $breadcrumbs, "xoops_module_header" => $xoopsTpl->get_template_vars( 'xoops_module_header' ).$d3diary_header, "mod_config" => $mod_config, "charset" => _CHARSET, "smilylist" => $smilylist, "allow_edit" => !empty($_tempGperm['allow_edit']) ? isset($_tempGperm['allow_edit'][$uid]) : false, "allow_html" => !empty($_tempGperm['allow_html']) ? isset($_tempGperm['allow_html'][$uid]) : false, "allow_regdate" => !empty($_tempGperm['allow_regdate']) ? isset($_tempGperm['allow_regdate'][$uid]) : false, "gticket_hidden" => $xoopsGTicket->getTicketHtml( __LINE__ , empty( $mod_config['gticket_timeout'] ) ? 1800 : (int)$mod_config['gticket_timeout'] , 'd3diary_edit') )); if(!empty($_tempGperm['allow_gpermission']) && ( $_oe == 10 || $_oe == 20 )) { $xoopsTpl->assign( 'allow_gpermission' , isset($_tempGperm['allow_gpermission'][$uid])); }
$bc_para['mode'] = "edit"; $bc_para['bid'] = $yd_data['bid']; $bc_para['title'] = $yd_data['title']; $bc_para['bc_name'] = constant('_MD_DIARY_EDIT'); $breadcrumbs = $func->get_breadcrumbs($req_uid, $bc_para['mode'], $bc_para); // header ~ assign $xoopsOption['template_main'] = $mydirname . '_edit.html'; include XOOPS_ROOT_PATH . "/header.php"; // this page uses smarty template // this must be set before including main header.php $_temp_preview = $func->getpost_param('preview'); if (!empty($_temp_preview) || $eparam['mode'] == _D3DIARY_PROCMODE_PHOTODEL) { $xoopsTpl->assign("preview", "1"); } $xoopsTpl->assign("yd_data", $yd_data); $xoopsTpl->assign(array("yd_uid" => $req_uid, "yd_uname" => $uname, "yd_name" => $name, "yd_openarea" => intval($d3dConf->dcfg->openarea), "yd_layout" => $yd_layout, "yd_use_friend" => intval($mod_config['use_friend']), "yd_photo_maxsize" => intval($mod_config['photo_maxsize']), "yd_photo_maxpics" => intval($mod_config['photo_maxpics']), "yd_useresize" => intval($mod_config['photo_useresize']), "yd_data" => $yd_data, "yd_photo" => $yd_photo, "popTagArr" => $pop_tags, "myTagArr" => $person_tags, "bTagArr" => $entry_tags, "yd_counter" => $func->get_count_diary($diary->uid), "yd_use_open_entry" => intval($mod_config['use_open_entry']), "catopt" => d3diary_get_category_foredit($mydirname, $req_uid), "mydirname" => $mydirname, "xoops_breadcrumbs" => $breadcrumbs, "xoops_module_header" => $xoopsTpl->get_template_vars('xoops_module_header') . $d3diary_header, "mod_config" => $mod_config, "charset" => _CHARSET, "smilylist" => $smilylist, "allow_edit" => !empty($_tempGperm['allow_edit']) ? isset($_tempGperm['allow_edit'][$req_uid]) : false, "allow_html" => !empty($_tempGperm['allow_html']) ? isset($_tempGperm['allow_html'][$req_uid]) : false, "allow_regdate" => !empty($_tempGperm['allow_regdate']) ? isset($_tempGperm['allow_regdate'][$uid]) : false, "gticket_hidden" => $xoopsGTicket->getTicketHtml(__LINE__, empty($mod_config['gticket_timeout']) ? 1800 : (int) $mod_config['gticket_timeout'], 'd3diary_edit'))); if (!empty($_tempGperm['allow_gpermission']) && ($_oe == 10 || $_oe == 20)) { $xoopsTpl->assign('allow_gpermission', isset($_tempGperm['allow_gpermission'][$req_uid])); } if (!empty($_tempGperm['allow_ppermission']) && $_oe == 20) { $xoopsTpl->assign('allow_ppermission', isset($_tempGperm['allow_ppermission'][$req_uid])); } // // private functions // function d3diary_get_category_foredit($mydirname, $uid) { global $xoopsDB, $myts, $mod_config, $func; // changed for common category (uid=0) $sql = "SELECT *\n\t\t\t FROM " . $xoopsDB->prefix($mydirname . '_category') . "\n\t WHERE uid='" . intval($uid) . "' OR uid='0' ORDER BY corder"; $result = $xoopsDB->query($sql);