/[libdata]/trunk/publish.phtml
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/publish.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (show annotations)
Thu Mar 18 20:33:37 2004 UTC (20 years ago) by dpavlin
File size: 987 byte(s)
changes made in version 2.00

1 <?php
2 // Load globals
3 require_once ("global_vars.php");
4
5 // Includes
6 require_once ("db_connect.php");
7 require_once ("public_controls.php");
8
9 // Cast as integer to be sure
10 $page_id = (int) $page_id;
11
12 // Error flag
13 $err_code = 0;
14
15 // Continue only if we now have a valid page
16 if ($page_id > 0 ) {
17
18 // Check to see if it exists first
19 $exists = 0;
20 $exists = existsRow("page", "page_id", $page_id);
21
22 if ($exists > 0) {
23
24 // Build the SQL to extract the static snapshot
25 $sql = "SELECT pageHTML from page WHERE page_id = " . $page_id;
26 $rs = xx_tryquery($sql);
27 $row = xx_fetch_array ($rs, xx_ASSOC);
28
29 // Fetch data
30 $pageHTML = $row["pageHTML"];
31
32 // Dump the page
33 if (strlen($pageHTML) > 0) printf("%s", $pageHTML);
34 else $err_code = 1; // No data. Unpublished page?
35 }
36 else $err_code = 2; // Page ID doesn't exist.
37 }
38
39 else $err_code = 3; // Invalid incoming page ID.
40
41
42 // Generic error message. May be customized.
43 if ($err_code > 0) {
44
45 printf("Page not found...");
46
47 }
48 ?>

  ViewVC Help
Powered by ViewVC 1.1.26