This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  e1a87994a213af1b08d04ab05a3d2c974a18cf18 (commit)
      from  ebc43cf5f22cb6efa1f9a2001df6e7a4b5db8a1f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=e1a87994a213af1b08d04ab05a3d2c974a18cf18

commit e1a87994a213af1b08d04ab05a3d2c974a18cf18
Author: Franck Villaume <[email protected]>
Date:   Fri May 10 16:37:14 2019 +0200

    add new widget for frontpage: HeadLines where forge admins can push diary 
notes & news

diff --git a/src/common/diary/DiaryFactory.class.php 
b/src/common/diary/DiaryFactory.class.php
index 3a700df..96874cb 100644
--- a/src/common/diary/DiaryFactory.class.php
+++ b/src/common/diary/DiaryFactory.class.php
@@ -23,6 +23,7 @@ require_once $gfcommon.'diary/DiaryNote.class.php';
 class DiaryFactory extends FFObject {
 
        var $diarynoteids = false;
+       var $sponsoreddiarynoteids = false;
 
        function __construct() {
                parent::__construct();
@@ -55,6 +56,32 @@ class DiaryFactory extends FFObject {
                return false;
        }
 
+       function hasSponsoredNotes($old_date = 0) {
+               $this->getSponsoredIDS($old_date);
+               if (is_array($this->sponsoreddiarynoteids) && 
count($this->sponsoreddiarynoteids)) {
+                       return true;
+               }
+               return false;
+       }
+
+       function getSponsoredIDS($old_date = 0) {
+               if (is_array($this->sponsoreddiarynoteids)) {
+                       return $this->sponsoreddiarynoteids;
+               }
+               if (!$old_date) {
+                       $old_date = time()-60*60*24*30;
+               }
+               $res = db_query_params('SELECT user_diary.id FROM user_diary, 
users
+                                               WHERE is_public = $1
+                                               AND is_approved = $2
+                                               AND user_diary.user_id = 
users.user_id
+                                               AND users.status = $3
+                                               AND date_posted > $4
+                                               ORDER BY date_posted', array(1, 
1, 'A', $old_date));
+               $this->sponsoreddiarynoteids = 
util_result_column_to_array($res);
+               return $this->sponsoreddiarynoteids;
+       }
+
        function getDiaryNote($diarynote_id) {
                return diarynote_get_object($diarynote_id);
        }
diff --git a/src/common/diary/DiaryNote.class.php 
b/src/common/diary/DiaryNote.class.php
index 016ca46..b849397 100644
--- a/src/common/diary/DiaryNote.class.php
+++ b/src/common/diary/DiaryNote.class.php
@@ -164,4 +164,32 @@ class DiaryNote extends FFObject {
        function getID() {
                return $this->data_array['id'];
        }
+
+       function getLink() {
+               return 
'/developer/?view=detail&diary_id='.$this->getID().'&diary_user='.$this->getUser()->getID();
+       }
+
+       function getAbstract() {
+               global $gfcommon;
+               //get the first paragraph of the diary note.
+               if (strstr($this->data_array['details'], '<br/>')) {
+                       $arr = explode('<br/>', $this->data_array['details']);
+               } else {
+                       $arr = explode("\n", $this->data_array['details']);
+               }
+               $abstract = $arr[0];
+               $parsertype = forge_get_config('diary_parser_type');
+               switch ($parsertype) {
+                       case 'markdown':
+                               require_once 
$gfcommon.'include/Markdown.include.php';
+                               $abstract = FF_Markdown($abstract);
+                               break;
+                       default:
+                               $abstract = nl2br($abstract);
+               }
+               $content = html_e('div', array('class' => 
'widget-sticker-header box'), html_e('div', 
array(),util_make_link($this->getLink(), 
$this->getSummary()).'&nbsp;'._('by').'&nbsp;').util_display_user($this->getUser()->getUnixname(),
 $this->getUser()->getID(), $this->getUser()->GetRealname()));
+               $content .= html_e('div', array('class' => 
'widget-sticker-body'), 
$abstract.html_e('br').util_make_link($this->getLink(),_('... Read more')));
+               $content .= html_e('div', array('class' => 
'widget-sticker-footer'), _('Posted')._(': ').$this->getDatePostedOn());
+               return html_e('div', array('class' => 
'widget-sticker-container'), $content);
+       }
 }
diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index d49ea3f..1cab9fb 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -63,6 +63,7 @@ abstract class BaseRole extends FFError {
                        'forge_admin' => array(0, 1),
                        'approve_projects' => array(0, 1),
                        'approve_news' => array(0, 1),
+                       'approve_diary' => array(0, 1),
                        'forge_stats' => array(0, 1, 2),
 
                        'project_read' => array(0, 1),
@@ -92,6 +93,7 @@ abstract class BaseRole extends FFError {
                        'forge_admin', // “God mode”: all actions allowed
                        'approve_projects', // Ability to approve pending 
projects
                        'approve_news', // Ability to approve news bits to the 
forge front page
+                       'approve_diary', // Ability to approve diary notes to 
the forge front page
                        'forge_stats'
                        );
 
@@ -435,14 +437,14 @@ abstract class BaseRole extends FFError {
        /**
         * getGlobalSettings - get the permissions for global settings
         *
-        * The following sections are global : forge_admin, forge_stats, 
approve_projects, approve_news
+        * The following sections are global : forge_admin, forge_stats, 
approve_projects, approve_news, approve_diary
         *
         * @return      array   array of permission for global settings
         */
        function getGlobalSettings() {
                $result = array();
 
-               $sections = array ('forge_admin', 'forge_stats', 
'approve_projects', 'approve_news');
+               $sections = array ('forge_admin', 'forge_stats', 
'approve_projects', 'approve_news', 'approve_diary');
                foreach ($sections as $section) {
                        $result[$section][-1] = $this->getVal($section, -1);
                }
@@ -482,6 +484,7 @@ abstract class BaseRole extends FFError {
                case 'forge_read':
                case 'approve_projects':
                case 'approve_news':
+               case 'approve_diary':
                case 'project_admin':
                        if ($this->hasGlobalPermission('forge_admin')) {
                                return 1;
@@ -669,6 +672,7 @@ abstract class BaseRole extends FFError {
                case 'forge_read':
                case 'approve_projects':
                case 'approve_news':
+               case 'approve_diary':
                case 'project_admin':
                case 'project_read':
                case 'tracker_admin':
@@ -966,6 +970,7 @@ abstract class BaseRole extends FFError {
                $this->normalizePermsForSection($new_pa, 'forge_admin', -1);
                $this->normalizePermsForSection($new_pa, 'approve_projects', 
-1);
                $this->normalizePermsForSection($new_pa, 'approve_news', -1);
+               $this->normalizePermsForSection($new_pa, 'approve_diary', -1);
                $this->normalizePermsForSection($new_pa, 'forge_stats', -1);
 
                $hook_params = array();
diff --git a/src/common/include/RBACEngine.class.php 
b/src/common/include/RBACEngine.class.php
index 85ada7c..e938053 100644
--- a/src/common/include/RBACEngine.class.php
+++ b/src/common/include/RBACEngine.class.php
@@ -4,7 +4,7 @@
  *
  * Copyright 2010, Roland Mas
  * Copyright 2012, Thorsten “mirabilos” Glaser <[email protected]>
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2019, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -271,6 +271,7 @@ class RBACEngine extends FFError implements PFO_RBACEngine {
                case 'forge_read':
                case 'approve_projects':
                case 'approve_news':
+               case 'approve_diary':
                case 'project_admin':
                case 'project_read':
                case 'tracker_admin':
@@ -427,6 +428,7 @@ class RBACEngine extends FFError implements PFO_RBACEngine {
                case 'forge_read':
                case 'approve_projects':
                case 'approve_news':
+               case 'approve_diary':
                case 'forge_stats':
                case 'project_admin':
                        $result = array_merge ($result, 
$this->_getRolesIdByAllowedAction ('forge_admin', -1));
diff --git a/src/common/widget/Widget.class.php 
b/src/common/widget/Widget.class.php
index 0e37f1b..2417250 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -60,6 +60,7 @@ require_once $gfcommon.'widget/Widget_HomeTagCloud.class.php';
 require_once $gfcommon.'widget/Widget_HomeVersion.class.php';
 require_once $gfcommon.'widget/Widget_HomeRss.class.php';
 require_once $gfcommon.'widget/Widget_HomeLatestDiaryNotes.class.php';
+require_once $gfcommon.'widget/Widget_HomeSponsoredHeadLines.class.php';
 
 // Tracker Widgets
 require_once $gfcommon.'widget/Widget_TrackerComment.class.php';
@@ -214,6 +215,9 @@ require_once 
$gfcommon.'widget/Widget_UserhomeRss.class.php';
                        case 'homelatestdiarynotes';
                                $o = new Widget_HomeLatestDiaryNotes();
                                break;
+                       case 'homesponsoredheadlines';
+                               $o = new Widget_HomeSponsoredHeadLines();
+                               break;
                        case 'mysurveys':
                                $o = new Widget_MySurveys();
                                break;
@@ -363,7 +367,7 @@ require_once 
$gfcommon.'widget/Widget_UserhomeRss.class.php';
                                break;
                        case WidgetLayoutManager::OWNER_TYPE_HOME:
                                $widgets = array('hometagcloud', 'homeversion', 
'homelatestnews', 'homestats', 'homedetailactivitymostactiveprojectweek',
-                                               'homelatestfilereleases', 
'homerss', 'homelatestdiarynotes');
+                                               'homelatestfilereleases', 
'homerss', 'homelatestdiarynotes', 'homesponsoredheadlines');
                                break;
                        case WidgetLayoutManager::OWNER_TYPE_TRACKER:
                                $widgets = array('trackercontent', 
'trackercomment', 'trackerdefaultactions', 'trackergeneral', 'trackermain', 
'trackersummary');
diff --git a/src/common/widget/Widget_HomeSponsoredHeadLines.class.php 
b/src/common/widget/Widget_HomeSponsoredHeadLines.class.php
new file mode 100644
index 0000000..97e70c1
--- /dev/null
+++ b/src/common/widget/Widget_HomeSponsoredHeadLines.class.php
@@ -0,0 +1,100 @@
+<?php
+/**
+ * Copyright 2019, Franck Villaume - TrivialDev
+ * This file is a part of Fusionforge.
+ *
+ * Fusionforge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Fusionforge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+require_once 'Widget.class.php';
+require_once $gfcommon.'diary/DiaryFactory.class.php';
+
+class Widget_HomeSponsoredHeadLines extends Widget {
+       function __construct() {
+               parent::__construct('homesponsoredheadlines');
+               if (forge_get_config('use_diary') || 
forge_get_config('use_news')) {
+                       $this->content['title'] = 
forge_get_config('forge_name').' '.('Headlines');
+               }
+       }
+
+       function getTitle() {
+               return $this->content['title'];
+       }
+
+       function getDescription() {
+               return _('Display Sponsored Headlines for last 30 days: i.e 
diary & notes, project news.');
+       }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
+
+       function getContent() {
+               global $HTML;
+               $content = '';
+               $old_date = time()-60*60*24*30;
+               $diaryFactory = new DiaryFactory();
+               if ($diaryFactory->hasSponsoredNotes($old_date)) {
+                       foreach ($diaryFactory->getSponsoredIDS($old_date) as 
$key => $diarynoteid) {
+                               $diaryNoteObject = 
diarynote_get_object($diarynoteid);
+                               $content .= $diaryNoteObject->getAbstract();
+                       }
+               }
+               $result = db_query_params('
+                               SELECT groups.group_name, 
groups.unix_group_name, groups.group_id,
+                               users.user_name, users.realname, users.user_id,
+                               news_bytes.forum_id, news_bytes.summary, 
news_bytes.post_date,
+                               news_bytes.details
+                               FROM users,news_bytes,groups
+                               WHERE (news_bytes.group_id=$1 AND 
news_bytes.is_approved <> 4 OR 1!=$2)
+                               AND (news_bytes.is_approved=1 OR 1 != $3)
+                               AND users.user_id=news_bytes.submitted_by
+                               AND news_bytes.group_id=groups.group_id
+                               AND groups.status=$4
+                               AND post_date > $5
+                               ORDER BY post_date DESC',
+                               array (GROUP_IS_NEWS,
+                                       0,
+                                       1,
+                                       'A',
+                                       $old_date));
+
+               if ($result && db_numrows($result)) {
+                       $rows = db_numrows($result);
+                       for ($i = 0; $i < $rows; $i++) {
+                               if 
(strstr(db_result($result,$i,'details'),'<br/>')) {
+                                       // the news is html, fckeditor made for 
example
+                                       $arr = 
explode("<br/>",db_result($result,$i,'details'));
+                               } else {
+                                       $arr = 
explode("\n",db_result($result,$i,'details'));
+                               }
+                               $summ_txt = util_make_links($arr[0]);
+                               $proj_name = 
util_make_link_g(strtolower(db_result($result,$i,'unix_group_name')),db_result($result,$i,'group_id'),db_result($result,$i,'group_name'));
+                               $t_thread_title = 
db_result($result,$i,'summary');
+                               $t_thread_url = "/forum/forum.php?forum_id=" . 
db_result($result,$i,'forum_id');
+                               $t_thread_author = 
util_display_user(db_result($result,$i,'user_name'), 
db_result($result,$i,'user_id'), db_result($result,$i,'realname'));
+                               $news = html_e('div', array('class' => 
'widget-sticker-header box'), html_e('div', array(), util_make_link 
($t_thread_url, $t_thread_title).'&nbsp;'._('by').'&nbsp;').$t_thread_author);
+                               $news .= html_e('div', array('class' => 
'widget-sticker-body'), $summ_txt.html_e('br').util_make_link($t_thread_url, 
_('... Read more')));
+                               $news .= html_e('div', array('class' => 
'widget-sticker-footer'), _('Posted')._(': ').date(_('Y-m-d 
H:i'),db_result($result,$i,'post_date')).' - '.$proj_name);
+                               $content .= html_e('div', array('class' => 
'widget-sticker-container'), $news);
+                       }
+               }
+
+               if (strlen($content)) {
+                       return $content.html_e('div', array('style' => 
'clear:both'), '&nbsp;');
+               }
+               return $HTML->warning(_('No Sponsored element found'));
+       }
+}
+ 
diff --git a/src/db/20190506-diary-approved.sql 
b/src/db/20190506-diary-approved.sql
new file mode 100644
index 0000000..00b7dbc
--- /dev/null
+++ b/src/db/20190506-diary-approved.sql
@@ -0,0 +1,2 @@
+ALTER TABLE user_diary ADD COLUMN is_approved integer DEFAULT 0 NOT NULL;
+UPDATE user_diary SET is_approved = 0;
diff --git a/src/www/admin/index.php b/src/www/admin/index.php
index 90ec127..e2cd565 100644
--- a/src/www/admin/index.php
+++ b/src/www/admin/index.php
@@ -181,15 +181,24 @@ echo html_ac(html_ap() - 1);
 
 <?php if(forge_get_config('use_news')) {?>
 <div class="info-box">
-<h2><?php echo _('News'); ?></h2>
+<?php echo html_e('h2', array(), _('News')); ?>
        <ul>
                <li><?php echo util_make_link('/admin/pending-news.php', 
_('Pending news (moderation for front-page)')); ?></li>
        </ul>
 </div>
+<?php }
+
+if(forge_get_config('use_diary')) {?>
+<div class="info-box">
+<?php echo html_e('h2', array(), _('Diary & Notes')); ?>
+       <ul>
+               <li><?php echo util_make_link('/admin/pending-diary.php', 
_('Pending diary & notes (moderation for headlines front-page)')); ?></li>
+       </ul>
+</div>
 <?php } ?>
 
 <div class="info-box">
-<h2><?php echo _('Stats'); ?></h2>
+<?php echo html_e('h2', array(), _('Stats')); ?>
        <ul>
                <li><?php echo util_make_link('/stats/', _('Site-Wide Stats')); 
?></li>
                <?php plugin_hook('webanalytics_admin', array()); ?>
@@ -197,7 +206,7 @@ echo html_ac(html_ap() - 1);
 </div>
 
 <div class="info-box">
-<h2><?php echo _('Trove Project Tree'); ?></h2>
+<?php echo html_e('h2', array(), _('Trove Project Tree')); ?>
        <ul>
                <li><?php echo 
util_make_link('/admin/trove/trove_cat_list.php', _('Display Trove Map')); 
?></li>
                <li><?php echo util_make_link('/admin/trove/trove_cat_add.php', 
_('Add to the Trove Map')); ?></li>
@@ -205,7 +214,7 @@ echo html_ac(html_ap() - 1);
 </div>
 
 <div class="info-box">
-<h2><?php echo _('Site Utilities'); ?></h2>
+<?php echo html_e('h2', array(), _('Site Utilities')); ?>
 <ul>
        <li><?php echo util_make_link('/admin/massmail.php', sprintf(_('Mail 
Engine for %s Subscribers'), forge_get_config ('forge_name'))); ?></li>
        <li><?php echo util_make_link('/admin/unsubscribe.php', 
forge_get_config('forge_name').' '._('Site Mailings Maintenance')); ?></li>
diff --git a/src/www/admin/pending-diary.php b/src/www/admin/pending-diary.php
new file mode 100644
index 0000000..faa5420
--- /dev/null
+++ b/src/www/admin/pending-diary.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Diary Facility
+ *
+ * Copyright 2019, Franck Villaume - TrivialDev
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once '../env.inc.php';
+require_once $gfcommon.'include/pre.php';
+require_once $gfwww.'admin/admin_utils.php';
+require_once $gfcommon.'diary/DiaryNote.class.php';
+
+session_require_global_perm('approve_diary');
+
+$post_change = getStringFromRequest('post_change');
+$diary_id = getIntFromRequest('diary_id');
+if (in_array($post_change, array('add', 'remove')) && $diary_id) {
+       switch ($post_change) {
+               case 'add':
+                       $res = db_query_params('UPDATE user_diary SET 
is_approved = $1 WHERE id = $2', array(1, $diary_id));
+                       $feedback = sprintf(_('diary note ID %d successfully 
published'), $diary_id);
+                       break;
+               case 'remove':
+                       $res = db_query_params('UPDATE user_diary SET 
is_approved = $1 WHERE id = $2', array(2, $diary_id));
+                       $feedback = sprintf(_('diary note ID %d successfully 
removed'), $diary_id);
+                       break;
+       }
+}
+
+site_admin_header(array('title'=>_('Diary Admin')));
+echo html_e('p', array(), _('Select Diary & Notes to be on the frontpage. Only 
public diary entries can be selected and less than 30 days old.'));
+$old_date = time()-60*60*24*30;
+$res = db_query_params('SELECT user_diary.id FROM user_diary, users
+                                               WHERE is_public = $1
+                                               AND is_approved = $2
+                                               AND user_diary.user_id = 
users.user_id
+                                               AND users.status = $3
+                                               AND date_posted > $4
+                                               ORDER BY date_posted',
+                       array(1, 0, 'A', $old_date));
+                       
+if ($res && db_numrows($res)) {
+       echo html_e('h2', array(), _('Available diary entries eligible to 
frontpage'));
+       $title_arr = array('', _('Date'), _('Subject'), _('User'), 
_('Actions'));
+       echo $HTML->listTableTop($title_arr);
+       while ($arr = db_fetch_array($res)) {
+               $diarynoteObject = diarynote_get_object($arr['id']);
+               $cells = array();
+               $cells[][] = $HTML->html_checkbox('diary_approved_id', 
$arr['id'], 'diary_approved_id');
+               $cells[][] = $diarynoteObject->getDatePostedOn();
+               $cells[][] = 
util_make_link('/developer/?view=detail&diary_user='.$diarynoteObject->getUser()->getID().'&diary_id='.$arr['id'],$diarynoteObject->getSummary());
+               $cells[][] = $diarynoteObject->getUser()->getUnixname();
+               $cells[][] = 
util_make_link('/admin/pending-diary.php?post_change=add&diary_id='.$arr['id'], 
$HTML->getAddPic());
+               echo $HTML->multiTableRow(array(), $cells);
+       }
+       echo $HTML->listTableBottom();
+} else {
+       echo $HTML->information(_('No new available diary entries to push to 
frontpage'));
+}
+
+$res = db_query_params('SELECT user_diary.id FROM user_diary, users
+                                               WHERE is_public = $1
+                                               AND is_approved = $2
+                                               AND user_diary.user_id = 
users.user_id
+                                               AND date_posted > $3
+                                               ORDER BY date_posted',
+                       array(1, 1, $old_date));
+                       
+if ($res && db_numrows($res)) {
+       echo html_e('h2', array(), _('Published diary entries to frontpage last 
30 days.'));
+       $title_arr = array('', _('Date'), _('Subject'), _('User'), 
_('Actions'));
+       echo $HTML->listTableTop($title_arr);
+       while ($arr = db_fetch_array($res)) {
+               $diarynoteObject = diarynote_get_object($arr['id']);
+               $cells = array();
+               $cells[][] = $HTML->html_checkbox('diary_approved_id', 
$arr['id'], 'diary_approved_id');
+               $cells[][] = $diarynoteObject->getDatePostedOn();
+               $cells[][] = 
util_make_link('/developer/?view=detail&diary_user='.$diarynoteObject->getUser()->getID().'&diary_id='.$arr['id'],$diarynoteObject->getSummary());
+               $cells[][] = $diarynoteObject->getUser()->getUnixname();
+               $cells[][] = 
util_make_link('/admin/pending-diary.php?post_change=remove&diary_id='.$arr['id'],
 $HTML->getRemovePic());
+               echo $HTML->multiTableRow(array(), $cells);
+       }
+       echo $HTML->listTableBottom();
+} else {
+       echo $HTML->information(_('No diary entries pushed to frontpage last 30 
days.'));
+}
+
+
+$res = db_query_params('SELECT user_diary.id FROM user_diary, users
+                                               WHERE is_public = $1
+                                               AND is_approved = $2
+                                               AND user_diary.user_id = 
users.user_id
+                                               AND date_posted > $3
+                                               ORDER BY date_posted',
+                       array(1, 2, $old_date));
+                       
+if ($res && db_numrows($res)) {
+       echo html_e('h2', array(), _('Refused diary entries to frontpage last 
30 days.'));
+       $title_arr = array('', _('Date'), _('Subject'), _('User'), 
_('Actions'));
+       echo $HTML->listTableTop($title_arr);
+       while ($arr = db_fetch_array($res)) {
+               $diarynoteObject = diarynote_get_object($arr['id']);
+               $cells = array();
+               $cells[][] = $HTML->html_checkbox('diary_approved_id', 
$arr['id'], 'diary_approved_id');
+               $cells[][] = $diarynoteObject->getDatePostedOn();
+               $cells[][] = 
util_make_link('/developer/?view=detail&diary_user='.$diarynoteObject->getUser()->getID().'&diary_id='.$arr['id'],$diarynoteObject->getSummary());
+               $cells[][] = $diarynoteObject->getUser()->getUnixname();
+               $cells[][] = 
util_make_link('/admin/pending-diary.php?post_change=add&diary_id='.$arr['id'], 
$HTML->getAddPic());
+               echo $HTML->multiTableRow(array(), $cells);
+       }
+       echo $HTML->listTableBottom();
+} else {
+       echo $HTML->information(_('No diary entries refused to frontpage last 
30 days.'));
+}
+
+site_admin_footer();
diff --git a/src/www/my/diary.php b/src/www/my/diary.php
index e73db60..fcd60df 100644
--- a/src/www/my/diary.php
+++ b/src/www/my/diary.php
@@ -69,15 +69,16 @@ if (!session_loggedin()) {
                } elseif (getStringFromRequest('add')) {
                        //inserting a new diary entry
                        $currenttime = time();
-                       $res = db_query_params('INSERT INTO user_diary 
(user_id,date_posted,summary,details,is_public, year, month) VALUES
-                                                               
($1,$2,$3,$4,$5, $6, $7)',
+                       $res = db_query_params('INSERT INTO user_diary 
(user_id,date_posted,summary,details,is_public, year, month, is_approved) VALUES
+                                                               
($1,$2,$3,$4,$5, $6, $7, $8)',
                                                                
array(user_getid(),
                                                                        
$currenttime,
                                                                        
$summary,
                                                                        
$details,
                                                                        
$is_public,
                                                                        
date('Y', $currenttime),
-                                                                       
date('m', $currenttime)));
+                                                                       
date('m', $currenttime),
+                                                                       0));
                        if ($res && db_affected_rows($res) > 0) {
                                $feedback .= _('Item Added');
                                if ($is_public) {
diff --git a/src/www/themes/funky/css/theme.css 
b/src/www/themes/funky/css/theme.css
index aff8ec2..53e70b5 100644
--- a/src/www/themes/funky/css/theme.css
+++ b/src/www/themes/funky/css/theme.css
@@ -527,6 +527,33 @@ a.topTabSelected:hover {
        padding: 4px;
 }
 
+.widget-sticker-container {
+       padding: 4px;
+       float: left;
+       margin-left: auto;
+       margin-right: auto;
+       background-color: white;
+       border: 1px solid #D5D5D5;
+       min-width: 300px;
+       max-width: 500px;
+}
+
+.widget-sticker-header {
+       background-color: #CDDCF3;
+       padding: 1px;
+}
+
+.widget-sticker-body {
+       position: relative;
+       padding: 2px;
+       width: 98%;
+       overflow: hidden;
+}
+
+.widget-sticker-footer {
+       padding: 1px;
+}
+
 table.listing tbody tr:nth-child(even),
 .bgcolor-grey {
        background-color: #CDDCF3;

-----------------------------------------------------------------------

Summary of changes:
 src/common/diary/DiaryFactory.class.php            |  27 +++++
 src/common/diary/DiaryNote.class.php               |  28 +++++
 src/common/include/RBAC.php                        |   9 +-
 src/common/include/RBACEngine.class.php            |   4 +-
 src/common/widget/Widget.class.php                 |   6 +-
 .../widget/Widget_HomeSponsoredHeadLines.class.php | 100 ++++++++++++++++
 src/db/20190506-diary-approved.sql                 |   2 +
 src/www/admin/index.php                            |  17 ++-
 src/www/admin/pending-diary.php                    | 132 +++++++++++++++++++++
 src/www/my/diary.php                               |   7 +-
 src/www/themes/funky/css/theme.css                 |  27 +++++
 11 files changed, 348 insertions(+), 11 deletions(-)
 create mode 100644 src/common/widget/Widget_HomeSponsoredHeadLines.class.php
 create mode 100644 src/db/20190506-diary-approved.sql
 create mode 100644 src/www/admin/pending-diary.php


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to