/[corp_html]/back/community/community_index.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/community/community_index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Mon Mar 12 19:15:37 2001 UTC (23 years, 2 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
unused

1 <?
2 include_once( "global.php" );
3 include_once( "dbconnect.php" );
4 include_once( "$phormationdir/displaytable.php" );
5
6
7 $params["query"] = "select id,title,date,body,pic from community";
8 $params["defaultsort"] = "id";
9 $params["editlink"] = "community_detail.php";
10 $params["newlink"] = "community_detail.php";
11 $params["addmultiplelink"] = "community_multi.php";
12 $params["delquery"] = "delete from community where id = ";
13 $params["predelete_hook"] = "my_predelete_fcn";
14 $params["key"] = "id";
15
16 function my_predelete_fcn( $record_id )
17 {
18 // since we also have to delete a photo when we delete this record,
19 // we write a short function to do this. We pass the name of the function
20 // to Phormation in the "params" array, so that it will call this
21 // function just before deleting a record from the database.
22 $query = "select pic from community where id = $record_id";
23 $result = pg_exec( $query );
24 if( $result ) {
25 $array = pg_fetch_array( $result, 0 );
26 $filename = "$dir/".trim( $array[0] );
27 @unlink( $filename );
28 }
29 }
30
31 table_index( $fields, $names, $params );
32 ?>

  ViewVC Help
Powered by ViewVC 1.1.26