Posted: Thu 2. Mar 2006, 16:42
Die neuen Screenshots stammen schon aus der v2!
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
yesyesyesphalancs wrote:- custom redirect depending on the group of the user
Code: Select all
// -------------------------------------------------------------
function get_struct_data ($dbcon, $root_name="Home", $root_info="") {
//returns the complete active and public struct data as array
//so it is reusable by many menu functions -> lower db access
//struct array caching check
//if(file_exists(PHPWCMS_TEMP.'temp_struct_array.php')) {
//} else {
$data[0] = array( "acat_id" => 0,
"acat_name" => $GLOBALS['indexpage']['acat_name'],
"acat_info" => $GLOBALS['indexpage']['acat_info'],
"acat_struct" => 0,
"acat_sort" => 0,
"acat_hidden" => intval($GLOBALS['indexpage']['acat_hidden']),
"acat_regonly" => intval($GLOBALS['indexpage']['acat_regonly']),
"acat_ssl" => intval($GLOBALS['indexpage']['acat_ssl']),
"acat_template" => intval($GLOBALS['indexpage']['acat_template']),
"acat_alias" => $GLOBALS['indexpage']['acat_alias'],
"acat_topcount" => intval($GLOBALS['indexpage']['acat_topcount']),
"acat_redirect" => $GLOBALS['indexpage']['acat_redirect'],
"acat_order" => intval($GLOBALS['indexpage']['acat_order']),
"acat_timeout" => $GLOBALS['indexpage']['acat_timeout'],
"acat_nosearch" => $GLOBALS['indexpage']['acat_nosearch'],
"acat_nositemap"=> $GLOBALS['indexpage']['acat_nositemap'],
"acat_permit" => !empty($GLOBALS['indexpage']['acat_permit']) && is_array($GLOBALS['indexpage']['acat_permit']) ? $GLOBALS['indexpage']['acat_permit'] : array()
);
$sql = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecat WHERE ";
// VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode
if(VISIBLE_MODE != 2) {
// for 0 AND 1
$sql .= "acat_aktiv=1 AND acat_public=1 AND ";
}
$sql .= "acat_trash=0 ORDER BY acat_struct, acat_sort;";
if($result = mysql_query($sql, $dbcon)) {
while($row = mysql_fetch_assoc($result)) {
//PWmod
$permissioncheck = !$row["acat_permit"] ? 1 : 0;
if (isset($_SESSION["wcs_user_id"]) AND $row["acat_permit"]) {
$temparray = explode(',', $row["acat_permit"]);
foreach($temparray as $value) {
if ($_SESSION["wcs_user_id"] == $value) {
$permissioncheck = 1;
break;
}
}
}
if ($permissioncheck == 1) {
$data[$row["acat_id"]] = array( "acat_id" => $row["acat_id"],
"acat_name" => $row["acat_name"],
"acat_info" => $row["acat_info"],
"acat_struct" => $row["acat_struct"],
"acat_sort" => $row["acat_sort"],
"acat_hidden" => $row["acat_hidden"],
"acat_regonly" => $row["acat_regonly"],
"acat_ssl" => $row["acat_ssl"],
"acat_template" => $row["acat_template"],
"acat_alias" => $row["acat_alias"],
"acat_topcount" => $row["acat_topcount"],
"acat_redirect" => $row["acat_redirect"],
"acat_order" => $row["acat_order"],
"acat_timeout" => $row["acat_cache"],
"acat_nosearch" => $row["acat_nosearch"],
"acat_nositemap"=> $row["acat_nositemap"],
"acat_permit" => !empty($row["acat_permit"]) ? explode(',', $row["acat_permit"]) : array()
);
}
//End PWmod
mysql_free_result($result);
}
//}
return (is_array($data) && count($data)) ? $data : array();
}
// -------------------------------------------------------------
The above blue arrow points to something that ~looks~ out of place. Is that the correct location ? (I haven't looked into mod).StudioZ wrote:explode(',', $row["acat_permit"]) : array()
-------------------------------------------------------> );
}
//End PWmod
mysql_free_result($result);
}
//}
return (is_array($data) && count($data)) ? $data : array();
}
// -------------------------------------------------------------[/code]
Cheers,
phalancs wrote:Hey Studio!
I give you mine:
http://www.enym.com/front.func.inc.rar
hope it works for you then!
Code: Select all
203 => $BL['be_ctype_login'],