OSI-Certified logo

Source code of file listing.php
from the Content Management module for Phprojekt.

<?php
// Content Management System module for PHProjekt (CMS4P).
// Copyright 2002-2005 by Mario A. Valdez-Ramirez
// http://www.mariovaldez.net/

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, 
// Boston, MA 02111-1307, USA.

// You can contact Mario A. Valdez-Ramirez by email 
// at mario@mariovaldez.org or paper mail at 
// Olmos 809, San Nicolas, NL. 66495, Mexico.

//session_start();
$path_pre="../";
include_once (
$path_pre "cm/cm_anon.inc.php");
$include_path $path_pre "lib/lib.inc.php";
include_once 
$include_path;
include_once (
$path_pre "cm/cm_lib.inc.php");
fcm_load_secdb ($cm_security);
echo 
$cm_html_header;


function 
cm_display_dirleafs ($cm_parentdir$cm_level$cm_liststyle$cm_hidedetails) {
  global 
$cm_text$cm_imgpath$user_kurz$cm_dirlist_iconheight$cm_dirlist_iconwidth$cm_image_filename$cm_icon_set;
  if (
$cm_level == 0) {
    echo 
"<p class=\"generaltext\" align=\"right\">";
    echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=$cm_liststyle&cm_hdet=$cm_hidedetails\">{$cm_text["listreload"]}</a> | ";
    if (
$cm_hidedetails) {
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=$cm_liststyle&cm_hdet=0\">{$cm_text["showdetails"]}</a><br>";
    }
    else {
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=$cm_liststyle&cm_hdet=1\">{$cm_text["hidedetails"]}</a><br>";
    }

    if (
$cm_liststyle == 0)
      echo 
"{$cm_text["showstitle"]} | ";
    else
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=0&cm_hdet=$cm_hidedetails\">{$cm_text["showstitle"]}</a> | ";
    if (
$cm_liststyle == 1)
      echo 
"{$cm_text["showspath"]} | ";
    else
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=1&cm_hdet=$cm_hidedetails\">{$cm_text["showspath"]}</a> | ";
    if (
$cm_liststyle == 2)
      echo 
"{$cm_text["showtitle"]} | ";
    else
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=2&cm_hdet=$cm_hidedetails\">{$cm_text["showtitle"]}</a> | ";
    if (
$cm_liststyle == 3)
      echo 
"{$cm_text["showpaths"]} ";
    else
      echo 
"<A class=\"cms\" HREF=\"listing.php?cm_path=$cm_parentdir&cm_fdn=3&cm_hdet=$cm_hidedetails\">{$cm_text["showpaths"]}</a> ";

    echo 
"<br><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_open"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"> {$cm_text["opendir"]} ";
    echo 
"<img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_closed"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"> {$cm_text["closeddir"]} ";
    echo 
"<img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_edit"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"> {$cm_text["caneditdir"]} ";
    echo 
"</p>";
    echo 
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";
    echo 
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><TR>\n";
    echo 
"<TD class=\"dirlist1\"><img src=\"$cm_imgpath/t.gif\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"1\" border=\"0\"></TD>\n";
    echo 
"<TD class=\"dirlist1\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_root"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"><A class=\"cms\" HREF=\"display.php?cm_path=$cm_parentdir\">" $cm_parentdir "</a></TD>\n";
    echo 
"</TR></TABLE>\n";
    echo 
"</td>";
    if (!
$cm_hidedetails)
      echo 
"<td colspan=\"8\" class=\"dirlist2\">{$cm_text["listdetails"]}</td>";
    echo 
"</tr>";
  }
  
$cm_level++;
  
$cm_curdisname "";
  
$result1 db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_owner_user, cmdb_viewer_group, cmdb_type, cmdb_short_title, cmdb_rated, cmdb_commented, cmdb_enable_html from " CM_DB_PREFIX "content3 where cmdb_parentdir like '$cm_parentdir' and cmdb_type like '%" CM_HITTYPE_PAGE "%' order by cmdb_directory asc") or db_die();
  while (
$row1 db_fetch_row($result1)) {
    echo 
"<tr><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><TR>";
    echo 
str_repeat ("<TD class=\"dirlist1\"><img src=\"$cm_imgpath/t.gif\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"1\" border=\"0\"></TD>\n"$cm_level);
    echo 
"<TD class=\"dirlist1\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_branch"]}\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"></TD>\n";
    if (
$cm_liststyle == 2) {
      
$cm_curdisname $row1[0];
    }
    elseif (
$cm_liststyle == 3) {
      
$cm_curdisname $row1[1];
    }
    elseif (
$cm_liststyle == 0) {
      
$cm_curdisname $row1[8];
    }
    elseif (
$cm_liststyle == 1) {
      
$cm_curdisname substr (strrchr ($row1[1], "/"), 1);
    }
    if (
fcm_check_constraints (CM_SEC_CHANGE$user_kurz$row1[1])) {
      echo 
"<TD class=\"dirlist1\"><A class=\"cms\" HREF=\"display.php?cm_path=$row1[1]\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_edit"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"></A>\n";
      echo 
"<A class=\"cms\" HREF=\"display.php?cm_path=$row1[1]\">$cm_curdisname</A> ";
    }
    elseif (
fcm_check_constraints (CM_SEC_DISPLA$user_kurz$row1[1])) {
      if (
stristr ($row1[7], CM_HITTYPE_CONTENTLESS)) {
        echo 
"<TD class=\"dirlist1\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_open"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\">\n";
        echo 
"$cm_curdisname ";
      }
      else {
        echo 
"<TD class=\"dirlist1\"><A class=\"cms\" HREF=\"display.php?cm_path=$row1[1]\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_open"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\"></A>\n";
        echo 
"<A class=\"cms\" HREF=\"display.php?cm_path=$row1[1]\">$cm_curdisname</A> ";
      }
    }
    else {
      echo 
"<TD class=\"dirlist1\"><img src=\"$cm_imgpath/{$cm_image_filename[$cm_icon_set]["folder_closed"]}\" align=\"middle\" alt=\"\" width=\"$cm_dirlist_iconwidth\" height=\"$cm_dirlist_iconheight\" border=\"0\" class=\"pngimg\">\n";
      echo 
"$cm_curdisname ";
    }
    echo 
"</TD></TR></TABLE></td>\n";
    if (!
$cm_hidedetails) {
      echo 
"<td class=\"dirlist2\">";
      echo 
substr ($row1[4], 010);
      echo 
"</td><td class=\"dirlist2\">";
      echo 
$row1[5];
      echo 
"</td><td class=\"dirlist2\">";
      echo 
$row1[6];
      echo 
"</td><td class=\"dirlist2\">";
      echo 
$row1[9] ? " + " "- ";
      echo 
"</td><td class=\"dirlist2\">";
      echo 
$row1[10] ? " + " "- ";
      echo 
"</td><td class=\"dirlist2\">";
      echo 
$row1[11] ? " + " "- ";
      echo 
"</td><td class=\"dirlist2\">";
      echo (
stristr ($row1[7], CM_HITTYPE_CONTENTLESS)) ? " + " " - ";
      echo 
"</td><td class=\"dirlist2\">";
      echo (
stristr ($row1[7], CM_HITTYPE_ANNOUNCE)) ? " + " " - ";
      echo 
"</td>";
    }
    echo 
"</tr>";
    
cm_display_dirleafs ($row1[1], $cm_level$cm_liststyle$cm_hidedetails);
  }
  if (
$cm_level == 0) {
    echo 
"</TABLE>\n";
  }
};




if (!
$cm_path) {
  
$cm_path "/";
}
if (!
$cm_fdn) {
  
$cm_fdn 0;
}
if (!
$cm_hdet) {
  
$cm_hdet 0;
}

$cm_pppos strrpos ($cm_path"/");
if (
$cm_pppos == 0) {
  
$cm_tl_path "/";
}
else {
  
$cm_tl_path substr ($cm_path0$cm_pppos);
}

$cm_validops fcm_check_validops ($user_kurz$cm_path);
fcm_title_nav2 ($cm_pathfalsefalsefalsefalsefalsefalsefalse);

cm_display_dirleafs ($cm_path0$cm_fdn$cm_hdet);

echo 
$cm_html_footer;

?>

 
 
NA fum/lmd: 2004.09.16
Copyright ©1994-2018 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link