3 * Developer's Diary Page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010 (c) Franck Villaume
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once('../env.inc.php');
25 require_once $gfcommon.'include/pre.php';
26 require_once $gfwww.'include/vote_function.php';
28 $diary_user = getIntFromRequest('diary_user');
30 $diary_id = getIntFromRequest('diary_id');
32 $user_obj=user_get_object($diary_user);
34 exit_error(_('User could not be found.'),'home');
35 } else if ($user_obj->isError()) {
36 exit_error($user_obj->getErrorMessage(),'home');
39 $title = _('Diary And Notes For').': '. $user_obj->getRealName();
40 echo $HTML->header(array('title'=>$title));
43 $res = db_query_params ('SELECT * FROM user_diary WHERE user_id=$1 AND id=$2 AND is_public=1',
47 if (!$res || db_numrows($res) < 1) {
48 echo '<p>' . _('Entry Not Found For This User') . '</p>';
50 echo $HTML->boxTop(db_result($res,0,'summary'));
51 echo '<p>' . _('Posted on ') . date(_('Y-m-d H:i'), db_result($res,0,'date_posted')).'</p>';
52 echo db_result($res,0,'details');
53 echo $HTML->boxBottom();
57 echo $HTML->boxTop(_('Existing Diary And Note Entries'));
58 echo '<table cellspacing="2" cellpadding="0" width="100%" border="0">';
60 List all diary entries
62 $result = db_query_params ('SELECT * FROM user_diary WHERE user_id=$1 AND is_public=1 ORDER BY id DESC',
64 $rows=db_numrows($result);
65 if (!$result || $rows < 1) {
67 exit_error(db_error(),'home');
70 <tr><td><strong>'._('This User Has No Diary Entries').'</strong></td></tr>';
75 <th>'._('Subject').'</th>
76 <th>'._('Date').'</th>
78 for ($i=0; $i<$rows; $i++) {
80 <tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td><a href="'. getStringFromServer('PHP_SELF') .'?diary_id='.
81 db_result($result,$i,'id').'&diary_user='. $diary_user .'">'.db_result($result,$i,'summary').'</a></td>'.
82 '<td>'. date(_('Y-m-d H:i'), db_result($result,$i,'date_posted')).'</td></tr>';
85 <tr><td colspan="2" class="tablecontent"> </td></tr>';
88 echo $HTML->boxBottom();
90 echo $HTML->footer(array());
93 exit_error(_('No User Selected'),'home');