/[pliva-si]/back/news/detail.php
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 /back/news/detail.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri Jun 29 14:11:50 2001 UTC (22 years, 10 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
news back-end

1 <?
2 include_once( "global.php" );
3 include_once( "dbconnect.php" );
4 include_once( "$phormationdir/form.php" );
5 include_once( "$phormationdir/file_upload.php" );
6
7 function html_before_form()
8 {
9 ?>
10 <HTML>
11 <HEAD>
12 <link rel="stylesheet" type="text/css" href="styles.css">
13 </HEAD>
14 <BODY bgcolor="#FFFFFF">
15 <?
16 }
17 function html_after_form()
18 {
19 ?>
20 </BODY>
21 </HTML>
22 <?
23 }
24
25 $opts = array();
26 $opts["delete_hook"] = "my_delete_fcn";
27 $url = array();
28 $url["home"] = "index.php";
29
30 function my_delete_fcn( $tablename, $tablekey, $record_id )
31 {
32 // since we also have to delete a photo when we delete this record,
33 // we write a short function to do this. We pass the name of this function
34 // to Phormation in the "opts" array, so that it will call this
35 // function instead of its own function for deleting the record
36 $query = "select pic from news where id = $record_id";
37 $result = pg_exec( $query );
38 if( $result ) {
39 $array = pg_fetch_array( $result, 0 );
40 $filename = "$dir/".trim( $array[0] );
41 @unlink( "$comm_dir/".trim( $array[0] ));
42 @unlink( "$more_dir/".trim( $array[0] ));
43 @unlink( "$pdf_dir/".trim( $array[0] ));
44 }
45
46 // now we call phormation's delete function to delete the database
47 // record
48 deleterecord( $tablename, $tablekey, $record_id );
49 }
50
51 form_main( "news", "id", $fields, $names, $types, $record_id, $url, $opts );
52 ?>

  ViewVC Help
Powered by ViewVC 1.1.26