admin > Preferences Main > General Settings
Debug mode (enable inline mode)
see an error message at the base of the page?
Also I only tested this on Apache on Linux.
$numberImagesShown = in_array(12,$group) ? 15 : 10; // groupID 12 gets 15 images in their dir
// site directories
if (isset($_REQUEST['imgcat_id'])){ // POST or GET
$showPulldown = 'yes';
$numberImagesShown = 15;
$imgcat_handler =& xoops_gethandler('imagecategory');
$catlist =& $imgcat_handler->getList($group, 'imgcat_read', 1);
$currentcat_id = intval($_REQUEST['imgcat_id']);
$imgcatname = $catlist[$currentcat_id];
$cleanimgcatname = preg_replace("/[^a-z0-9\.\-\_]/i", '_' ,$imgcatname); //replace odd characters with underscore
$userID = $xoopsUser->getVar('uid');
$userIDcode = str_pad($userID, 5, "0", STR_PAD_LEFT); // always have 5 digits ie: userid 123 becomes 00123
$activeDir = XOOPS_UPLOAD_PATH.'/'.$cleanimgcatname;
}
// or user's directory
if ( (!isset($_GET['imgcat_id']) && !isset($_POST['imgcat_id']) ) || $imgcatname == 'User Images'){
$showPulldown = 'no';
$numberImagesShown = in_array($group,12) ? 10 : 15; // groupID 12 gets 15 images in their dir
$userID = $xoopsUser->getVar('uid');
$userIDcode = str_pad($userID, 5, "0", STR_PAD_LEFT); // always have 5 digits ie: userid 123 becomes 00123
$userDir = 'user_'.$userIDcode; // this is the folder in uploads dir for this user ie: user_00123
$activeDir = XOOPS_UPLOAD_PATH.'/'.$userDir;
}
// create directory if not existing
if (!file_exists($activeDir)){
mkdir($activeDir, 0700);
// add an htaccess file to prevent script and non-image files being accessed...
$filename = $activeDir.'/.htaccess';
$fh = fopen($filename, 'w');
$stringData = "AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgin";
$stringData .= "Options -ExecCGIn";
$stringData .= "Order Deny,Allown";
$stringData .= "Deny from alln";
$stringData .= "<FilesMatch '.(gif|jpe?g|png)$'>n";
$stringData .= "Allow from alln";
$stringData .= "</FilesMatch>n";
$stringData .= "Options -Indexesn"; // prevent browsing users dir
fwrite($fh, $stringData);
fclose($fh);
chmod($filename, 0400);
}
}