function find_path() { global $g; // go to find a presentation.txt :> if (!is_file("{$g['base_path']}/presentation.txt")) { $paths = glob("./presentation/{$_GET['dir']}/*"); $has_dir = false; $body = '<ul>'; foreach ($paths as $filename) { if (is_dir($filename)) { $has_dir = true; $filename = substr($filename, strrpos($filename, '/') + 1); $body .= "<li><a href=\"{$g['weburl']}/{$_GET['dir']}/{$filename}\">{$filename}</a></li>"; } } $body .= '</ul>'; if (!$has_dir && !is_file("{$g['base_path']}/presentation.txt")) { print_html('ERROR', 'There is not any presentation file here!'); } print_html('Choose', $body); } }
$result = mysql_query($query) or die("Query failed : " . mysql_error()); if (mysql_num_rows($result) == 0) { echo "Invalid Badge"; exit; } else { list($cid, $name, $badgetext, $descr, $longdescr, $req) = mysql_fetch_row($result); $req = unserialize($req); if ($userid == 0) { //this is a criteria request if ($_GET['format'] == 'json') { header('Content-Type: application/json'); echo '{}'; exit; } list($reqnameout, $reqout, $stuout, $metout) = validatebadge($badgeid, $cid, $req, 0); print_html($badgetext, $name, $descr, $longdescr, $reqnameout, $reqout); } else { //student specific $query = "SELECT id FROM imas_students WHERE courseid={$cid} AND userid={$userid}"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); if (mysql_num_rows($result) == 0) { //no longer in the student records - go to imas_badgerecords for backup $query = "SELECT data FROM imas_badgerecords WHERE userid={$userid} AND badgeid={$badgeid}"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); if (mysql_fetch_row($result) == 0) { //no records. Uh oh! exit; } else { $data = unserialize(mysql_result($result, 0, 0)); //if ($_GET['format']=='json') { print_assertation($cid, $badgetext, $name, $descr, $userid, $data[5]);
} conProjDB($p_id, $t_id); $p_cname = $proj_data[p_cname]; $t_cname = $temp_data[$t_id][cname]; $t_name = $temp_data[$t_id][t_name]; $nav_str .= " > <a href=templist.php?p_id={$p_id}>{$p_cname}</a> > <a href=doclist.php?p_id={$p_id}&t_id={$t_id} >{$t_cname}</a> > 修改文档({$d_id})"; if ($cgi[edit] != "") { //sys_jmp("doclist.php?p_id=$p_id&t_id=$t_id"); if (check_priv($p_id, $t_id, $d_id) < 0) { sys_exit("对不起,你没有操作权限", $error_message); } upload_pic(); $t_name = $temp_data[$t_id][t_name]; $t_cname = $temp_data[$t_id][cname]; $nav_buf = sprintf("/<a href=\"projlist.php\">网站管理中心</a> > <a href=\"templist.php?p_id=%s\">%s</a> > %s(<a href=\"doclist.php?t_id=%s&p_id=%s\">文档</a>) (<a href=\"temp_edit.php?t_id=%s&p_id=%s\">模板</a>) (<a href=\"tempdeflist.php?t_id=%s&p_id=%s\">模板域</a>) > 更新文档", $p_id, $proj_data[p_cname], $t_cname, $t_id, $p_id, $t_id, $p_id, $t_id, $p_id); print_html("更新文档", $nav_buf); printf("更新数据库记录...."); $sqlstr = sprintf("update %s set savedatetime=now(), mu_id=%s,", $t_name, $ck_u_id); foreach ($cgi as $this_name => $this_value) { if ($this_name == "") { continue; } $pos = strpos($this_name, $pre_field); if ($pos !== 0) { continue; } $radio_value = $cgi["radio_{$this_name}"]; if ($radio_value) { if ($radio_value == "old") { continue; } else {
if (is_string($scripts)) { $scripts = array($scripts); } $scripts[] = '../../core.js'; $scripts[] = 'map.js'; if (is_string($styles)) { $styles = array($styles); } $styles[] = '../../style.css'; ?> <html> <head> <meta http-equiv="content-type" value="text/html;charset=utf-8"> <title><?php print_html($title); ?> </title> <?php foreach ($styles as $style) { if (!empty($style)) { ?> <link rel="stylesheet" href="<?php print $style; ?> "/> <?php } } ?>
if ($this->params->def('show_page_heading', 1)) { ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php } if ($this->params->get('show_page_title', 1)) { ?> <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> "> <?php echo $this->escape($this->params->get('page_title')); ?> </div> <?php } echo $msg; ?> <div class="contentpane<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> "> <?php echo print_html($container); ?> </div>
sys_exit("参数错误"); } conProjDB($p_id, $t_id); $p_cname = $proj_data[p_cname]; $t_cname = $temp_data[$t_id][cname]; $t_name = $temp_data[$t_id][t_name]; $nav_str .= " > <a href=templist.php?p_id={$p_id}>{$p_cname}</a> > <a href=doclist.php?p_id={$p_id}&t_id={$t_id} >{$t_cname}</a> > 添加文档"; if ($cgi[edit] != "") { if (check_priv($p_id, $t_id, 0) < 0) { sys_exit("对不起,你没有操作权限", $error_message); } upload_pic(); $t_name = $temp_data[$t_id][t_name]; $t_cname = $temp_data[$t_id][cname]; $nav_buf = sprintf("/<a href=\"projlist.php\">网站管理中心</a> > <a href=\"templist.php?p_id=%s\">%s</a> > %s(<a href=\"doclist.php?t_id=%s&p_id=%s\">文档</a>) (<a href=\"temp_edit.php?t_id=%s&p_id=%s\">模板</a>) (<a href=\"tempdeflist.php?t_id=%s&p_id=%s\">模板域</a>) > 添加文档", $p_id, $proj_data[p_cname], $t_cname, $t_id, $p_id, $t_id, $p_id, $t_id, $p_id); print_html("添加文档", $nav_buf); printf("添加数据库记录...."); $sqlstr = sprintf("insert into %s (cu_id, mu_id, createdatetime, savedatetime, published) values(%s, %s, now(), now(), 'n')", $t_name, $ck_u_id, $ck_u_id); $res = mysql_query($sqlstr, $proj_mysql) or sys_exit("系统错误,请稍候再试", mysql_error() . "\n" . $sqlstr); $d_id = mysql_insert_id($proj_mysql); $sqlstr = sprintf("update %s set", $t_name); foreach ($poly_data as $pm_id => $this_poly) { $url_radio = $cgi["urlradio_{$pm_id}"]; $outer_url = $cgi["outer_url_{$pm_id}"]; $default_url = $cgi["default_url_{$pm_id}"]; $sqlstr .= sprintf(" url_%d='%s',", $pm_id, $url_radio == "default" ? $default_url : $outer_url); } foreach ($cgi as $this_name => $this_value) { if ($this_name == "" || $this_value == "") { continue; }
<?php require_once "plib/head.php"; require_once "plib/publish.php"; require_once "plib/priv.php"; $cgi = getCGI(); $p_id = $cgi[p_id]; $t_id = $cgi[t_id]; $d_ids = $_POST[d_ids]; if ($p_id == "" || $t_id == "") { sys_exit("参数错误"); } conProjDB($p_id, $t_id); if (check_priv($p_id, $t_id, 0) < 0) { sys_exit("对不起,你没有操作权限", $error_message); } $t_name = $temp_data[$t_id][t_name]; $t_cname = $temp_data[$t_id][cname]; $nav_buf = sprintf("/<a href=\"projlist.php\">网站管理中心</a> > <a href=\"templist.php?p_id=%s\">%s</a> > %s(<a href=\"doclist.php?t_id=%s&p_id=%s\">文档</a>) ", $p_id, $proj_data[p_cname], $t_cname, $t_id, $p_id); if ($ck_u_type != 3) { $nav_buf .= sprintf(" (<a href=\"temp_edit.php?t_id=%s&p_id=%s\">模板</a>) ", $t_id, $p_id); $nav_buf .= sprintf("(<a href=\"tempdeflist.php?t_id=%s&p_id=%s\">模板域</a>) ", $t_id, $p_id); } $nav_buf .= sprintf("> 发布文档"); print_html("发布文档", $nav_buf); foreach ($d_ids as $d_id) { if (publishOneDoc($p_id, $t_id, $d_id) < 0) { printf("发布文档失败: %s<br>\n", $error_message); } }
function manage_social_access_control_options() { handle_action(); print_html(); }