C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mamFM\modules\mod_newsflash.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/**
* @version $Id: mod_newsflash.php 2491 2006-02-20 01:28:34Z stingrey $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined'_VALID_MOS' ) or die( 'Restricted access' );

require_once( 
$mainframe->getPath'front_html''com_content') );

if (!
defined'_JOS_NEWSFLASH_MODULE' )) {
    
/** ensure that functions are declared only once */
    
define'_JOS_NEWSFLASH_MODULE');
    
    function 
output_newsflash( &$row, &$params, &$access ) {    
        global 
$mainframe;
        
        
$row->text         $row->introtext;
        
$row->groups     '';
        
$row->readmore     = (trim$row->fulltext ) != '');        
        
$row->metadesc     '';
        
$row->metakey     '';
        
$row->access     '';
        
$row->created     '';
        
$row->modified     '';    

        
$bs             $mainframe->getBlogSectionCount();
        
$bc             $mainframe->getBlogCategoryCount();
        
$gbs             $mainframe->getGlobalBlogSectionCount();
        
$ItemidCount     $mainframe->getItemid$row->id00$bs$bc$gbs );
        
        
HTML_content::show$row$params$access0'com_content'$ItemidCount );
    }
}

global 
$my$mosConfig_shownoauth$mosConfig_offset$mosConfig_link_titles$acl;

// Disable edit ability icon
$access = new stdClass();
$access->canEdit     0;
$access->canEditOwn 0;
$access->canPublish 0;

$now date'Y-m-d H:i:s'time()+$mosConfig_offset*60*60 );

$catid                 intval$params->get'catid' ) );
$style                 $params->get'style' );
$items                 intval$params->get'items' ) );
$moduleclass_sfx    $params->get'moduleclass_sfx' );
$link_titles        $params->get'link_titles'$mosConfig_link_titles );

$params->set'intro_only',         );
$params->set'hide_author',         );
$params->set'hide_createdate',     );
$params->set'hide_modifydate',     );
$params->set'link_titles',         $link_titles );

if ( 
$items ) {
    
$limit "LIMIT $items";
} else {
    
$limit '';
}

$noauth     = !$mainframe->getCfg'shownoauth' );
$nullDate     $database->getNullDate();

// query to determine article count
$query "SELECT a.id, a.introtext, a.fulltext , a.images, a.attribs, a.title, a.state"
."\n FROM #__content AS a"
."\n INNER JOIN #__categories AS cc ON cc.id = a.catid"
."\n INNER JOIN #__sections AS s ON s.id = a.sectionid"
."\n WHERE a.state = 1"
. ( $noauth "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid'' )
.
"\n AND (a.publish_up = '$nullDate' OR a.publish_up <= '$now' ) "
."\n AND (a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
."\n AND a.catid = $catid"
."\n AND cc.published = 1"
."\n AND s.published = 1"
."\n ORDER BY a.ordering"
."\n $limit"
;
$database->setQuery$query );
$rows $database->loadObjectList();
$numrows count$rows );

switch (
$style) {
    case 
'horiz':
        echo 
'<table class="moduletable' $moduleclass_sfx .'">';
        echo 
'<tr>';
        foreach (
$rows as $row) {
            echo 
'<td>';            
            
output_newsflash$row$params$access );            
            echo 
'</td>';
        }
        echo 
'</tr></table>';
        break;

    case 
'vert':
        foreach (
$rows as $row) {
            
output_newsflash$row$params$access );
        }
        break;

    case 
'flash':
    default:
        if (
$numrows 0) {
            
srand ((double) microtime() * 1000000);
            
$flashnum rand0$numrows-);
        } else {
            
$flashnum 0;
        }
        
$row $rows[$flashnum];
        
        
output_newsflash$row$params$access );
        break;
}
?>