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.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 require_once('../env.inc.php');
26 require_once $gfcommon.'include/pre.php';
27 require_once $gfwww.'include/vote_function.php';
29 $diary_user = getStringFromRequest('diary_user');
31 $diary_id = getStringFromRequest('diary_id');
33 $user_obj=user_get_object($diary_user);
35 exit_error(_('User could not be found.'),'home');
36 } else if ($user_obj->isError()) {
37 exit_error($user_obj->getErrorMessage(),'home');
40 echo $HTML->header(array('title'=>_('My Diary And Notes')));
43 <h2>'._('Diary And Notes For').': '. $user_obj->getRealName() .'</h2>';
46 $res = db_query_params ('SELECT * FROM user_diary WHERE user_id=$1 AND id=$2 AND is_public=1',
50 echo $HTML->boxTop(_('Date').": ".date(_('Y-m-d H:i'), db_result($res,$i,'date_posted')));
51 if (!$res || db_numrows($res) < 1) {
52 echo _('Entry Not Found For This User');
54 echo'<strong>'._('Subject').':</strong> '. db_result($res,$i,'summary') .'<p>
55 <strong>'._('Body').':</strong><br />
56 '. nl2br(db_result($res,$i,'details')) .'
59 echo $HTML->boxBottom();
62 echo $HTML->boxTop(_('Existing Diary And Note Entries'));
63 echo '<table cellspacing="2" cellpadding="0" width="100%" border="0">';
65 List all diary entries
67 $result = db_query_params ('SELECT * FROM user_diary WHERE user_id=$1 AND is_public=1 ORDER BY id DESC',
69 $rows=db_numrows($result);
70 if (!$result || $rows < 1) {
72 exit_error(db_error(),'home');
75 <tr><td><strong>'._('This User Has No Diary Entries').'</strong></td></tr>';
80 <th>'._('Subject').'</th>
81 <th>'._('Date').'</th>
83 for ($i=0; $i<$rows; $i++) {
85 <tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td><a href="'. getStringFromServer('PHP_SELF') .'?diary_id='.
86 db_result($result,$i,'id').'&diary_user='. $diary_user .'">'.db_result($result,$i,'summary').'</a></td>'.
87 '<td>'. date(_('Y-m-d H:i'), db_result($result,$i,'date_posted')).'</td></tr>';
90 <tr><td colspan="2" class="tablecontent"> </td></tr>';
93 echo $HTML->boxBottom();
95 echo $HTML->footer(array());
98 exit_error(_('No User Selected'),'home');