$count) { addnav(array(" ?%s - (%s modules)", $cat, $count), "modules.php?cat=$cat"); } $cat = httpget('cat'); if ($op==""){ if ($cat) { $sortby=httpget('sortby'); if (!$sortby) $sortby="installdate"; $order=httpget('order'); $tcat = translate_inline($cat); output("`n`b%s Modules`b`n", $tcat); $deactivate = translate_inline("Deactivate"); $activate = translate_inline("Activate"); $uninstall = translate_inline("Uninstall"); $reinstall = translate_inline("Reinstall"); $strsettings = translate_inline("Settings"); $strnosettings = translate_inline("`\$No Settings`0"); $uninstallconfirm = translate_inline("Are you sure you wish to uninstall this module? All user preferences and module settings will be lost. If you wish to temporarily remove access to the module, you may simply deactivate it."); $status = translate_inline("Status"); $mname = translate_inline("Module Name"); $ops = translate_inline("Ops"); $mauth = translate_inline("Module Author"); $inon = translate_inline("Installed On"); $installstr = translate_inline("by %s"); $active = translate_inline("`@Active`0"); $inactive = translate_inline("`\$Inactive`0"); rawoutput("
"); addnav("","modules.php?op=mass&cat=$cat"); rawoutput("",true); rawoutput(""); addnav("","modules.php?cat=$cat&sortby=active&order=".($sortby=="active"?!$order:1)); addnav("","modules.php?cat=$cat&sortby=formalname&order=".($sortby=="formalname"?!$order:1)); addnav("","modules.php?cat=$cat&sortby=moduleauthor&order=".($sortby=="moduleauthor"?!$order:1)); addnav("","modules.php?cat=$cat&sortby=installdate&order=".($sortby=="installdate"?$order:0)); $sql = "SELECT * FROM " . db_prefix("modules") . " WHERE category='$cat' ORDER BY ".$sortby." ".($order?"ASC":"DESC"); $result = db_query($sql); if (db_num_rows($result)==0){ rawoutput(""); } $number=db_num_rows($result); for ($i=0;$i<$number;$i++){ $row = db_fetch_assoc($result); rawoutput("",true); rawoutput(""); } rawoutput("
 $ops$status$mname$mauth$inon
"); output("`i-- No Modules Installed--`i"); rawoutput("
"); rawoutput(""); rawoutput("[ "); if ($row['active']){ rawoutput(""); output_notl($deactivate); rawoutput(""); addnav("","modules.php?op=deactivate&module={$row['modulename']}&cat=$cat"); }else{ rawoutput(""); output_notl($activate); rawoutput(""); addnav("","modules.php?op=activate&module={$row['modulename']}&cat=$cat"); } rawoutput(" |"); output_notl($uninstall); rawoutput(""); addnav("","modules.php?op=uninstall&module={$row['modulename']}&cat=$cat"); rawoutput(" | "); output_notl($reinstall); rawoutput(""); addnav("","modules.php?op=reinstall&module={$row['modulename']}&cat=$cat"); if ($session['user']['superuser'] & SU_EDIT_CONFIG) { if (strstr($row['infokeys'], "|settings|")) { rawoutput(" | "); output_notl($strsettings); rawoutput(""); addnav("","configuration.php?op=modulesettings&module={$row['modulename']}"); } else { output_notl(" | %s", $strnosettings); } } rawoutput(" ]"); output_notl($row['active']?$active:$inactive); require_once("lib/sanitize.php"); rawoutput(""); output_notl("%s %s", $row['formalname'], $row['version']); rawoutput("
"); output_notl("(%s) ", $row['modulename'], $row['version']); rawoutput("
"); output_notl("`#%s`0", $row['moduleauthor'], true); rawoutput(""); $line = sprintf($installstr, $row['installedby']); output_notl("%s", $row['installdate']); rawoutput("
"); output_notl("%s", $line); rawoutput("

"); $activate = translate_inline("Activate"); $deactivate = translate_inline("Deactivate"); $reinstall = translate_inline("Reinstall"); $uninstall = translate_inline("Uninstall"); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput("
"); } else { $sorting=httpget('sorting'); if (!$sorting) $sorting="shortname"; $order=httpget('order'); output("`bUninstalled Modules`b`n"); $install = translate_inline("Install"); $mname = translate_inline("Module Name"); $ops = translate_inline("Ops"); $mauth = translate_inline("Module Author"); $categ = translate_inline("Category"); $fname = translate_inline("Filename"); rawoutput("
"); addnav("","modules.php?op=mass&cat=$cat"); rawoutput("",true); rawoutput(""); addnav("","modules.php?sorting=name&order=".($sorting=="name"?!$order:0)); addnav("","modules.php?sorting=author&order=".($sorting=="author"?!$order:0)); addnav("","modules.php?sorting=category&order=".($sorting=="category"?!$order:0)); addnav("","modules.php?sorting=shortname&order=".($sorting=="shortname"?!$order:0)); if (count($uninstmodules) > 0) { $count = 0; $moduleinfo=array(); $sortby=array(); $numberarray=array(); $invalidmodule = array( "version"=>"", "author"=>"", "category"=>"", "download"=>"", "invalid"=>true, ); foreach($uninstmodules as $key=>$shortname) { //test if the file is a valid module or a lib file/whatever that got in, maybe even malcode that does not have module form $shortnamelower = strtolower($shortname); $file = strtolower(file_get_contents("modules/$shortname.php")); if (strpos($file,$shortnamelower."_getmoduleinfo")===false || //strpos($file,$shortname."_dohook")===false || //do_hook is not a necessity strpos($file,$shortnamelower."_install")===false || strpos($file,$shortnamelower."_uninstall")===false) { //here the files has neither do_hook nor getinfo, which means it won't execute as a module here --> block it + notify the admin who is the manage modules section $temp=array_merge($invalidmodule,array("name"=>$shortname.".php ".appoencode(translate_inline("(`\$Invalid Module! Contact Author or check file!`0)")))); } else { $temp= get_module_info($shortname); } //end of testing if (!$temp || empty($temp)) continue; $temp['shortname']=$shortname; array_push($moduleinfo,$temp); array_push($sortby,full_sanitize($temp[$sorting])); array_push($numberarray,$count); $count++; } array_multisort($sortby,($order?SORT_DESC:SORT_ASC),$numberarray,($order?SORT_DESC:SORT_ASC)); for ($a=0;$a"); if (isset($moduleinfo[$i]['invalid']) && $moduleinfo[$i]['invalid']===true) { rawoutput(""); } else { rawoutput(""); rawoutput(""); addnav("","modules.php?op=install&module={$moduleinfo[$i]['shortname']}&cat={$moduleinfo[$i]['category']}"); } rawoutput(""); rawoutput(""); if (isset($moduleinfo[$i]['requires']) && count($moduleinfo[$i]['requires'])){ rawoutput(""); rawoutput(""); rawoutput(""); rawoutput(""); } $count++; } } else { rawoutput(""); } rawoutput("
 $ops$mname$mauth$categ$fname
"); output("Not installable"); rawoutput(""); rawoutput("[ "); output_notl($install); rawoutput("]"); rawoutput($moduleinfo[$i]['name']." ".$moduleinfo[$i]['version']); rawoutput(""); output_notl("`#%s`0", $moduleinfo[$i]['author'], true); rawoutput(""); rawoutput($moduleinfo[$i]['category']); rawoutput(""); rawoutput($moduleinfo[$i]['shortname'] . ".php"); rawoutput("
 "); output("`bRequires:`b`n"); reset($moduleinfo[$i]['requires']); while (list($key,$val)=each($moduleinfo[$i]['requires'])){ $info = explode("|",$val); if (module_check_requirements(array($key=>$val))){ output_notl("`@"); }else{ output_notl("`\$"); } if(isset($info[1])) output_notl("$key {$info[0]} -- {$info[1]}`n"); else output_notl("$key {$info[0]}`n"); } rawoutput("
"); output("`i--No uninstalled modules were found--`i"); rawoutput("

"); $install = translate_inline("Install"); rawoutput(""); } } page_footer(); ?>