"/")) && (fcm_can_becommented ($cm_path) || $cm_historical_comments)) {
$cm_total_comments = 0;
if ($cm_comments_chronorder) {
$result1 = db_query("select cmdb_directory, cmdb_title, cmdb_author_user, cmdb_date_creation, cmdb_comment, id from " . CM_DB_PREFIX . "cmcomments3 where cmdb_directory like '$cm_path' order by id asc") or db_die();
}
else {
$result1 = db_query("select cmdb_directory, cmdb_title, cmdb_author_user, cmdb_date_creation, cmdb_comment, id from " . CM_DB_PREFIX . "cmcomments3 where cmdb_directory like '$cm_path' order by id desc") or db_die();
}
while ($row1 = db_fetch_row ($result1)) {
$cm_authornames = fcm_user_names ($row1[2]);
echo "
";
echo fcm_process_markup ($row1[4], $cm_path, false);
$cm_total_comments++;
}
echo "
";
}
};
if ($cm_path) {
$result1 = db_query("select cmdb_title, cmdb_directory, cmdb_content, cmdb_abstract, cmdb_keywords, cmdb_author_user, cmdb_owner_user, cmdb_viewer_group, cmdb_date_creation, cmdb_date_update, cmdb_type from " . CM_DB_PREFIX . "content3 where cmdb_directory like '$cm_path' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%' order by upper(cmdb_title)") or db_die();
$row1 = db_fetch_row($result1);
if ($row1[1]) { // If this document exists and user has permission, render it...
if (fcm_check_constraints (CM_SEC_DISPLA, $user_kurz, $cm_path)) {
$cm_authornames = fcm_user_names ($row1[5]);
$cm_ownernames = fcm_user_names ($row1[6]);
$cm_groupnames = fcm_group_names ($row1[7]);
echo "" . fcm_curdate_string () . "
$cm_path
";
fcm_doc_txtsummary ($cm_authornames[1] . " " . $cm_authornames[2], $cm_ownernames[1] . " " . $cm_ownernames[2], $cm_groupnames[1], $row1[8], $row1[9], $row1[0], $row1[4], $row1[3], fcm_mark_visit ($cm_path, CM_HITTYPE_PAGE), fcm_get_updatehits ($cm_path, CM_HITTYPE_PAGE), fcm_getaverage_rating ($cm_path));
if (!stristr ($row1[10], CM_HITTYPE_CONTENTLESS)) {
if (fcm_can_usehtml ($cm_path)) {
if ($cm_enable_htmledit) {
echo fcm_process_markup (fcm_secure_html (fcm_decode_htmlfull ($row1[2])), $cm_path, true);
echo "
";
}
else {
echo fcm_process_markup (fcm_htmlentity (fcm_decode_html ($row1[2])), $cm_path, false);
}
}
else {
echo fcm_process_markup ($row1[2], $cm_path, false);
}
}
fcm_show_txtusercomments ($cm_path);
}
else {
fcm_message ($cm_text["needaccess2view"], CM_MSGSTYLE_WARNING);
}
}
else {
fcm_message ($cm_text["dirnotfound"], CM_MSGSTYLE_ERROR);
}
}
// if we are in the homepage...
else {
$cm_pppos = strrpos ($cm_path, "/");
if ($cm_pppos == 0) {
$cm_tl_path = "/";
}
else {
$cm_tl_path = substr ($cm_path, 0, $cm_pppos);
}
// search all root-level documents...
$result2 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_viewer_group, cmdb_type, cmdb_logo from " . CM_DB_PREFIX . "content3 where cmdb_parentdir = '$cm_tl_path' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%' " . fcm_access_sqldef ($user_kurz) . " order by upper(cmdb_title)") or db_die();
// display all root-level announces...
while ($row2 = db_fetch_row($result2)) {
if (stristr ($row2[6], CM_HITTYPE_ANNOUNCE)) {
fcm_articlelist_box ($row2[1], $row2[0], $row2[3], $row2[4], true, fcm_get_totalcomments ($row2[1]), fcm_get_totalhits ($row2[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row2[1]), fcm_is_cleditable ($row2[1], $user_kurz, $row2[6]), true, $row2[7], false);
}
}
// search all root-level documents...
$result2 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_viewer_group, cmdb_type, cmdb_logo from " . CM_DB_PREFIX . "content3 where cmdb_parentdir = '$cm_tl_path' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%' " . fcm_access_sqldef ($user_kurz) . " order by upper(cmdb_title)") or db_die();
// display all root-level non-announces...
while ($row2 = db_fetch_row($result2)) {
if (!stristr ($row2[6], CM_HITTYPE_ANNOUNCE)) {
fcm_articlelist_box ($row2[1], $row2[0], $row2[3], $row2[4], true, fcm_get_totalcomments ($row2[1]), fcm_get_totalhits ($row2[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row2[1]), fcm_is_cleditable ($row2[1], $user_kurz, $row2[6]), false, $row2[7], false);
}
// search for children documents (deep search), announce type...
$result3 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_type, cmdb_logo from " . CM_DB_PREFIX . "content3 where (cmdb_parentdir like '$row2[1]' or cmdb_parentdir like '$row2[1]/%') and cmdb_type like '%" . CM_HITTYPE_ANNOUNCE . "%' " . fcm_access_sqldef ($user_kurz) . " order by cmdb_date_update desc") or db_die();
$cm_rowcount = 1;
while ($row3 = db_fetch_row($result3)) {
//if ($cm_rowcount > $cm_home_maxleafs) {
// break;
//}
fcm_articlelist_box ($row3[1], $row3[0], $row3[3], $row3[4], false, fcm_get_totalcomments ($row3[1]), fcm_get_totalhits ($row3[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row3[1]), fcm_is_cleditable ($row3[1], $user_kurz, $row3[5]), true, $row3[6], false);
$cm_rowcount++;
}
// search for children documents (deep search), non-announces...
$result3 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_type, cmdb_logo from " . CM_DB_PREFIX . "content3 where (cmdb_parentdir like '$row2[1]' or cmdb_parentdir like '$row2[1]/%') and cmdb_type like '%" . CM_HITTYPE_PAGE . "%' and cmdb_type not like '%" . CM_HITTYPE_ANNOUNCE . "%' " . fcm_access_sqldef ($user_kurz) . " order by cmdb_date_update desc") or db_die();
while ($row3 = db_fetch_row($result3)) {
if ($cm_rowcount > $cm_home_maxleafs) {
break;
}
// display if the article is not too old or if we don't have the minimal...
if ((fcm_diffdate_days ($row3[4]) <= $cm_home_oldestleafallowed) || ($cm_rowcount <= $cm_home_minleafs)) {
fcm_articlelist_box ($row3[1], $row3[0], $row3[3], $row3[4], false, fcm_get_totalcomments ($row3[1]), fcm_get_totalhits ($row3[1], CM_HITTYPE_PAGE), fcm_getaverage_rating ($row3[1]), fcm_is_cleditable ($row3[1], $user_kurz, $row3[5]), false, $row3[6], false);
$cm_rowcount++;
}
else {
break;
}
}
}
echo "
";
}
echo $cm_print_footer;
?>