Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 04:37 pm EST

Geeklog Forums

Other site errors


Status: offline

Eddy

Forum User
Newbie
Registered: 10/18/02
Posts: 10
Hi, I just want to know is it possible for me to use 404 as guide for other error pages such as 401, 403 and 500. Because I want to have consistency for all pages including my error pages. Since you have made 404.php for 404 errors, is it possible to change for other errors and direct the ErrorDocument handler to the pages? Will it load the site template and layout? Or is it just made for 404? Php n00bie, sorry. TIA, Eddy
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Sure, that should work. bye, Dirk
 Quote

Status: offline

Eddy

Forum User
Newbie
Registered: 10/18/02
Posts: 10
Hi Dirk, Ermm basically how do I edit the stuff inside 404.php -- <?php require_once('lib-common.php'); $display = COM_siteHeader('menu'); $display .= COM_startBlock($LANG_404[1]); $display .= $LANG_404[2]; $display .= $LANG_404[3]; $display .= COM_endBlock(); $display .= COM_siteFooter(); echo $display ?> -- Basically I get the idea it takes from the language file array 1,2 and 3 but what if I want to customize and put in a lot of html coding after $display .= COM_startBlock($LANG_404[1]); and before $display .= COM_endBlock(); ? Not quite sure how to do this. Thanx! Eddy
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can do whatever you want in that file. The COM_xxx functions just provide the framework. COM_siteHeader() builds the header part (logo, menu bar) and the left block), COM_startBlock() starts a block (the argument to the function is used as the block title), etc. In case of the 404.php, we just pull a couple of text strings from the language file, but you could do more complex things there. bye, Dirk
 Quote

Status: offline

Eddy

Forum User
Newbie
Registered: 10/18/02
Posts: 10
Dirk, I appreciate your prompt reply a lot. I'm just so in love with geeklog that I gotta have my error pages rendered easily with calling the lib-common. But unfortunately, I know nothing about PHP so I am kinda confused how to edit... but being me who is adventurous I tried playing around with the coding like below and it worked, but I would like to know is this correct or is there supposed to be a real correct way. <?php require_once('lib-common.php'); $display = COM_siteHeader('menu'); $display .= COM_startBlock($LANG_404[1]); echo $display ?> <table width="100%" border="0" align="center"> <tr> <td> Hope this works... </td> </tr> </table> <?php require_once('lib-common.php'); $display2 = COM_endBlock(); $display2 .= COM_siteFooter(); echo $display2 ?> Hehe, my first time actually playing around with the codings, so pls don't laugh if there's a mistake or two Razz. Thx heaps, Eddy
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yeah, this should work. You don't need the second require_once(), btw. bye, Dirk
 Quote

Anonymous

Anonymous
Better to do <?php require_once('lib-common.php'); $display = COM_siteHeader('menu'); $display .= COM_startBlock("Page title"Wink; $display .= <<<EOT <table width="100%" border="0" align="center"> <tr> <td> Hope this works... </td> </tr> </table> EOT; $display2 .= COM_endBlock(); $display2 .= COM_siteFooter(); echo $display2 ?> Note, if you use 'COM_siteFooter(true);' you will get the right hand blocks.
 Quote

All times are EST. The time is now 04:37 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content