<?// here i will check if there are files in "dat" directory. //They must be named from "0.html". Nukber of files will be // put into "numfs" variable. int numfs=0; for(; ppc.read_file(datname(numfs))!="" ;numfs++); ?> <?// functions: // 'datname' returns name of entry-file in "dat" directory string datname(int nn){ return "dat/"+ppc.string(nn)+".html"; } string answname(int nn){ return "dat/"+ppc.string(nn)+"-answ.html"; } // global background color: global string bgcolor="#aaabcc"; // opening table void openTableX(string ocolor, string icolor, int wid=100){?> <table width='<?=wid?>%' border=0 bgcolor='<?=ocolor?>' cellpadding=0 cellspacing=0><tr><td align=middle valign=middle> <table width='99%' border=0 bgcolor='<?=icolor?>' cellpadding=0 cellspacing=0><tr><td> <?} // variants of opening tables: void openTableA(){openTableX("#444446", bgcolor);} void openTableB(){openTableX("#777788", bgcolor);} void openTableC(int wid=100){openTableX("#226633", "#ccccff", wid);} void openTableD(int wid=100){openTableX("#663399", "#ccffcc", wid);} // closing table: void closeTable(){?></td></tr></table></td></tr></table><?}?> <head> <style> body { font-family: Arial; font-size: 12; background:<?=bgcolor?>; color: black; } .isbig { font-family: Arial; font-size: 20; color: #111144; font-weight:bold } .issmall { font-family: Arial; font-size: 8; color: gray; font-weight:bold} .entryA { font-family: Arial; font-size: 12; color: #112233; } .entry { background:<?=bgcolor?>;font-family: Arial; font-size: 10; color: #114422; } .entryH { font-family: Arial; font-size: 12; color: #354132; font-weight:bold} .answer { font-family: Arial; font-size: 12; color: #664132; font-weight:bold } .isoth { font-family: Arial; font-size: 12; color: #444444; } b { font-family: Arial; font-size: 12; color: #003300; font-weight:bold } a { font-family: Arial; font-size: 12; color: #222233; font-weight:bold; } a:hover { font-family: Arial; font-size: 12; color: #882244; font-weight:bold; text-decoration:none; } </style> <?string title="Simple ppC++ Guestbook"?> <title><?=title?></title> </head> <body> <?openTableA()?> <?openTableB()?> <hr width='77%'><hr> <center><span class=isbig><?=title?></span><br></center> <hr><hr width='77%'> <?closeTable()?> <?#include <dirent.h> ?> |