Cheetah
modules
cheetah
videos
classes
ChVideosDb.php
Go to the documentation of this file.
1
<?
php
2
8
require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbFilesDb.php'
);
9
10
class
ChVideosDb
extends
ChWsbFilesDb
11
{
12
/*
13
* Constructor.
14
*/
15
function
__construct
(&$oConfig)
16
{
17
parent::__construct($oConfig);
18
$this->aFileFields[
'medExt'
] =
'Video'
;
19
$this->aFileFields[
'medSource'
] =
'Source'
;
20
$this->sFileTable =
'RayVideoFiles'
;
21
$this->sFavoriteTable =
'ch_videos_favorites'
;
22
}
23
24
function
getSettingsCategory
()
25
{
26
return
(
int
)$this->
getOne
(
"SELECT `ID` FROM `sys_options_cats` WHERE `name` = 'Videos' LIMIT 1"
);
27
}
28
29
function
updateVideo
(
$iId
, $aData) {
30
// process all recived fields;
31
foreach
($aData
as
$sKey => $mValue) {
32
$mValue =
process_db_input
($mValue,
CH_TAGS_VALIDATE
,
CH_SLASHES_AUTO
);
33
$sKey =
process_db_input
($sKey,
CH_TAGS_STRIP
,
CH_SLASHES_NO_ACTION
);
34
$sFields .=
"`{$sKey}` = '{$mValue}', "
;
35
}
36
37
$sFields = preg_replace(
'/,$/'
,
''
, trim($sFields) );
38
39
$sQuery =
"UPDATE `RayVideoFiles` SET {$sFields} WHERE `ID` = '$iId'"
;
40
$this ->
query
($sQuery);
41
}
42
43
function
getVideoData
(
$iId
) {
44
$sQuery =
"SELECT * FROM `RayVideoFiles` WHERE `ID` = '$iId'"
;
45
return
$this ->
getRow
($sQuery);
46
}
47
48
}
process_db_input
process_db_input($sText, $iStripTags=0)
Definition:
utils.inc.php:256
ChVideosDb
Definition:
ChVideosDb.php:11
CH_TAGS_VALIDATE
const CH_TAGS_VALIDATE
Definition:
utils.inc.php:24
php
$iId
$iId
Definition:
license.php:15
ChVideosDb\updateVideo
updateVideo($iId, $aData)
Definition:
ChVideosDb.php:29
CH_SLASHES_NO_ACTION
const CH_SLASHES_NO_ACTION
Definition:
utils.inc.php:30
ChWsbDb\getRow
getRow($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
Definition:
ChWsbDb.php:225
ChWsbDb\query
query($sQuery, $aBindings=[])
Definition:
ChWsbDb.php:386
ChVideosDb\getVideoData
getVideoData($iId)
Definition:
ChVideosDb.php:43
ChWsbDb\getOne
getOne($sQuery, $aBindings=[], $iIndex=0)
Definition:
ChWsbDb.php:263
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition:
utils.inc.php:22
ChVideosDb\__construct
__construct(&$oConfig)
Definition:
ChVideosDb.php:15
ChWsbFilesDb
Definition:
ChWsbFilesDb.php:11
ChVideosDb\getSettingsCategory
getSettingsCategory()
Definition:
ChVideosDb.php:24
CH_SLASHES_AUTO
const CH_SLASHES_AUTO
Definition:
utils.inc.php:27
as
as
Definition:
Filter.ExtractStyleBlocks.Escaping.txt:10
Generated by
1.8.20