source: trunk/news_admin/website/news.inc.php @ 45

Revision 45, 2.2 KB checked in by niltonneto, 17 years ago (diff)

Implementação do FCKEDITOR na edição de artigos no news_admin, para permitir texto rico.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare - Webpage news admin                                          *
4        * http://www.egroupware.org                                                *
5        * --------------------------------------------                             *
6        *  This program is free software; you can redistribute it and/or modify it *
7        *  under the terms of the GNU General Public License as published by the   *
8        *  Free Software Foundation; either version 2 of the License, or (at your  *
9        *  option) any later version.                                              *
10        * --------------------------------------------                             *
11        * This program was sponsered by Golden Glair productions                   *
12        * http://www.goldenglair.com                                               *
13        \**************************************************************************/
14        /* $Id$ */
15
16        include('setup.inc.php');
17
18        $tpl->set_file(array('news' => 'news.tpl',
19                        'row' => 'news_row.tpl')
20        );
21
22        $db->query("SELECT COUNT(*) FROM phpgw_news WHERE news_status='Active'");
23        $db->next_record();
24        $total = $db->f(0);
25
26        if (! $oldnews)
27        {
28                $db->query("SELECT *,account_lid AS submittedby FROM phpgw_news,phpgw_accounts WHERE news_status='Active' "
29                                        . "AND news_submittedby=phpgw_accounts.account_id ORDER BY news_date DESC LIMIT 5");
30        }
31        else
32        {
33                $db->query("SELECT *,account_lid AS submittedby FROM phpgw_news,phpgw_accounts WHERE news_status='Active' AND "
34                                        . "news_submittedby=phpgw_accounts.account_id ORDER BY news_date DESC LIMIT 5,$total");
35        }
36
37        while ($db->next_record())
38        {
39                $tpl->set_var('subject',$db->f('news_subject'));
40                $tpl->set_var('submitedby','Submitted by ' . $db->f('submittedby') . ' on ' . date("m/d/Y - h:m:s a",$db->f('news_date')));
41                $tpl->set_var('content',nl2br($db->f('news_content')));
42
43                $tpl->parse('rows','row',True);
44        }
45
46        $tpl->pparse('out','news');
47
48        if ($total > 5 && ! $oldnews)
49        {
50                echo '<center><a href="index.php?oldnews=True">View news archives</a></center>';
51        }
52?>
53        <p>&nbsp;</p>
54
55        <div align="center"><font size="-1">This page uses the news admin from <a href="http://www.egroupware.org">eGroupWare</a></font></div>
Note: See TracBrowser for help on using the repository browser.