Cheetah
customFunctions.inc.php
Go to the documentation of this file.
1 <?php
2 
8 require_once(CH_DIRECTORY_PATH_INC . 'admin.inc.php');
9 require_once(CH_DIRECTORY_PATH_INC . 'db.inc.php');
10 require_once(CH_DIRECTORY_PATH_INC . 'languages.inc.php');
11 require_once(CH_DIRECTORY_PATH_INC . 'profiles.inc.php');
12 
18  function save($sSavedId, $sFilePath, $sTitle)
19  {
20  @copy($sFilePath, $sFilePath . ".tmp");
21  $sFilePath .= ".tmp";
22  $aRes = array('status' => FAILED_VAL, 'value' => "msgErrorSave");
23 
24  define ('CH_BOARD_PHOTOS_CAT', 'Board');
25  define ('CH_BOARD_PHOTOS_TAG', 'Board');
26 
28  $aFileInfo = array (
29  'medTitle' => stripslashes($sTitle), 'medDesc' => stripslashes($sTitle),
30  'medTags' => CH_BOARD_PHOTOS_TAG, 'Categories' => array(CH_BOARD_PHOTOS_CAT),
31  'album' => str_replace('{nickname}', $aUser["NickName"], getParam('ch_photos_profile_album_name'))
32  );
33 
34  if ($sSavedId > 0) {
35  $iRet = ChWsbService::call('photos', 'perform_photo_replace', array($sFilePath, $aFileInfo, false, $sSavedId), 'Uploader');
36  if ($iRet) {
37  return array('status' => SUCCESS_VAL, 'value' => $sSavedId);
38  }
39  } else {
40  $iRet = ChWsbService::call('photos', 'perform_photo_upload', array($sFilePath, $aFileInfo, false), 'Uploader');
41  if ($iRet) {
42  return array('status' => SUCCESS_VAL, 'value' => $iRet);
43  }
44  }
45 
46  return $aRes;
47  }
48 
50  {
52 
53  $aBoard = ChWsbService::call('photos', 'get_photo_array', array($iBoardId, 'original'), 'Search');
54  if(count($aBoard)==0 || $sId != $aBoard["owner"])
55  $sResult = parseXml($aXmlTemplates["result"], "msgSavedError", FAILED_VAL);
56  else {
57  $sResult = parseXml($aXmlTemplates["result"], $iBoardId, SUCCESS_VAL);
58  $sResult .= parseXml($aXmlTemplates["savedBoard"], $aBoard["file"], $aBoard["title"]);
59  }
60  return $sResult;
61  }
getSavedBoardInfo
getSavedBoardInfo($sId, $iBoardId)
Definition: customFunctions.inc.php:49
$sResult
$sResult
Definition: advanced_settings.php:26
php
save
save($sSavedId, $sFilePath, $sTitle)
Definition: customFunctions.inc.php:18
copy
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 which gives you legal permission to copy
Definition: license.txt:50
$iBoardId
$iBoardId
Definition: actions.inc.php:12
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
$sTitle
$sTitle
Definition: actions.inc.php:13
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
parseXml
parseXml($aXmlTemplates)
Definition: apiFunctions.inc.php:15
$aUser
$aUser
Definition: profiles.inc.php:74
$aXmlTemplates
$aXmlTemplates
Definition: xmlTemplates.inc.php:8
$sId
$sId
Definition: actions.inc.php:8
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32