allimgs.php to HTML

index

USE AT OWN RISK

Generated: Tue Jul 31 15:21:59 2007 from allimgs.php 2006/02/01 3.9 KB bytes.


<html>

<head>
<meta http-equiv='Content-Type'>

<title>allimgs.php</title>

</head>

<body bgcolor="#0066cc">

<?php 
// this could be set from say a 'global.php' include ... which sets ...
$m_folder = 'images/.'; // set the images folder
$m_page = 0;
// $m_page = 8;
$m_case = 'flowers';
// $m_case = 'family';
$m_type = '*'; // '*' matches ALL (was '?'), assuming 'asterisk' allowed as param?
// $m_type = 'a'; // '*' matches ALL (was '?'), assuming 'asterisk' allowed as param?
$m_row_wrap = 3;
$m_max_out = 9;
// variables below filled in during running ...
$m_mostcnt = 0;
$m_mostrec = 0; // a file date time ... something, since the beginning of *nix!
$m_mostnam = ' ';
$m_mostarr = array();
$m_msg = ' ';

// get the page value, if any
if (isset($_GET['page'])) { $m_page = $_GET['page']; }
// get the case value
if (isset($_GET['case'])) { $m_case = $_GET['case']; }
if (isset($_GET['type'])) { $m_type = $_GET['type']; }
if (isset($_GET['wrap'])) { $m_row_wrap = $_GET['wrap']; }
if (isset($_GET['max'])) { $m_max_out = $_GET['max']; }

// menu adjustments ...
if ($m_case == 'family') {
   // set DEFAULT for 'family' display
   $m_row_wrap = 5;
   $m_max_out = 10;
}
$m_n_case = 'family';
if ($m_case == 'family') {
 $m_n_case = 'flowers';
}

$m_params = "case=$m_case type=$m_type wrap=$m_row_wrap max=$m_max_out page=$m_page";

include ( "phpinc3.php" );

function add_h1_center ( $m ) {
   return "<h1 align='center'>".$m."</h1>\r\n";
}

// start HTML output
print add_h1_center( add_bounds(get_self_d('allimgs.php')) . " $m_params" );

// out_the_menu2 ();
//if ( $m_case == 'family' ) {
//   getDirListDSC ($m_folder, &$m_mostrec, &$m_mostnam, &$m_mostcnt, &$m_mostarr, $m_type );
//} else {
//   // default is 'flowers'!
//   getDirList2 ($m_folder, &$m_mostrec, &$m_mostnam, &$m_mostcnt, &$m_mostarr, $m_type );
//}
getImageList ();

// the directory, folder SCAN has been done ... the necessary 'files' have been collected
// sanity CHECK only
$imx = count ($m_mostarr);
if ($imx != $m_mostcnt) {
   print "<h1 align='center'>note: imx=$imx not equal m_mostcnt=$m_mostcnt sanity exceeded!</h1>\r\n";
}
// note: this imx count should/must equal $m_mostcnt, but NOT USED information

if ($imx > 0) {
   // we have FOUND an image count ... of this or that 'case' ... calculate PAGES available ...
   // establish PAGE menu ********************************************************************
   $mx_ot = $m_max_out;
   if ($mx_ot == -1) {
   $mx_ot = $imx;
   }
   $pgs = $imx / $mx_ot;
   settype($pgs, "int"); // reduce it to an integer 
   if ($imx % $mx_ot) { $pgs++; } // bump for any 'remainder' ...
   if ($pgs == 0) { $pgs++; } // make sure, at least ONE page ...
   if ($m_page > 0) { // ok, we WANT to display, GREATER than the LATEST page - rows x cols = max
   if ($m_max_out == -1) {
   // this is ALL ... overrides a PAGE display
   $m_page = 0; // set ZERO PAGE
   } elseif ($m_max_out > 0) {
   if ($m_page > $pgs ) { // can NOT have this
   $m_page = $pgs; // set the LAST PAGE DISPLAY
   }
   }
   }
   $msg = '<p align="center">Pages ';
   $msg .= "($pgs x $m_max_out): ";
   for ($i = 0; $i < $pgs; $i++) {
   if ( $m_page == $i ) {
   $msg .= '<b>' . add_bounds( $i ) . '</b>';
   } else {
   $msg .= add_href_page ( $i );
   }
   $msg .= " \r\n";
   }
   $msg .= '</p>';
   print add_g_span($msg)."\r\n"; // output the PAGES available ...
}


$d_msg = ordDirList2 ();

// $m_msg = add_g_span(add_p_center(get_case_menu()));
// print "$m_msg\r\n";

$m_msg = add_g_span(add_p_center(get_array_menu () .'<br>'. get_day_menu() .'<br>'. get_case_menu() ));
print "$m_msg\r\n";

$m_msg = add_g_span(add_p_center( get_curr_link(add_bold('Refresh')) . add_bounds(get_index_link()) ));
print "$m_msg\r\n";

print "$d_msg\r\n";

out_the_menu2 ();

?>

<p>
End of allimgs.php
</p>

</body>
</html>

<!-- 12 August 2005 - allimgs.php Version 0.0.1 - macpcfirstaid.com - grm -->
 

index

Valid HTML 4.01 Transitional