Cheetah
post_mod_crss.php
Go to the documentation of this file.
1 <?php
2 
8 require_once('../../../inc/header.inc.php');
9 require_once( CH_DIRECTORY_PATH_INC . 'admin_design.inc.php' );
10 ch_import('ChWsbPaginate');
11 
12 $logged['admin'] = member_auth( 1, true, true );
13 
14 // $_page['css_name'] = 'browse.css';
15 // $_page['header'] = "Browse custom RSS";
16 
17 if (isset($_POST['crsss']) && is_array($_POST['crsss'])) {
18  foreach($_POST['crsss'] as $iCrss) {
19  switch (true) {
20  case isset($_POST['action_delete']):
21  $iOldID = (int)$iCrss;
22  $sRSSSQL = "DELETE FROM `ch_crss_main` WHERE `ID`='{$iOldID}'";
23  db_res($sRSSSQL);
24  break;
25  case isset($_POST['action_approve']):
26  $iOldID = (int)$iCrss;
27  $sRSSSQL = "UPDATE `ch_crss_main` SET `status`='active' WHERE `ID`='{$iOldID}'";
28  db_res($sRSSSQL);
29  break;
30  case isset($_POST['action_disapprove']):
31  $iOldID = (int)$iCrss;
32  $sRSSSQL = "UPDATE `ch_crss_main` SET `status`='passive' WHERE `ID`='{$iOldID}'";
33  db_res($sRSSSQL);
34  break;
35  }
36  }
37 }
38 
40 $iTotalNum = db_value( "SELECT COUNT(*) FROM `ch_crss_main` WHERE `ProfileID`>0" );
41 if( !$iTotalNum )
42  $sRSSs .= MsgBox(_t('_Empty'));
43 $iPerPage = (int)ch_get('per_page');
44 if (!$iPerPage)
45  $iPerPage = 10;
46 $iCurPage = (int)ch_get('page');
47 if( $iCurPage < 1 )
48  $iCurPage = 1;
50 $aSqlQuery = "LIMIT {$sLimitFrom}, {$iPerPage}";
52 
53 $aManage = array('medID', 'medProfId', 'medTitle', 'medUri', 'medDate', 'medViews', 'medExt', 'Approved');
54 
55 if ($iTotalNum > 0) {
56  $sMemberRSSSQL = "SELECT * FROM `ch_crss_main` {$aSqlQuery}";
57  $vMemberRSS = db_res($sMemberRSSSQL);
58 
59  while( $aRSSInfo = $vMemberRSS->fetch() ) {
60  $iRssID = (int)$aRSSInfo['ID'];
61  $sRssUrl = process_line_output($aRSSInfo['RSSUrl']);
62  $sRssDesc = process_line_output($aRSSInfo['Description']);
63  $sRssStatus = _t('_crss_status_' . process_line_output($aRSSInfo['Status']));
64  $sRssUrlJS = addslashes(htmlspecialchars($sRssUrl));
65  $sStatusColor = ($aRSSInfo['Status']=='active') ? 'green' : 'red';
66 
67  $sRSSs .= <<<EOF
68 <div class="ch-def-margin-sec-top-auto" style="position:relative; padding-left:30px;">
69  <div class="ch_sys_unit_checkbox ch-def-round-corners">
70  <input id="ch{$iRssID}" type="checkbox" value="{$iRssID}" name="crsss[]" />
71  </div>
72  <div class="ch-def-font-h3" >
73  {$sRssUrl}
74  </div>
75  <div>
76  <span style="color:$sStatusColor;">$sRssStatus</span> <span class="sys-bullet"></span> {$sRssDesc}
77  </div>
78 </div>
79 EOF;
80  }
81 
82  $sRequest = ch_html_attribute($_SERVER['PHP_SELF']) . '?page={page}&per_page={per_page}';
83 
85  // gen pagination block ;
86  $oPaginate = new ChWsbPaginate
87  (
88  array
89  (
90  'page_url' => $sRequest,
91  'count' => $iTotalNum,
92  'per_page' => $iPerPage,
93  'page' => $iCurPage,
94  )
95  );
96  $sPagination = $oPaginate -> getPaginate();
98 
99  ch_import('ChTemplSearchResult');
100  $oSearchResult = new ChTemplSearchResult();
101  $sAdmPanel = $oSearchResult->showAdminActionsPanel('crss_box', array('action_approve' => '_Approve', 'action_disapprove' => '_Disapprove', 'action_delete' => '_Delete'), 'crsss');
102  $sUrl = ch_html_attribute($_SERVER['PHP_SELF']);
103  $sCode .= <<<EOF
104 <form action="{$sUrl}" method="post" name="ads_moderation">
105  <div id="crss_box" class="ch-def-bc-padding">
106  {$sRSSs}
107  </div>
108  {$sPagination}
109  {$sAdmPanel}
110 </form>
111 EOF;
112 }
113 
114 $sHeaderValue = _t('_crss_Manager');
115 $sCode = ($sCode == '') ? MsgBox(_t('_Empty')) : $sCode;
117 
119 $_page = array(
120  'name_index' => $iNameIndex,
121  'css_name' => array('common.css', 'forms_adv.css'),
122  'header' => $sHeaderValue,
123  'header_text' => $sHeaderValue
124 );
125 $_page_cont[$iNameIndex]['page_main_code'] = $sResult;
126 PageCodeAdmin();
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
$sLimitFrom
$sLimitFrom
Definition: post_mod_crss.php:49
name
Core AllowHostnameUnderscore underscores are not permitted in host most browsers do the right thing when faced with an underscore in the host name
Definition: Core.AllowHostnameUnderscore.txt:11
$aManage
$aManage
Definition: post_mod_crss.php:53
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ch_get
ch_get($sName)
Definition: utils.inc.php:1664
$iCurPage
$iCurPage
Definition: post_mod_crss.php:46
$sUrl
$sUrl
Definition: cart.php:15
php
$_page_cont
$_page_cont[$iNameIndex]['page_main_code']
Definition: post_mod_crss.php:125
$aSqlQuery
$aSqlQuery
Definition: post_mod_crss.php:50
$iPerPage
$iPerPage
Definition: post_mod_crss.php:43
ch_html_attribute
ch_html_attribute($mixedInput)
Definition: utils.inc.php:1324
$sMemberRSSSQL
$sMemberRSSSQL
Definition: get_rss_feed.php:11
DesignBoxAdmin
DesignBoxAdmin($sTitle, $sContent, $mixedTopItems='', $sBottomItems='', $iIndex=1)
Definition: admin_design.inc.php:50
$iNameIndex
$iNameIndex
Definition: post_mod_crss.php:118
ChTemplSearchResult
Definition: ChTemplSearchResult.php:11
type
if(!defined("USER_STATUS_TYPE")) define("USER_STATUS_TYPE" type
Definition: constants.inc.php:13
$sResult
$sResult
Definition: post_mod_crss.php:116
ChWsbPaginate
Definition: ChWsbPaginate.php:69
$_page
$_page
Definition: post_mod_crss.php:119
PageCodeAdmin
PageCodeAdmin($oTemplate=null)
Definition: admin_design.inc.php:45
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
value
URI Base such as when URI MakeAbsolute is on You may use a non absolute URI for this value
Definition: URI.Base.txt:11
member_auth
member_auth($member=0, $error_handle=true, $bAjx=false)
Definition: admin.inc.php:262
method
and that you are informed that you can do these things To protect your we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For if you distribute copies of the whether gratis or for a you must give the recipients all the rights that we gave you You must make sure that receive or can get the source code If you link other code with the you must provide complete object files to the so that they can relink them with the library after making changes to the library and recompiling it And you must show them these terms so they know their rights We protect your rights with a two step method
Definition: license.txt:49
process_line_output
process_line_output($text, $maxwordlen=100)
Definition: utils.inc.php:328
$logged
$logged['admin']
Definition: post_mod_crss.php:12
db_res
db_res($query, $bindings=[])
Definition: db.inc.php:39
db_value
db_value($query, $bindings=[], $error_checking=true, $index=0)
Definition: db.inc.php:98
$sHeaderValue
if($iTotalNum > 0) $sHeaderValue
Definition: post_mod_crss.php:114
$iTotalNum
if(isset($_POST['crsss']) &&is_array($_POST['crsss'])) $iTotalNum
Definition: post_mod_crss.php:40
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
form
iii in the case of the organization that transmits the broadcast Work means the literary and or artistic work offered under the terms of this License including without limitation any production in the scientific and artistic whatever may be the mode or form of its expression including digital form
Definition: license.txt:19
$sCode
$sCode
Definition: post_mod_crss.php:115