$numcontent = $data->num_rows($result); while ($content[] = $data->fetch_array($result)) { } $tpl->assign('numevents', $numcontent); $tpl->assign('events', $content); $result = $data->select_query("newscontent", "WHERE trash=0 ORDER BY title DESC"); $content = array(); $numcontent = $data->num_rows($result); while ($temp = $data->fetch_array($result)) { $temp['size'] = strlen($temp['news']); $content[] = $temp; } $tpl->assign('numnews', $numcontent); $tpl->assign('news', $content); if (pageauth("photo", "limit")) { $patrollist = group_sql_list_normal("patrol", "OR"); $result = $data->select_query("album_track", "WHERE {$patrollist} AND trash=0 ORDER BY album_name ASC"); } else { $result = $data->select_query("album_track", "WHERE trash=0 ORDER BY album_name ASC"); } $content = array(); $numcontent = $data->num_rows($result); while ($content[] = $data->fetch_array($result)) { } $tpl->assign('numalbums', $numcontent); $tpl->assign('albums', $content); $result = $data->select_query("polls", "WHERE trash=0 ORDER BY date_start ASC"); $content = array(); $numcontent = $data->num_rows($result); while ($content[] = $data->fetch_array($result)) { }
if ($action == "edit") { $filename = safesql($filename, "text"); $sql = $data->update_query("patrol_articles", "patrol={$patrol}, title={$title}, detail={$story}, date_post={$timestamp}, album_id={$photo}, event_id={$event}, author={$auth}, pic={$pic}, topics={$topics}, `order`={$order}, summary={$summary}, related={$related}", "ID={$id}"); } elseif ($action == "new") { $filename = safesql($filename, "text"); $data->insert_query("patrol_articles", "'', {$patrol}, {$pic}, {$title}, {$story}, {$timestamp}, {$photo}, {$event}, {$auth}, 1, {$topics}, {$order}, {$summary}, {$related}, 0"); } if ($sql && $action == "edit") { show_admin_message("Article updated", "{$pagename}"); } elseif ($sql && $action == "new") { show_admin_message("Article added", "{$pagename}"); } } } elseif ($action == "moveitem" && pageauth("patrolart", "edit")) { if (pageauth("patrolart", "limit")) { $patrol = group_sql_list_normal("id", "OR", true); $sql = $data->select_query("groups", "WHERE ({$patrol}) AND ispublic = 1 ORDER BY teamname ASC"); } else { $sql = $data->select_query("groups", "WHERE ispublic = 1 ORDER BY teamname ASC"); } $patrols = array(); $numpatrols = $data->num_rows($sql); while ($patrols[] = $data->fetch_array($sql)) { } if (!pageauth("patrolart", "limit")) { $sql = $data->select_query("subsites", "ORDER BY name ASC"); $subsites = array(); $numsubsites = $data->num_rows($sql); while ($subsites[] = $data->fetch_array($sql)) { } }
$moduledetails[$modulenumbers]['name'] = "Group Site Manager"; $moduledetails[$modulenumbers]['details'] = "Manages group websites"; $moduledetails[$modulenumbers]['access'] = "Allowed to access group site manager"; $moduledetails[$modulenumbers]['add'] = "Allowed to add new pages and menu items"; $moduledetails[$modulenumbers]['edit'] = "Allowed to edit existing pages and menu items"; $moduledetails[$modulenumbers]['delete'] = "Allowed to delete pages and menu items"; $moduledetails[$modulenumbers]['publish'] = "notused"; $moduledetails[$modulenumbers]['limit'] = "Limit to groups the user is part of"; $moduledetails[$modulenumbers]['id'] = "patrol"; return; } else { $subpage = $_GET['subpage'] != '' ? $_GET['subpage'] : ''; if (!$subpage) { $action = $_GET['action']; if (pageauth("patrol", "limit")) { $patrollist = group_sql_list_normal("teamname", "OR"); $result = $data->select_query("groups", "WHERE ({$patrollist}) AND ispublic=1 ORDER BY teamname ASC"); } else { $result = $data->select_query("groups", "WHERE ispublic=1 ORDER BY teamname ASC"); } $patrol = array(); while ($patrol[] = $data->fetch_array($result)) { } $numpatrols = $data->num_rows($result); $tpl->assign('patrol', $patrol); $tpl->assign('patrolInfo', $patrolInfo); $tpl->assign('action', $action); $tpl->assign('numpatrol', $numpatrols); $filetouse = "admin_patrol.tpl"; } else { $allowed = array('patrolcontent' => true, 'patrolmenus' => true);