function updaterating($sel_id) { global $_TABLES; $voteresult = DB_query("select rating FROM {$_TABLES['filemgmt_votedata']} WHERE lid = '{$sel_id}'"); $votesDB = DB_numROWS($voteresult); $totalrating = 0; if ($votesDB > 0) { while (list($rating) = DB_fetchARRAY($voteresult)) { $totalrating += $rating; } $finalrating = $totalrating / $votesDB; } $finalrating = number_format($finalrating, 4); DB_query("UPDATE {$_TABLES['filemgmt_filedetail']} SET rating='{$finalrating}', votes='{$votesDB}' WHERE lid = '{$sel_id}'"); }
$sql .= " AND topic_id = '0'"; } elseif ($notifytype == '3') { $sql .= " AND topic_id < '0'"; } else { $sql .= " AND topic_id > '0'"; } $sql .= " ORDER BY forum_id ASC, date_added DESC"; $notifications = DB_query($sql); $nrows = DB_numRows($notifications); $numpages = ceil($nrows / $show); $offset = ($page - 1) * $show; $base_url = $_CONF['site_url'] . "/forum/notify.php?filter={$notifytype}&forum={$forum}&show={$show}"; $sql .= " LIMIT {$offset}, {$show}"; $notifications = DB_query($sql); $i = 1; while (list($notify_recid, $forum_id, $topic_id, $date_added) = DB_fetchARRAY($notifications)) { $forum_name = DB_getITEM($_TABLES['gf_forums'], "forum_name", "forum_id='{$forum_id}'"); $is_forum = ''; if ($topic_id == '0') { $subject = ''; $is_forum = $LANG_GF02['msg138']; $topic_link = '<a href="' . $_CONF['site_url'] . '/forum/index.php?forum=' . $forum_id . '" title="' . $subject . '">' . $subject . '</a>'; } else { if ($topic_id < 0) { $neg_subscription = true; $topic_id = -$topic_id; } else { $neg_subscription = false; } $result = DB_query("SELECT subject,name,replies,views,uid,id FROM {$_TABLES['gf_topic']} WHERE id = '{$topic_id}'"); $A = DB_fetchArray($result);
function displayMenuRecords() { global $_CONF, $_TABLES, $CONF_NEXMENU, $LANG_NEXMENU01, $LANG_NEXMENU02, $menulocation; global $statusmsg, $imagesdir, $folder_icon, $showdisabled, $idCurrent, $LANG_NEXMENU04; include $_CONF['path_system'] . 'classes/navbar.class.php'; require_once $_CONF['path_system'] . 'nexpro/classes/TreeMenu.php'; $menu = new HTML_TreeMenu(); $mquery = DB_query("SELECT id,pid,label,menuorder, menutype, is_enabled from {$_TABLES['nexmenu']} WHERE pid='0' AND location='{$menulocation}' ORDER BY menuorder"); $menuOrd = 10; $stepNumber = 10; while (list($id, $pid, $label, $order, $menutype, $enabled) = DB_fetchARRAY($mquery)) { /* Re-order any Offer or Stories that may have just been moved */ if ($order != $menuOrd) { DB_query("UPDATE {$_TABLES['nexmenu']} SET menuorder = '{$menuOrd}' WHERE id = '{$id}'"); } $menuOrd += $stepNumber; if ($enabled == '1' or $showdisabled == '1' and $enabled == '0') { $icon = $CONF_NEXMENU['icons'][$menutype]; if ($idCurrent == $id) { $label = '<span class="treeMenuSelected">' . $label . '</span>'; } elseif ($enabled == '0') { $label = '<span class="treeMenuDisabled">' . $label . '</span>'; } $node[$id] = new HTML_TreeNode(array('text' => $label, 'link' => $_CONF['site_admin_url'] . "/plugins/nexmenu/index.php?op=display&id={$id}&showdisabled={$showdisabled}&menulocation={$menulocation}", 'icon' => $icon)); recursive_node($node[$id], $id); $menu->addItem($node[$id]); } } $treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $imagesdir, 'defaultClass' => 'treeMenuDefault', 'usePersistance' => true)); $mainview = new Template($_CONF['path_layout'] . 'nexmenu/admin'); $mainview->set_file(array('mainview' => 'mainview.thtml')); $mainview->set_var('site_url', $_CONF['site_url']); if ($statusmsg != '') { $mainview->set_var('showalert', ''); } else { $mainview->set_var('showalert', 'none'); } $mainview->set_var('statusmsg', $statusmsg); $mainview->set_var('imgset', $_CONF['layout_url'] . '/nexmenu/images/admin'); if ($showdisabled == '1') { $mainview->set_var('chk_enabled', 'CHECKED'); } else { $mainview->set_var('chk_disabled', 'CHECKED'); } if ($statusmsg != '') { $mainview->set_var('statusmsg', $statusmsg); } if ($CONF_NEXMENU['load_HTMLTree']) { $javascript = "<script language=JavaScript src=\"{$_CONF['site_url']}/nexmenu/javascript/TreeMenu.js\" type=\"text/javascript\"></script>"; $mainview->set_var('include_javascript', $javascript); } $scripturl = $_CONF['site_admin_url'] . '/plugins/nexmenu/index.php'; $navbar = new navbar(); $navbar->add_menuitem($LANG_NEXMENU04['1'], $scripturl . "?menulocation=header&showdisabled={$showdisabled}"); $navbar->add_menuitem($LANG_NEXMENU04['2'], $scripturl . "?menulocation=block&showdisabled={$showdisabled}"); $navbar->add_menuitem($LANG_NEXMENU04['3'], $scripturl . "?op=addaction&id={$idCurrent}&menulocation={$menulocation}&showdisabled={$showdisabled}"); $navbar->add_menuitem($LANG_NEXMENU04['6'], $scripturl . "?op=config&menulocation=block&showdisabled={$showdisabled}"); if ($menulocation == 'block') { $navbar->set_selected($LANG_NEXMENU04['2']); $mainview->set_var('navbar', $navbar->generate()); $mainview->set_var('location', 'block'); } else { $navbar->set_selected($LANG_NEXMENU04['1']); $mainview->set_var('navbar', $navbar->generate()); $mainview->set_var('location', 'header'); } $mainview->set_var('LANG_OPTIONS', $LANG_NEXMENU01['LANG_OPTIONS']); $mainview->set_var('LANG_ADD', $LANG_NEXMENU01['LANG_ADD']); $mainview->set_var('LANG_HEADING1', $LANG_NEXMENU01['LANG_HEADING1']); $mainview->set_var('treemenu', $treeMenu->toHTML()); $filteroptions = '<option value=\'block\' '; $filteroptions .= $menulocation == 'block' ? 'SELECTED' : ''; $filteroptions .= '>Block Menu Items</option><option value=\'header\' '; $filteroptions .= $menulocation == 'header' ? 'SELECTED' : ''; $filteroptions .= '>Header Menu Items</option>'; $mainview->set_var('filteroptions', $filteroptions); if ($idCurrent == 0 or DB_getItem($_TABLES['nexmenu'], "location", "id='{$idCurrent}'") != $menulocation) { $mainview->set_var('showdiv', 'none'); $mainview->set_var('LANG_edithelp', $LANG_NEXMENU01['LANG_EditHelp']); } else { $mainview->set_var('show_itemhelp', 'none'); $mainview->set_var('LANG_HEADING2', $LANG_NEXMENU01['LANG_HEADING2']); $query = DB_query("SELECT pid, menutype, menuorder, label, url, grp_access, is_enabled FROM {$_TABLES['nexmenu']} WHERE id={$idCurrent}"); list($pid, $menutype, $order, $label, $url, $grp_id, $is_enabled) = DB_fetchArray($query); $chk1 = $is_enabled == 1 ? ' checked' : ''; if ($pid == 0) { $parent = $LANG_NEXMENU01['LANG_TopLevelMenu']; } else { $parent = DB_getItem($_TABLES['nexmenu'], "label", "id={$pid}"); } if (trim($url) == '') { $url = 'Not Defined'; } $mainview->set_var('showurl', $menutype == 3 ? 'none' : ''); $mainview->set_var('id', $idCurrent); $mainview->set_var('location', $menulocation); $mainview->set_var('label', stripslashes($label)); $mainview->set_var('parent', $parent); $mainview->set_var('url', substr($url, 0, 40)); $mainview->set_var('full_url', $url); $mainview->set_var('order', $order); $mainview->set_var('menutype', $LANG_NEXMENU02[$menutype]); $mainview->set_var('chk1', $chk1); $mainview->set_var('chk2', $chk2); $mainview->set_var('chk3', $chk3); $mainview->set_var('showdisabled', $showdisabled); $mainview->set_var('LANG_MenuItemAdmin', $LANG_NEXMENU01['LANG_MenuItemAdmin']); $mainview->set_var('LANG_ParentMenu', $LANG_NEXMENU01['LANG_ParentMenu']); $mainview->set_var('LANG_ORDER', $LANG_NEXMENU01['LANG_ORDER']); $mainview->set_var('LANG_Enabled', $LANG_NEXMENU01['LANG_Enabled']); $mainview->set_var('LANG_Submenu', $LANG_NEXMENU01['LANG_Submenu']); $mainview->set_var('LANG_URLITEM', $LANG_NEXMENU01['LANG_URLITEM']); $mainview->set_var('LANG_ACCESS', $LANG_NEXMENU01['LANG_ACCESS']); $mainview->set_var('grp_access', getMenuGroupAccessOption($grp_id)); $mainview->set_var('LANG_EditRecord', $LANG_NEXMENU01['LANG_EditRecord']); $mainview->set_var('LANG_DeleteRecord', $LANG_NEXMENU01['LANG_DeleteRecord']); $mainview->set_var('LANG_MoveUp', $LANG_NEXMENU01['LANG_MoveUp']); $mainview->set_var('LANG_MoveDn', $LANG_NEXMENU01['LANG_MoveDn']); $mainview->set_var('LANG_DELCONFIRM', $LANG_NEXMENU01['LANG_DELCONFIRM']); $mainview->set_var('chk1', $chk1); } $mainview->parse('output', 'mainview'); return $mainview->finish($mainview->get_var('output')); }
} DB_query("UPDATE {$_TABLES['forum_forums']} SET forum_cat={$category},forum_name='{$name}',forum_dscp='{$dscp}', grp_id={$privgroup},\n is_hidden='{$is_hidden}', is_readonly='{$is_readonly}', no_newposts='{$no_newposts}' WHERE forum_id='{$id}'"); $display = COM_refresh($_CONF['site_admin_url'] . '/plugins/forum/boards.php?msg=8'); COM_output($display); exit; } elseif ($mode == $LANG_GF01['RESYNC']) { gf_resyncforum($id); } elseif ($mode == $LANG_GF01['EDIT']) { $grouplist = ''; $sql = "SELECT forum_name,forum_cat,forum_dscp,grp_id,forum_order,is_hidden,is_readonly,no_newposts "; $sql .= "FROM {$_TABLES['forum_forums']} WHERE (forum_id='{$id}')"; $resForum = DB_query($sql); list($forum_name, $forum_category, $forum_dscp, $privgroup, $forum_order, $is_hidden, $is_readonly, $no_newposts) = DB_fetchArray($resForum); $resGroups = DB_query("SELECT DISTINCT grp_id,grp_name FROM {$_TABLES['groups']}"); $nrows = DB_numRows($resGroups); while (list($grp, $name) = DB_fetchARRAY($resGroups)) { if ($grp == $privgroup) { $grouplist .= '<option value="' . $grp . '" Selected >' . $name . '</option>'; } else { $grouplist .= '<option value="' . $grp . '">' . $name . '</option>'; } } $categorylist = ''; $result = DB_query("SELECT id, cat_name FROM {$_TABLES['forum_categories']} ORDER BY cat_order"); $nrows = DB_numRows($result); if ($nrows > 0) { for ($i = 1; $i <= $nrows; $i++) { $G = DB_fetchArray($result); if ($G['id'] == $forum_category) { $categorylist .= '<option value="' . $G['id'] . '" Selected >' . $G['cat_name'] . '</option>'; } else {
list($dtitle) = DB_fetchARRAY($result); $result = DB_query("SELECT date,uid,remote_ip FROM {$_TABLES['filemgmt_history']} WHERE lid='" . DB_escapeString($lid) . "'"); $display = COM_siteHeader('none'); $display .= "<table width='100%' border='0' cellspacing='1' cellpadding='4' class='plugin'><tr>"; $display .= "<td colspan='3'><center><H2>" . $LANG_FILEMGMT['DownloadReport'] . "</H2></center></td></tr><tr>"; $display .= "<td colspan='3'><H4>File: " . $dtitle . "</H4></td></tr><tr>"; $display .= "<td bgcolor='#000000' width='20%'><b><center><font color='#ffffff' size='3'>Date</font></center></b></td>"; $display .= "<td bgcolor='#000000' width='20%'><b><center><font color='#ffffff' size='3'>User</font></center></b></td>"; $display .= "<td bgcolor='#000000' width='20%'><b><center><font color='#ffffff' size='3'>Remote IP</font></center></b></td>"; $display .= "</tr>"; $highlight = true; while (list($date, $uid, $remote_ip) = DB_fetchARRAY($result)) { $result2 = DB_query("SELECT username FROM {$_TABLES['users']} WHERE uid = {$uid}"); list($username) = DB_fetchARRAY($result2); $result2 = DB_query("SELECT username FROM {$_TABLES['users']} WHERE uid = {$uid}"); list($username) = DB_fetchARRAY($result2); if ($highlight) { $highlight = false; $display .= "<td bgcolor='#f5f5f5' width=20%>{$date}</td>"; $display .= "<td bgcolor='#f5f5f5' width=20%>{$username}</td>"; $display .= "<td bgcolor='#f5f5f5' width=20%>{$remote_ip}</td>"; $display .= "</tr>"; } else { $highlight = true; $display .= "<td width=20%>{$date}</td>"; $display .= "<td width=20%>{$username}</td>"; $display .= "<td width=20%>{$remote_ip}</td>"; $display .= "</tr>"; } } $display .= "</table>";
echo '<br><p><table border="0" cellpadding="3" cellspacing="1" width="99%" ID="plg_table"> <tr> <th id="plg_heading" colspan="7" width="100%" style="padding-left:10px; text-align:left; vertical-align:top; font-size:12; font-weight:bold;">Quiz Listing</td> </tr> <tr> <td width="20"><label>#</label></td> <td> </td> <td width="40%"><label>Description</label></td> <td><label>Date</label></td> <td width="10%"><label>Questions</label></td> <td width="10%"><label>Score</label></td> <td width="25%"><label>Options</label></td> </tr>'; if ($nrows[0] > 0) { $query = DB_query("SELECT quizid,name,date,status,pass_score,pretest_req FROM {$_TABLES['quiz_master']} ORDER BY quizid DESC LIMIT {$offset}, {$show}"); while (list($id, $name, $date, $status, $pass, $pretest) = DB_fetchARRAY($query)) { $date = strftime($_CONF['shortdate'], $date); $result = "N/A"; $options_link = "N/A"; $pretestRequired = false; $questionCount = DB_count($_TABLES['quiz_questions'], "quizid", $id); $quizresults = DB_query("SELECT score,date FROM {$_TABLES['quiz_results']} WHERE quizid={$id} AND uid={$uid} ORDER by score DESC"); $numresults = DB_numRows($quizresults); if ($numresults > 0) { list($score, $resultsdate) = DB_fetchArray($quizresults); $result = $score . '/' . $pass; $options_link = '<a href="' . $PHP_SELF . '?op=results&quiz=' . $id . '">Show Results</a>'; } elseif ($pretest) { $pretest_quiz = DB_getItem($_TABLES['quiz_master'], "linkedquiz", "quizid={$id}"); // Check and see if pre-test has been completed $pretestresults = DB_query("SELECT score,pass_score FROM {$_TABLES['quiz_master']} master, {$_TABLES['quiz_results']} results WHERE master.quizid=results.quizid AND results.quizid={$pretest_quiz} AND uid={$uid} ORDER by score DESC Limit 1");
while (list($uid) = DB_fetchARRAY($queryNotifyUsers)) { if ($uid != $_USER['uid']) { $target_users[] = $uid; } } } /* Send out Notifications to all users on distribution * Use the Bcc feature of COM_mail (added June/2009) * To send to complete distribution as one email and not loop thru distribution sending individual emails */ $lastuser = 0; $type = 5; // Notification message type - Broadcast message $sql = "SELECT file.title,file.cid,file.submitter,category.name FROM " . "{$_TABLES['nxfile_files']} file, {$_TABLES['nxfile_categories']} category " . "WHERE file.cid=category.cid and file.fid={$fid}"; $query = DB_query($sql); list($filename, $cid, $submitter, $catname) = DB_fetchARRAY($query); foreach ($target_users as $target_uid) { // Check that user has view access to this folder if ($target_uid != $lastuser and fm_getPermission($cid, 'view')) { $query = DB_query("SELECT username,email FROM {$_TABLES['users']} WHERE uid={$target_uid}"); list($username, $email) = DB_fetchArray($query); if (!empty($email)) { $distribution[] = $email; $sql = "INSERT INTO {$_TABLES['nxfile_notificationlog']} (target_uid,submitter_uid,notification_type,fid,cid,datetime) " . "VALUES ({$target_uid},{$_USER['uid']},{$type},{$fid},{$cid},UNIX_TIMESTAMP() )"; DB_query($sql); } $lastuser = $target_uid; } } $subject = "{$_CONF['site_name']} - {$LANG_FM10[$type]['SUBJECT']}"; $message .= "\n\n";
/** * Send out notifications to all users that have subscribed to this file to file category * Will check user preferences for notification if Messenger Plugin is installed * @param string $pid Project ID * @param string $tid Task ID * @param string $msgid Message type * @return Boolean Returns True if atleast 1 message was sent out **/ function prj_sendNotification($pid, $tid, $msgid = "1") { global $_CONF, $_TABLES, $_USER, $REMOTE_ADDR, $_FMCONF, $LANG_PRJ01; if (empty($pid)) { $pid = DB_getItem($_TABLES['prj_tasks'], 'pid', "tid = {$tid}"); } switch ($msgid) { case "1": // Project Editted //alert only those discretely listed users in the proj permissions table $query = DB_query("SELECT project.pid,project.name,project.cid,users.uid FROM {$_TABLES['prj_projects']} project, {$_TABLES['prj_users']} users WHERE project.pid={$pid} and project.pid=users.pid AND users.role='o'"); list($identifier, $name, $cid, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_projPerms']} WHERE pid={$pid} "); $SECONDARYqueryNotifyUsers = FALSE; break; case "2": // Project Created //alert only those discretely listed in the proj permissions table $query = DB_query("SELECT project.pid,project.name,project.cid,users.uid FROM {$_TABLES['prj_projects']} project, {$_TABLES['prj_users']} users WHERE project.pid={$pid} and project.pid=users.pid AND users.role='o'"); list($identifier, $name, $cid, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_projPerms']} WHERE pid={$pid}"); $SECONDARYqueryNotifyUsers = FALSE; break; case "3": // Task Created - send only to task owner and project manager $query = DB_query("SELECT task.tid,task.name,users.uid FROM {$_TABLES['prj_tasks']} task, {$_TABLES['prj_task_users']} users WHERE task.tid={$tid} and task.tid=users.tid AND users.role='o'"); list($identifier, $name, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_task_users']} WHERE {$_TABLES['prj_task_users']}.tid={$tid} AND {$_TABLES['prj_task_users']}.role='o'"); //now get any PMs from the perms table too..... $SECONDARYqueryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_projPerms']} WHERE pid={$pid} and fullAccess=1"); break; case "4": // Task Created - send only project manager $query = DB_query("SELECT task.tid,task.name,users.uid FROM {$_TABLES['prj_tasks']} task, {$_TABLES['prj_task_users']} users WHERE task.tid={$tid} and task.tid=users.tid AND users.role='o'"); list($identifier, $name, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_projPerms']} WHERE pid={$pid} AND fullAccess=1"); $SECONDARYqueryNotifyUsers = FALSE; break; case "5": // Task Modified - send only to task owner and project manager $query = DB_query("SELECT task.tid,task.name,users.uid FROM {$_TABLES['prj_tasks']} task, {$_TABLES['prj_task_users']} users WHERE task.tid={$tid} and task.tid=users.tid AND users.role='o'"); list($identifier, $name, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_task_users']} WHERE {$_TABLES['prj_task_users']}.tid={$tid} AND {$_TABLES['prj_task_users']}.role='o'"); $SECONDARYqueryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_projPerms']} WHERE pid={$pid} and fullAccess=1"); break; case "6": // Task Modified - send only project manager $query = DB_query("SELECT task.tid,task.name,users.uid FROM {$_TABLES['prj_tasks']} task, {$_TABLES['prj_task_users']} users WHERE task.tid={$tid} and task.tid=users.tid AND users.role='o'"); list($identifier, $name, $submitter) = DB_fetchARRAY($query); $queryNotifyUsers = DB_query("SELECT uid FROM {$_TABLES['prj_users']} WHERE {$_TABLES['prj_users']}.pid={$pid} AND {$_TABLES['prj_users']}.role='o'"); break; } if (DB_numRows($queryNotifyUsers) > 0) { while (list($uid) = DB_fetchARRAY($queryNotifyUsers)) { $target_users[] = $uid; } if ($SECONDARYqueryNotifyUsers !== FALSE) { while (list($uid) = DB_fetchARRAY($SECONDARYqueryNotifyUsers)) { $target_users[] = $uid; } } // Sort the array so that we can check for duplicate user notification records sort($target_users); reset($target_users); // Send out Notifications to all users on distribution $lastuser = ""; foreach ($target_users as $target_user) { if ($target_user != $lastuser) { $target_username = DB_getItem($_TABLES['users'], "username", "uid='{$target_user}'"); $target_fullname = DB_getItem($_TABLES['users'], "fullname", "uid='{$target_user}'"); if ($msgid == "1" || $msgid == "2") { $subject = '' . $_CONF['site_name'] . ' ' . $LANG_PRJ01[$msgid]['SUBJECT'] . ''; $submitter_name = DB_getItem($_TABLES['users'], "fullname", "uid={$submitter}"); $message = $LANG_PRJ01[$msgid]['HELLO'] . ' ' . $target_fullname . ",\n\n"; $message .= sprintf($LANG_PRJ01[$msgid]['LINE1'], $submitter_name, $name); $message .= sprintf($LANG_PRJ01[$msgid]['LINE2'], $_CONF['site_url'] . '/nexproject/viewproject.php?mode=view&id=' . $identifier); $message .= $LANG_PRJ01[$msgid]['LINE3']; $message .= $LANG_PRJ01[$msgid]['LINE4'] . $LANG_PRJ01[$msgid]['ADMIN'] . "\n"; $message .= $_CONF[site_url] . "\n"; } elseif ($msgid == "3" || $msgid == "4") { $subject = '' . $_CONF['site_name'] . ' ' . $LANG_PRJ01[$msgid]['SUBJECT'] . ''; $submitter_name = DB_getItem($_TABLES['users'], "fullname", "uid={$submitter}"); $message = $LANG_PRJ01[$msgid]['HELLO'] . ' ' . $target_fullname . ",\n\n"; $message .= sprintf($LANG_PRJ01[$msgid]['LINE1'], $submitter_name, $name); $message .= sprintf($LANG_PRJ01[$msgid]['LINE2'], $_CONF['site_url'] . '/nexproject/viewproject.php?mode=view&id=' . $identifier); $message .= $LANG_PRJ01[$msgid]['LINE3']; $message .= $LANG_PRJ01[$msgid]['LINE4'] . $LANG_PRJ01[$msgid]['ADMIN'] . "\n"; $message .= $_CONF[site_url] . "\n"; } else { $subject = '' . $_CONF['site_name'] . ' ' . $LANG_PRJ01[$msgid]['SUBJECT'] . ''; $submitter_name = DB_getItem($_TABLES['users'], "fullname", "uid={$submitter}"); $message = $LANG_PRJ01[$msgid]['HELLO'] . ' ' . $target_fullname . ",\n\n"; $message .= sprintf($LANG_PRJ01[$msgid]['LINE1'], $name, $submitter_name); $message .= sprintf($LANG_PRJ01[$msgid]['LINE2'], $_CONF['site_url'] . '/nexproject/viewproject.php?mode=view&id=' . $identifier); $message .= $LANG_PRJ01[$msgid]['LINE3']; $message .= $LANG_PRJ01[$msgid]['LINE4'] . $LANG_PRJ01[$msgid]['ADMIN'] . "\n"; $message .= $_CONF[site_url] . "\n"; } prj_sendEmail($target_username, $subject, $message); } $lastuser = $target_user; } return true; } else { return false; } }
function getChildTreeArray($sel_id = 0, $order = "", $parray = array(), $r_prefix = "") { $sql = "SELECT * FROM {$this->table} WHERE {$this->pid} = '{$sel_id}' {$this->filtersql} "; if ($order != "") { $sql .= " ORDER BY {$order}"; } $result = DB_query($sql); $count = DB_numROWS($result); if ($count == 0) { return $parray; } while ($row = DB_fetchARRAY($result)) { $row['prefix'] = $r_prefix . "."; array_push($parray, $row); $parray = $this->getChildTreeArray($row[$this->id], $order, $parray, $row['prefix']); } return $parray; }
function displayPages($catid) { global $_CONF, $CONF_SE, $_TABLES, $statusmsg, $type, $LANG_SE02; $menu = new HTML_TreeMenu(); if ($catid != 0) { $parentCatid = DB_getItem($_TABLES['nexcontent_pages'], 'pid', "id='{$catid}'"); $node[0] = new HTML_TreeNode(array('text' => 'up one level', 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid={$parentCatid}", 'icon' => 'folder.gif')); $menu->addItem($node[0]); $label = DB_getItem($_TABLES['nexcontent_pages'], 'name', "id='{$catid}'"); $psql = "SELECT id FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$catid}' AND (type='page' OR type='link')"; $psql .= COM_getPermSQL('AND'); $psql .= ' ORDER BY pageorder, id asc'; $pquery = DB_query($psql); $numpages = DB_numRows($pquery); if ($numpages > 0) { $label = $label . ' (' . $numpages . ')'; } $label = '<span class="treeMenuSelected">' . $label . '</span>'; $node[$catid] = new HTML_TreeNode(array('text' => $label, 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid=" . $catid, 'icon' => 'folder.gif')); nexcontent_recursiveView($node[$catid], $catid); $menu->addItem($node[$catid]); } else { $msql = "SELECT id,pid,name,pageorder from {$_TABLES['nexcontent_pages']} WHERE pid='0' and type='category'"; $msql .= COM_getPermSQL('AND'); $msql .= ' ORDER BY pageorder, id asc'; $mquery = DB_QUERY($msql); while (list($id, $category, $name, $order) = DB_fetchARRAY($mquery)) { //echo "<br>id:$id, cat: $category, name:$name, order:$order"; if ($catid != 0 and $catid == $id) { $name = '<span class="treeMenuSelected">' . $name . '</span>'; } $pquery = DB_query("SELECT id FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$id}' AND (type='page' OR type='link')"); $numpages = DB_numRows($pquery); if ($numpages > 0) { $name = $name . ' (' . $numpages . ')'; } $node[$id] = new HTML_TreeNode(array('text' => $name, 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid=" . $id, 'icon' => 'folder.gif')); nexcontent_recursiveView($node[$id], $id); $menu->addItem($node[$id]); } } $treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $_CONF['layout_url'] . '/nexpro/images/treemenu', 'defaultClass' => 'treeMenuDefault')); $q = DB_query("SELECT id,name from {$_TABLES['nexcontent_pages']} WHERE type='category' ORDER BY id"); $selCategories = '<option value="0">Top Level</option>' . LB; $selCategories .= nexcontent_getFolderList($catid); /* Retrieve all the pages for the selected category */ $sql = "SELECT id,sid,pageorder,name,hits,type,menutype,submenu_item,is_draft FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$catid}' or id='{$catid}'"; $sql .= COM_getPermSQL('AND'); //$sql .= ' ORDER by type, pid,pageorder'; $sql .= ' ORDER by pid,pageorder'; $query = DB_query($sql); $mainview = new Template($_CONF['path_layout'] . 'nexcontent/admin'); $mainview->set_file(array('mainview' => 'pageview.thtml', 'msgline' => 'alertline.thtml', 'records' => 'pagerecords.thtml')); $mainview->set_var('navbar', nexcontent_showNavbar($LANG_SE02['1'])); $mainview->set_var('type', $type); $mainview->set_var('catid', $catid); $mainview->set_var('folderview', $treeMenu->toHTML()); $mainview->set_var('phpself', $_SERVER['PHP_SELF']); if ($statusmsg != '') { $mainview->set_var('alertmsg', $statusmsg); } else { $mainview->set_var('alertmsg', ''); $mainview->set_var('msgmode', 'none'); } $mainview->set_var('filteroptions', $selCategories); $mainview->parse('alertline', 'msgline', true); $mainview->set_var('HEADING1', 'ID'); $mainview->set_var('HEADING2', 'Name'); $mainview->set_var('HEADING3', 'Hits'); $mainview->set_var('HEADING4', 'Menu Type'); $mainview->set_var('HEADING5', 'Draft'); $mainview->set_var('HEADING6', 'Action'); $mainview->set_var('imgset', $CONF_SE['public_url'] . '/images'); $mainview->set_var('site_url', $_CONF['site_url']); $mainview->set_var('site_admin_url', $_CONF['site_admin_url']); $mainview->set_var('layout_url', $_CONF['layout_url']); $mainview->set_var('nexcontent_url', $CONF_SE['public_url']); $i = 1; $currentCategory = ''; $pageOrd = 10; $stepNumber = 10; while (list($id, $sid, $order, $name, $hits, $type, $menutype, $submenu, $is_draft) = DB_fetchArray($query)) { if ($type == 'page' and $currentCategory != $category) { $pageOrd = 10; $currentCategory = $category; } if ($id != $catid and $order != $pageOrd) { DB_query("UPDATE {$_TABLES['nexcontent_pages']} SET pageorder = '{$pageOrd}' WHERE id = '{$id}'"); $order = $pageOrd; } $pageOrd += $stepNumber; $check1 = $submenu >= 1 ? ' CHECKED' : ''; $check2 = $is_draft == 1 ? ' CHECKED' : ''; if ($type == 'category') { $mainview->set_var('pagelink', "{$_CONF['site_admin_url']}/plugins/nexcontent/index.php?catid={$id}"); $mainview->set_var('pageimage', '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/sitecategory.gif">'); $editop = 'editCategory'; } else { if ($type == 'link') { $mainview->set_var('pagelink', "{$_CONF['site_admin_url']}/plugins/nexcontent/index.php?op=editLink&pageid={$id}"); $mainview->set_var('pageimage', '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/sitelink.gif">'); $editop = 'editLink'; } else { $mainview->set_var('pagelink', "{$_CONF['site_admin_url']}/plugins/nexcontent/index.php?op=editPage&pageid={$id}"); $mainview->set_var('pageimage', '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/sitepage.gif">'); $editop = 'editPage'; } } $menuoptions = ''; foreach ($CONF_SE['menuoptions'] as $value => $label) { if ($name == 'frontpage') { if ($value == '0') { $menuoptions .= '<option value="' . $value . '">' . $label . '</option>'; } } elseif ($value == 0 or $type == 'page' and $value == 3 or $type == 'link' and $value == 3) { if ($value == $menutype) { $menuoptions .= '<option value="' . $value . '" SELECTED=SELECTED>' . $label . '</option>'; } else { $menuoptions .= '<option value="' . $value . '">' . $label . '</option>'; } } elseif ($type == 'category' and ($catid > 0 or $value != 3)) { if ($value == $menutype) { $menuoptions .= '<option value="' . $value . '" SELECTED=SELECTED>' . $label . '</option>'; } else { $menuoptions .= '<option value="' . $value . '">' . $label . '</option>'; } } } $mainview->set_var('menuoptions', $menuoptions); $sql = "SELECT id FROM {$_TABLES['nexcontent_pages']} WHERE id='{$id}' "; $sql .= COM_getPermSQL('AND', 0, 3); $pquery = DB_query($sql); if (DB_numRows($pquery) > 0) { $link = ' <a href="' . $_CONF['site_admin_url'] . '/plugins/nexcontent/index.php?op='; $editimg = '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/edit.gif" TITLE="Edit Page" border="0">'; $editlink = $link . $editop . '&pageid=' . $id . '">' . $editimg . '</a>'; $copyimg = '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/copy.gif" TITLE="Copy Page" border="0">'; $copylink = $link . 'copyPage&pageid=' . $id . '">' . $copyimg . '</a>'; $LANG_CONFIRM = 'Please confirm that you want to delete this page and any associated images'; $deleteimg = '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/delete.gif" TITLE="Delete Page" border="0">'; $deletelink = $link . 'delPage&pageid=' . $id . '" onclick="return confirm(\'' . $LANG_CONFIRM . '\');">' . $deleteimg . '</a>'; } else { $editlink = ''; $deletelink = ''; } $mainview->set_var('sid', $sid); $mainview->set_var('cssid', $i); $mainview->set_var('pageid', $id); $mainview->set_var('pagename', $name); $mainview->set_var('hits', $hits); $mainview->set_var('order', $order); $mainview->set_var('check1', $check1); $mainview->set_var('check2', $check2); $mainview->set_var('LANG_EDIT', 'Edit Page'); $mainview->set_var('editlink', $editlink); $mainview->set_var('copylink', $copylink); $mainview->set_var('LANG_DELETE', 'Delete Page'); $mainview->set_var('deletelink', $deletelink); $mainview->set_var('LANG_MOVEUP', 'Move Page Up'); $mainview->set_var('LANG_MOVEDN', 'Move Page Down'); $mainview->set_var('LANG_PREVIEW', 'Preview this page'); $mainview->parse('page_records', 'records', true); $i = $i == 2 ? 1 : 2; } $mainview->parse('output', 'mainview'); $retval .= $mainview->finish($mainview->get_var('output')); return $retval; }
function nexcontent_getFolderList($selected = '', $mode = '', $exclude = '0', $pid = '0', $level = '1', $selectlist = '') { global $_TABLES; /* Retrieve all enabled TOP Level Menu Items for this level */ $sql = "SELECT id,pid, type, name FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$pid}' AND type='category'"; if ($mode == '') { $sql .= COM_getPermSQL('AND', '0', 2); } else { $sql .= COM_getPermSQL('AND', '0', 3); } $sql .= ' ORDER BY pageorder'; $query = DB_query($sql); while (list($id, $pid, $type, $label) = DB_fetchARRAY($query)) { //echo "<br>Mode:$mode,Type:$pagetype, id:$id, selected:$selected, exclude:$exclude"; if ($id != $exclude and DB_COUNT($_TABLES['nexcontent_pages'], 'pid', $id) > 0) { $selectlist .= '<option value="' . $id; $indent = ''; if ($level > 1) { for ($i = 2; $i <= $level; $i++) { $indent .= "--"; } } if ($id == $selected) { $selectlist .= '" Selected>' . $indent . $label . '</option>' . LB; } else { $selectlist .= '">' . $indent . $label . '</option>' . LB; } $selectlist = nexcontent_getFolderList($selected, $mode, $exclude, $id, $level + 1, $selectlist); } elseif ($mode == '' or $mode == 'add' or $mode == 'edit' and $id != $exclude) { // Don't show current category in list if in Edit Category Mode - Can't make it a linked to itself $indent = ''; if ($level > 1) { for ($i = 2; $i <= $level; $i++) { $indent .= "--"; } } $selectlist .= '<option value="' . $id; if ($id == $selected) { $selectlist .= '" Selected>' . $indent . $label . '</option>' . LB; } else { $selectlist .= '">' . $indent . $label . '</option>' . LB; } } } return $selectlist; }
function migrateComments($forum, $sid, $parent) { global $verbose, $_TABLES, $_CONF, $migratedcomments; $sql = DB_query("SELECT sid,date,uid,title,comment from {$_TABLES['comments']} WHERE sid = '" . $sid . "' ORDER BY date ASC"); $num_comments = DB_numROWS($sql); if ($verbose) { echo "Found {$num_comments} Comments to migrate for this topic"; } $i = 0; while (list($sid, $commentdate, $uid, $subject, $comment) = DB_fetchARRAY($sql)) { $sqlid = DB_query("SELECT id from {$_TABLES['gf_topic']} ORDER BY id desc LIMIT 1"); list($lastid) = DB_fetchARRAY($sqlid); $comment = prepareStringForDB($comment); $subject = prepareStringForDB($subject); $postmode = "HTML"; $name = DB_getITEM($_TABLES['users'], 'username', "uid={$uid}"); $email = DB_getITEM($_TABLES['users'], 'email', "uid={$uid}"); $website = DB_getITEM($_TABLES['users'], 'homepage', "uid={$uid}"); $datetime = explode(" ", $commentdate); $date = explode("-", $datetime[0]); $time = explode(":", $datetime[1]); $year = $date[0] > 1969 ? $date[0] : "2001"; $month = $date[1]; $day = $date[2]; $hour = $time[0]; $min = $time[1]; $timestamp = mktime($hour, $min, 0, $month, $day, $year); $lastupdated = $timestamp; $migratedcomments++; DB_query("INSERT INTO {$_TABLES['gf_topic']} (forum,name,date,lastupdated, email, website, subject, comment, postmode, ip, mood, uid, pid, sticky, locked)\r\n VALUES ('{$forum}','{$name}','{$timestamp}','{$lastupdated}','{$email}','{$website}','{$subject}','{$comment}','{$postmode}','','','{$uid}','{$parent}','0','0')"); $i++; } DB_query("UPDATE {$_TABLES['gf_topic']} SET replies = {$num_comments} WHERE id={$parent}"); return $num_comments; }
} $objectives = nexlistOptionList('alist', '', $_PRJCONF['nexlist_objective']); $selectedObjectives = explode(",", $filter['objective']); $selObjective = ''; foreach ($objectives as $key => $value) { $selected = in_array($key, $selectedObjectives) === true ? ' selected' : ''; $selObjective .= "<option value=\"{$key}\"{$selected}>{$value}</option>"; } // Display filter selection section $sqlFilter = "SELECT flid, name FROM {$_TABLES['prj_filters']} WHERE uid = {$_USER['uid']}"; $result = DB_query($sqlFilter); $numFilters = DB_numrows($result); echo '<table width="100%" border="0" cellpadding="1" cellspacing="1"><tr><td class="heading2" colspan="2" align="left">Select by your Saved Filters</TD></tr><tr>'; if ($numFilters != "0") { echo '<td><form action="' . $PHP_SELF . '" method="post"><select name="selFilter" Style="width:200px">'; while (list($flid, $fname) = DB_fetchARRAY($result)) { echo '<option value="' . $flid . '"'; if ($flid == $selFilter) { echo ' SELECTED'; } echo '>' . $fname . '</option>'; } echo '</select><input type="submit" name="submit" value="Edit"><input type="submit" name="submit" value="Delete"></form></td>'; } echo '<td><form action="' . $PHP_SELF . '" method="post">New: <Input Type="text" Name="name"><input type="submit" name="submit" value="New"></form></td></tr></table>'; if (intval($selFilter) > 0) { echo '<form action="' . $PHP_SELF . '" method="post"> <table width="100%" border="0" cellpadding="1" cellspacing="1"> <TR> <TD>Name:<Input Name="name" Type="text" Value="' . $filter['name'] . '" style="width: 200px"></TD>
</tr> </table>'; echo '<table border="0" cellpadding="3" cellspacing="1" width="99%" ID="plg_table"> <tr> <th id="plg_heading" colspan="6" width="100%" style="padding-left:10px; text-align:left; vertical-align:top; font-size:12; font-weight:bold; line-height:14pt;">Quiz Administration</td> </tr> <tr align="center"> <td width="20"><label style="padding-left:10px;">#</label></td> <td width="50%"><label>Description</label></td> <td><label>Last Edit</label></td> <td style="padding-left:5px;padding-right:5px;" width="15%"><label>Questions</label></td> <td style="padding-left:5px;padding-right:5px;" width="15%"><label>Pass/Total</label></td> <td width="20%"><label>Action</label></td> </tr>'; $query = DB_query("SELECT quizid,name,date,status,pass_score FROM {$_TABLES['quiz_master']} ORDER BY date DESC LIMIT {$offset}, {$show}"); while (list($id, $name, $date, $status, $pass_score) = DB_fetchARRAY($query)) { $query2 = DB_query("SELECT count(*), SUM(IF( score >= {$pass_score}, 1, 0 )) AS pass FROM {$_TABLES['quiz_results']} WHERE quizid = {$id}"); list($total_quizrecords, $total_passrecords) = DB_fetchArray($query2); if (!isset($total_passrecords)) { $total_passrecords = 0; } $date = strftime($_CONF['shortdate'], $date); $questionCount = DB_count($_TABLES['quiz_questions'], "quizid", $id); echo '<tr> <td align="center">' . $id . '</td> <td width="40%" style="padding-left:5px; padding-right:5px; text-align:left;">' . '<a href="' . $_CONF['site_url'] . '/quiz/takequiz.php?quizid=' . $id . '">' . $name . '<a></td> <td style="padding-left:5px; padding-right:5px; text-align:center;">' . $date . '</td> <td width="10%" style="text-align:center;">' . $questionCount . '</td> <td width="15%" align="center"> ' . $total_passrecords . '/' . $total_quizrecords . '</td> <td width="30%" style="padding-left:5px;">'; echo '<a href="' . $PHP_SELF . '?op=editquiz&quizid=' . $id . '"><img src="' . $_CONF['site_url'] . '/quiz/images/editquiz.gif" border="0" TITLE="Edit Quiz"></a> ';
echo COM_refresh($_CONF['site_url'] . '?msg=1&plugin=nexfile'); exit; } $cid = DB_getItem($_TABLES['nxfile_files'], "cid", "fid={$fid}"); // make sure user has access if (!fm_getPermission($cid, 'admin')) { echo COM_siteHeader(); echo COM_startBlock('Access Denied'); echo 'You do not have access rights to this file. Your attempt has been logged.'; echo COM_endBlock(); echo COM_siteFooter(); } if (DB_count($_TABLES['nxfile_filesubmissions'], 'id', $fid) > 0) { include_once $_CONF['path_system'] . 'classes/downloader.class.php'; $query = DB_query("SELECT cid,ftype,fname,tempname FROM {$_TABLES['nxfile_filesubmissions']} WHERE id={$fid}"); list($cid, $ftype, $fname, $tname) = DB_fetchARRAY($query); $directory = $_FMCONF['storage_path'] . $cid . '/submissions/'; $logfile = $_CONF['path'] . 'logs/error.log'; if ($ftype == "file") { $pos = strrpos($tname, '.') + 1; $ext = strtolower(substr($tname, $pos)); $download = new downloader(); $download->_setAvailableExtensions($_FMCONF['downloadfiletypes']); $download->setAllowedExtensions($_FMCONF['downloadfiletypes']); $download->setLogFile($logfile); $download->setLogging(true); $download->setPath($directory); $download->downloadFile($tname); DB_query("UPDATE {$_TABLES['nxfile_filedetail']} SET hits = hits +1 WHERE fid='{$fid}' "); if ($download->areErrors()) { echo $LANG_FMERR['download1'];
} else { $sender = $uid; } $ip = $_SERVER['REMOTE_ADDR']; if ($sender != 0) { // Check if REG user is trying to report twice. $result = DB_query("SELECT COUNT(*) FROM {$_TABLES['filemgmt_brokenlinks']} WHERE lid='" . DB_escapeString($lid) . "' AND sender='" . intval($sender) . "'"); list($count) = DB_fetchARRAY($result); if ($count > 0) { redirect_header("index.php", 2, _MD_ALREADYREPORTED); exit; } } else { // Check if the sender is trying to vote more than once. $result = DB_query("SELECT COUNT(*) FROM {$_TABLES['filemgmt_brokenlinks']} WHERE lid='" . DB_escapeString($lid) . "' AND ip='" . DB_escapeString($ip) . "'"); list($count) = DB_fetchARRAY($result); if ($count > 0) { redirect_header("index.php", 2, _MD_ALREADYREPORTED); exit; } } DB_query("INSERT INTO {$_TABLES['filemgmt_brokenlinks']} (lid, sender, ip) VALUES ('" . DB_escapeString($lid) . "', '" . DB_escapeString($sender) . "', '" . DB_escapeString($ip) . "')") or die(''); redirect_header("index.php", 2, _MD_THANKSFORINFO); exit; } else { $display = FM_siteHeader(); $display .= COM_startBlock("<b>" . _MD_ADMINTITLE . "</b>"); $display .= "<form action=\"brokenfile.php\" method=\"post\">"; $display .= '<input type="hidden" name="lid" value="' . $lid . '"' . XHTML . '>'; $display .= '<div id="fm-brokenpage-pagewidth" class="plugin">'; $display .= '<p class="pluginHeader">' . _MD_REPORTBROKEN . '</p>';
function nexdoc_getGroupOptions() { global $_TABLES, $_FMCONF, $LANG_nexfile; $options = ''; if (count($_FMCONF['excludeGroups']) > 0) { $excludeGroups = $_FMCONF['excludeGroups']; // Don't want to alter the global value array_walk($excludeGroups, 'wrap_each'); $excludeGroups = implode(',', $excludeGroups); } else { $excludeGroups = ''; } if (count($_FMCONF['excludeGroups']) > 0) { $includeCoreGroups = $_FMCONF['includeCoreGroups']; // Don't want to alter the global value array_walk($includeCoreGroups, 'wrap_each'); $includeCoreGroups = implode(',', $includeCoreGroups); } else { $includeCoreGroups = ''; } $sql = "SELECT grp_id,grp_name FROM {$_TABLES['groups']} "; $sql .= "WHERE (grp_gl_core = '0' "; if (!empty($excludeGroups)) { $sql .= "AND grp_name NOT IN ({$excludeGroups}) "; } $sql .= ' ) '; if (!empty($includeCoreGroups)) { $sql .= "OR ( grp_name in ({$includeCoreGroups}) ) "; } $sql .= 'ORDER BY grp_name'; $query = DB_query($sql); if (DB_numROWS($query) > 0) { while (list($grp_id, $grp_name) = DB_fetchARRAY($query)) { $options .= '<option value="' . $grp_id . '">'; $options .= $grp_name . '</option>' . LB; } } else { $options = '<option value="0">' . $LANG_nexfile['msg36'] . '</option>'; } return $options; }
} $cssid = 1; for ($x = 1; $x <= $numrows; $x++) { list($lid, $cid, $dtitle, $url, $homepage, $version, $size, $submitter, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = DB_fetchArray($result); $rating = number_format($rating, 2); $dtitle = $myts->makeTboxData4Show($dtitle); $url = $myts->makeTboxData4Show($url); $homepage = $myts->makeTboxData4Show($homepage); $version = $myts->makeTboxData4Show($version); $size = $myts->makeTboxData4Show($size); $logourl = $myts->makeTboxData4Show($logourl); $datetime = formatTimestamp($time); $description = PLG_replaceTags($myts->makeTareaData4Show($description, 0)); //no html $result2 = DB_query("SELECT username,fullname,photo FROM {$_TABLES['users']} WHERE uid = {$submitter}"); list($submitter_name, $submitter_fullname, $photo) = DB_fetchARRAY($result2); $submitter_name = COM_getDisplayName($submitter, $submitter_name, $submitter_fullname); include $_CONF['path'] . 'plugins/filemgmt/include/dlformat.php'; $p->set_var('cssid', $cssid); $p->parse('filelisting_records', 'records', true); $cssid = $cssid == 2 ? 1 : 2; // Print Google-like paging navigation $base_url = $_CONF['site_url'] . '/filemgmt/viewcat.php?cid=' . $cid . '&orderby=' . convertorderbyout($orderby); $p->set_var('page_navigation', COM_printPageNavigation($base_url, $page, $numpages)); } $p->parse('output', 'page'); $display .= $p->finish($p->get_var('output')); } else { $p->set_var('filelisting_records', '<tr><td><div class="pluginAlert" style="width:500px;padding:10px;margin:10px;border:1px dashed #CCC;">' . _MD_NOFILES . '</div></td></tr>'); $p->parse('output', 'page'); $display .= $p->finish($p->get_var('output'));
break; case 'ARCHIVE': $query = DB_query("SELECT id,source_uid,target_uid,message,subject,datetime,read_date,reply_msgid from {$_TABLES['messenger_msg']} LEFT JOIN {$_TABLES['messenger_dist']} ON id = msg_id WHERE (target_uid={$uid} OR target_uid='0') AND archive='1' {$orderby} LIMIT {$offset}, {$show}"); break; case 'OUTBOX': $query = DB_query("SELECT id,source_uid,target_uid,message,subject,datetime,read_date,reply_msgid from {$_TABLES['messenger_msg']} LEFT JOIN {$_TABLES['messenger_dist']} ON id = msg_id WHERE (source_uid={$uid} AND read_date is NULL) {$orderby} LIMIT {$offset}, {$show}"); break; default: $folder = 'INBOX'; $query = DB_query("SELECT id,source_uid,target_uid,message,subject,datetime,read_date,reply_msgid from {$_TABLES['messenger_msg']} LEFT JOIN {$_TABLES['messenger_dist']} ON id = msg_id WHERE (target_uid={$uid} OR target_uid='0') AND archive='0' {$orderby} LIMIT {$offset}, {$show}"); break; } // Display all Broadcast Messages and Private Messages for this user $numMessages = 0; $cssid = 1; while (list($msg_id, $source, $target, $message, $subject, $datetime, $read_date, $reply_msgid) = DB_fetchARRAY($query)) { if ($target == '0' and !$userBlockBrdcast or $target > 0) { $numMessages++; $datePostedMsg = $LANG_MSG['prompt03'] . $long_date . "'"; $delete = ''; $reply = ''; $archive = ''; $long_date = strftime('%b %d %Y @ %H:%M', $datetime); $msg_row = new Template($_CONF['path_layout'] . '/messenger'); $msg_row->set_file(array('msg_row' => 'msg_row.thtml')); $msg_row->set_var('imgset', $CONF_MSG['imgset']); $msg_row->set_var('spacing', '1'); $msg_row->set_var('cssid', $cssid); $msg_row->set_var('date', $long_date); // If message has not been read - then update the field with the current timestamp if (empty($read_date) and ($folder != 'OUTBOX' and $folder != 'SENT')) {
$block4->recordsTotal = DB_numrows($result); $sql = "SELECT {$_TABLES['nxfile_files']}.fid,{$_TABLES['nxfile_files']}.title,"; $sql .= "{$_TABLES['nxfile_files']}.fname,{$_TABLES['nxfile_files']}.version,"; $sql .= "{$_TABLES['nxfile_files']}.size,{$_TABLES['nxfile_files']}.fname,"; $sql .= "{$_TABLES['nxfile_files']}.ftype, {$_TABLES['users']}.fullname "; $sql .= "FROM {$_TABLES['nxfile_files']}, {$_TABLES['users']} "; $sql .= "WHERE {$_TABLES['nxfile_files']}.cid={$cid} "; $sql .= "AND {$_TABLES['nxfile_files']}.submitter={$_TABLES['users']}.uid "; //$sql .= "ORDER BY $block4->sortingValue LIMIT $block4->borne,$block4->rowsLimit"; $result = DB_query($sql); $comptListTasks = DB_numrows($result); if ($comptListTasks != "0") { $block4->openResults(); $block4->labels($labels = array(0 => $strings["file_name"], 1 => $strings["file_description"], 2 => $strings["file_version"], 3 => $strings["file_submitter"]), "true"); for ($i = 0; $i < $comptListTasks; $i++) { list($listDoc->fid[$i], $title, $fname, $curVersion, $size, $filename, $ftype, $submitter) = DB_fetchARRAY($result); $block4->openRow(); $block4->checkboxRow($listDoc->fid[$i]); $block4->cellRow($blockPage->buildLink($_CONF['site_url'] . "/nexfile/index.php?fid=" . $listDoc->fid[$i], $title, "in", 'Click to View File Details')); $block4->cellRow($blockPage->buildLink($_CONF['site_url'] . "/nexfile/download.php?op=download&fid=" . $listDoc->fid[$i], $filename, "in", 'Click to Download File')); $block4->cellRow($curVersion); $block4->cellRow($submitter); $block4->closeRow(); } $block4->closeResults(); $block4->bornesFooter("4", $blockPage->bornesNumber, "", "pid={$pid}"); } else { $block4->noresults(); } echo '<input type="hidden" name="pid" value="' . $pid . '">'; $block4->closeToggle();
<td colspan="4"align="left">' . $i . ') ' . $question . '<br><span style="padding-left:18px;"><b>Value: </b>' . $qvalue . '</span></td> </tr> <tr>'; if ($imageonfile) { $iquery = DB_query("SELECT * FROM {$_TABLES['quiz_images']} WHERE qid={$qid}"); list($id, $qid, $filename, $title) = DB_fetchArray($iquery); $questionimage = $_CONF['site_url'] . "/quiz/question_images/{$qid}/{$filename}"; echo '<td valign="top" style="padding:5px;"><img src="' . $questionimage . '"></td>'; } else { echo '<td valign="top"> </td>'; } echo '<td width="63%"> <table width="100%">'; $answerQuery = DB_query("SELECT id,answer,aorder FROM {$_TABLES['quiz_answers']} WHERE qid={$qid} ORDER BY aorder"); $answercnt = 1; while (list($id, $answer, $aorder) = DB_fetchARRAY($answerQuery)) { if ($id == $quizResultAnsID) { if ($id == $qanswer) { echo '<tr><td style="color:green;padding-left:5px;">'; } else { echo '<tr><td style="color:red;padding-left:5px;">'; } } else { echo '<tr><td style="color:black;padding-left:5px;">'; } echo $answercnt . ') '; echo '<input type="radio"'; if ($id == $qanswer and SEC_hasRights('quiz.edit')) { echo " checked"; } echo '>';
function edit_smilie($id) { global $_CONF, $_TABLES, $phpself, $LANG_MSG02, $CONF_MSG; $baseurl = $CONF_MSG['SMILIE_URL']; $query = DB_query("SELECT code,smile_url,emoticon FROM {$_TABLES['smilies']} WHERE smilie_id='{$id}'"); list($code, $smile_url, $emoticon) = DB_fetchARRAY($query); if (!empty($smile_url)) { $currentsmilie = $baseurl . $smile_url; } else { $currentsmilie = $baseurl . 'icon_smile.gif'; } $smilies_select = fill_smilieSelect($smile_url); $editsmilie = new Template($_CONF['path_layout'] . '/messenger/admin'); $editsmilie->set_file(array('editsmilie' => 'editsmilie.thtml')); $editsmilie->set_var('phpself', $phpself); $editsmilie->set_var('smilies_select', $smilies_select); $editsmilie->set_var('currentsmilie', $currentsmilie); $editsmilie->set_var('code', $code); $editsmilie->set_var('emoticon', $emoticon); $editsmilie->set_var('id', $id); $editsmilie->set_var('LANG_edit', $LANG_MSG02['EDITPROMPT']); $editsmilie->set_var('LANG_filename', $LANG_MSG02['FILENAME']); $editsmilie->set_var('LANG_description', $LANG_MSG02['DESCRIPTION']); $editsmilie->set_var('LANG_filename', $LANG_MSG02['FILENAME']); $editsmilie->set_var('LANG_emoticon', $LANG_MSG02['CODE']); $editsmilie->set_var('LANG_editsmilie', $LANG_MSG02['EDITSUBMIT']); $editsmilie->parse('output', 'editsmilie'); $retval .= $editsmilie->finish($editsmilie->get_var('output')); return $retval; }