Skip Navigation

www.wimb.net - Page Setup



Page setup

The page setup operates in the same way as the section setup; all the variables are stored in a file. It means indeed that each page has its own file with that contains the variable for that page.

In fact for each page there are two files: the page setup file and the page content file.

These files do have all the same name system for the different sections, they are placed in different section directories. When an other section is viewed, then the directory is changed, so the same filenames can be used.
The filename is made as below:

subtitle + section page number + .txt => subtitle0.txt

This does nothing more then inserting some variables in the main index.php file.

<?php
   $subtitle  = 'Page Setup';
   $lengte    = 0;  // can be used to make longer pages
   $keywords  = '<meta name="keywords" content="about my site" /?>';
   $descript  = '<meta name="description" content="description" /?>';
   $favicon   = '<link rel="shortcut icon" href="aboutmysite.ico" /?>';
   $generator = '<meta name="generator" content="WHP version 1.1" /?>';
   $pagetitle = '<title?>Page Setup - About my site - www.wimb.net</title?>';
?>


Page contents

Also these files are stored in the section directories, but they do have different names. I was too afraid that something got mixed-up and some of them got lost. The actual filename comes from the page setup file.

$contents = 'homepage'.$pagenbr.'.txt'; // contents filename

Example for the homepage: homepage0.txt

The file itself starts with a <div class="txtimg"> tag and all the rest is put in this or in some more divs.

If the page number is not correct then page 0 is selected.

So, if all data is wrong, then the home page is always selected.

How does it work?
As mentioned before, the section and page number can be found after the URL;

index.php?section=home&page=0

The section name is lookup in a string, when found, the position divided by 6 is the section number. When not found the section number becomes1, the number of the home section.

// special way to verify if the section name is OK
// section nbr: 0 1 2 3 4 5 6 etc...
$allsections = 'homexxhomexxdelphitycoonmotionfilesxlinksx';
$section = strpos($allsections,($_GET['s'])) / 6;
if ($section < '1' ){
$section = 1;
}
$pagenbr=$_GET['page']; // get the page number

$pageid = ($section * 1000) + $page; // Page ID, unique number for each page

echo '<!-- Section and page = '.$pageid." -->\r\n";

$logosrc="homelogo".$section.".gif";
$iconsrc="homeicon".$section.".gif";

When once the section and the page are known, then it is simple to put the right stuff in the page. Each section has its own logo. The name is made by putting the number in the name. Here the "homelogo" is made.


$logosrc="homelogo".$section.".gif";

NedStat Counters
This site uses several NEDSTAT counters. They are called with an "include" statement. First a variable "$pageid" is calculated from the section number and the page number:

$pageid = ($sectionnbr * 1000) + $pagenbr; // Page ID, unique number for each page
echo '<!-- Section and pagenbr = '.$pageid." -->\r\n";

Then, at the end of the page, the counter is included:

<?php // ------------ the include section for the nedstat counters ------------
// load automatically good counter
if (file_exists('include/nedstat'.$pageid.'.txt')) {
   include('include/nedstat'.$pageid.'.txt');
}
?>



File name            Description
site_search.txt      Search input at top of all pages
js_routines.txt      JavaScript routines
menudelphi_1.txt     Full Delphi menu
menudelphi_2.txt     Short Delphi menu
menuhome_1.txt       Full Home menu
menulow1.txt         menu at the bottom
menumotion_2.txt     Short Motion menu
menutycoon_1.txt     Full Tycoon menu
nedstat1000.txt      Home Section counter
nedstat5000.txt      File Section Counter
sec_setup1.txt       Home Section setup
sec_setup2.txt       Delphi Section setup
sec_setup3.txt       Tycoon Section setup
sec_setup4.txt       Motion Section setup
sec_setup5.txt       File Section setup
sec_setup6.txt       Link Section setup
PID: 7004 CLT: 0.001 LMD: 2013-Aug-17

Updated 2007 Oct. 09