• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BxDolTags类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中BxDolTags的典型用法代码示例。如果您正苦于以下问题:PHP BxDolTags类的具体用法?PHP BxDolTags怎么用?PHP BxDolTags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BxDolTags类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * Function will transfer all profile's polls;
  * 
  * @return : (string) - error message or empty;
  */
 function process()
 {
     $sTableMainNew = $this->sTablePrefix . $this->oDolModule->_oDb->_sTableMain;
     if ($this->oMigrationModule->_oDb->getOne("SELECT COUNT(*) FROM `{$sTableMainNew}`") > 0) {
         return 'Error: it is possible to transfaer data to clean install only, in your case some existing data was found.';
     }
     $sQuery = "SELECT * FROM `SDatingEvents`";
     $rResult = mysql_query($sQuery, $this->rOldDb);
     while ($r = mysql_fetch_assoc($rResult)) {
         $r = $this->escapeData($r);
         //count participants
         $iParticipants = $this->getParticipantsCount($r['ID']);
         $sStatus = $r['Status'] == 'Active' ? 'approved' : 'pending';
         // execute query;
         $sQuery = "\r\n                    INSERT INTO\r\n                        `{$sTableMainNew}` \r\n                    SET \r\n                        `ID` = {$r['ID']},\r\n                        `Title` = '{$r['Title']}', \r\n                        `EntryUri` = '{$r['EntryUri']}',\r\n                        `Description` = '{$r['Description']}',\r\n                        `Status` = '{$sStatus}', \r\n                        `Country` = '{$r['Country']}',\r\n                        `City` = '{$r['City']}',\r\n                        `Place` = '{$r['Place']}',\r\n                        `PrimPhoto` = '',\r\n                        `Date` = UNIX_TIMESTAMP('{$r['EventStart']}'),\r\n                        `EventStart` = UNIX_TIMESTAMP('{$r['EventStart']}'),\r\n                        `EventEnd` = UNIX_TIMESTAMP('{$r['EventStart']}'),\r\n                        `ResponsibleID` = '{$r['ResponsibleID']}',\r\n                        `EventMembershipFilter` = '{$this->aDefValues['EventMembershipFilter']}',\r\n                        `Tags` = '{$r['Tags']}',\r\n                        `Categories` = '',\r\n                        `Views` = '0',\r\n                        `Rate` = '0',\r\n                        `RateCount` = '0',\r\n                        `CommentsCount` = '0',\r\n                        `FansCount` = '{$iParticipants}',\r\n                        `Featured` = '0',\r\n                        `allow_view_event_to` = '{$this->aDefValues['allow_view_event_to']}',\r\n                        `allow_view_participants_to` = '{$this->aDefValues['allow_view_participants_to']}',\r\n                        `allow_comment_to` = '{$this->aDefValues['allow_comment_to']}',\r\n                        `allow_rate_to` = '{$this->aDefValues['allow_rate_to']}',\r\n                        `allow_join_to` = '{$this->aDefValues['allow_join_to']}',\r\n                        `allow_post_in_forum_to` = '{$this->aDefValues['allow_post_in_forum_to']}',\r\n                        `JoinConfirmation` = '{$this->aDefValues['JoinConfirmation']}',\r\n                        `allow_upload_photos_to` = '{$this->aDefValues['allow_upload_photos_to']}',\r\n                        `allow_upload_videos_to` = '{$this->aDefValues['allow_upload_videos_to']}',\r\n                        `allow_upload_sounds_to` = '{$this->aDefValues['allow_upload_sounds_to']}',\r\n                        `allow_upload_files_to` = '{$this->aDefValues['allow_upload_files_to']}'\r\n               ";
         $iResult = (int) $this->oMigrationModule->_oDb->query($sQuery);
         if ($iResult <= 0) {
             return 'Database error: can not insert new event into the table.';
         }
         //reparse tags
         $oTag = new BxDolTags();
         $oTag->reparseObjTags('bx_events', $r['ID']);
         // transfer partocipants
         $this->_transferParticipants($r['ID']);
         // transfer photo;
         $this->_transferEventPhoto($r);
         $this->iTransffered++;
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:34,代码来源:BxDataMigrationEvents.php


示例2: getMigration

 /**
  * Function migrate sounds;
  * 
  * @return : (integer) operation result;
  */
 function getMigration()
 {
     if (!$this->oDolModule) {
         $this->setResultStatus('System error: object  instance is not received');
         return MIGRATION_FAILED;
     }
     // set new status;
     $this->setResultStatus('All sounds transfer now');
     mysql_query('SET NAMES utf8', $this->rOldDb);
     $sQuery = "SELECT * FROM `RayMusicFiles`";
     $rResult = mysql_query($sQuery, $this->rOldDb);
     while ($aRow = mysql_fetch_assoc($rResult)) {
         if (!$this->isSoundsExisting($aRow['ID'])) {
             // escape all data;
             $aRow = $this->escapeData($aRow);
             //transform the file
             if (!$this->_exportFile($aRow['ID'])) {
                 continue;
             }
             // define file status;
             $sFileStatus = $aRow['Approved'] == 'true' ? 'approved' : 'disapproved';
             // execute query;
             $sQuery = "\r\n                    \tINSERT INTO\r\n                    \t\t`RayMp3Files`\r\n                    \tSET\r\n                    \t\t`ID` \t\t\t= {$aRow['ID']},\r\n                    \t\t`Title` \t\t= '{$aRow['Title']}',\r\n                    \t\t`Uri` \t\t\t= '{$aRow['Uri']}',\r\n                    \t\t`Tags` \t\t\t= '{$aRow['Tags']}',\r\n                    \t\t`Description` \t= '{$aRow['Description']}',\r\n                    \t\t`Time`\t \t\t= '{$aRow['Time']}',\r\n                    \t\t`Date`\t \t\t= '{$aRow['Date']}',\r\n                    \t\t`Reports` \t\t= '{$aRow['Reports']}',\r\n                    \t\t`Owner` \t\t= '{$aRow['Owner']}',\r\n                    \t\t`Listens` \t\t= '{$aRow['Listens']}',\r\n                    \t\t`Status` \t\t= '{$sFileStatus}'\r\n\t\r\n                    ";
             $iResult = (int) $this->oMigrationModule->_oDb->query($sQuery);
             if ($iResult <= 0) {
                 $this->setResultStatus('Database error. Cannot insert new sound in the database.');
                 return MIGRATION_FAILED;
             }
             $oTag = new BxDolTags();
             $oTag->reparseObjTags($this->sType, $aRow['ID']);
             // define sound's album;
             $sError = $this->_defineSoundsAlbum($aRow['ID'], $aRow['Owner'], $aRow['Title']);
             if ($sError) {
                 $this->setResultStatus($sError);
                 return MIGRATION_FAILED;
             }
             $sError = $this->_exportVotings($aRow['ID']);
             if ($sError) {
                 $this->setResultStatus($sError);
                 return MIGRATION_FAILED;
             }
             $sError = $this->_exportComments($aRow['ID']);
             if ($sError) {
                 $this->setResultStatus($sError);
                 return MIGRATION_FAILED;
             }
             $this->iTransffered++;
         } else {
             $this->setResultStatus('Duplicate data. 
                 		Sounds with similar info already exists 
                 		(remove all sounds and start again');
             return MIGRATION_FAILED;
         }
     }
     // set as finished;
     $this->setResultStatus('All sound were transferred (' . $this->iTransffered . ' items)');
     return MIGRATION_SUCCESSFUL;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:63,代码来源:BxDataMigrationSounds.php


示例3: getMigration

 /**
  * Function migrate shared_photos data;
  * 
  * @return : (integer) operation result;
  */
 function getMigration()
 {
     if (!$this->oDolModule) {
         $this->setResultStatus('System error: object  instance is not received');
         return MIGRATION_FAILED;
     }
     // set new status;
     $this->setResultStatus('Shared photos transfer now');
     mysql_query('SET NAMES utf8', $this->rOldDb);
     $sqlQuery = "SELECT * FROM `{$this->aOldTables['main']}` GROUP BY `medID`";
     $rResult = mysql_query($sqlQuery, $this->rOldDb);
     while ($aRow = mysql_fetch_assoc($rResult)) {
         $sUri = !$this->isEntryExisting($aRow['medUri']) ? $aRow['medUri'] : uriGenerate($aRow['medTitle'], $this->sType . '_main', 'Uri');
         $sUri = $this->oMigrationModule->_oDb->escape($sUri);
         $aSizeInfo = $this->getSizeInfo($aRow['medID'] . '.' . $aRow['medExt']);
         $sSize = $aSizeInfo['width'] . 'x' . $aSizeInfo['height'];
         $sStatus = $aRow['Approved'] == 'true' ? 'approved' : 'disapproved';
         $sHash = md5(microtime());
         // escape all data;
         $aRow = $this->escapeData($aRow);
         $sqlQuery = "\n\t                INSERT INTO \n\t                \t`{$this->sType}_main`\n\t                SET\n\t\t\t\t\t  `Owner` = '{$aRow['medProfId']}',\n\t\t\t\t\t  `Ext`   = '{$aRow['medExt']}',\n\t\t\t\t\t  `Size`  = '{$sSize}',\n\t\t\t\t\t  `Title` = '{$aRow['medTitle']}',\n\t\t\t\t\t  `Uri`   = '{$sUri}',\n\t\t\t\t\t  `Desc`  = '{$aRow['medDesc']}',\n\t\t\t\t\t  `Tags`  = '{$aRow['medTags']}',\n\t\t\t\t\t  `Date`  = '{$aRow['medDate']}',\n\t\t\t\t\t  `Views` = '{$aRow['medViews']}',\n\t\t\t\t\t  `Hash`  = '{$sHash}',\n\t\t\t\t\t  `Status` = '{$sStatus}'\n                ";
         $iResult = (int) $this->oMigrationModule->_oDb->query($sqlQuery);
         if ($iResult <= 0) {
             $this->setResultStatus('Database error. Cannot insert new photo to the database.');
             return MIGRATION_FAILED;
         }
         // get last file id;
         $iFileId = $this->oMigrationModule->_oDb->lastId();
         //transform the file
         $this->_exportFile(array('medID' => $aRow['medID'], 'medFile' => $aRow['medFile'], 'medProfId' => $aRow['medProfId'], 'medExt' => $aRow['medExt'], 'newID' => $iFileId));
         $oTag = new BxDolTags();
         $oTag->reparseObjTags($this->sType, $iFileId);
         // define album
         $sError = $this->_defineAlbum($iFileId, $aRow['medProfId'], $aRow['medTitle']);
         if ($sError) {
             $this->setResultStatus($sError);
             return MIGRATION_FAILED;
         }
         $sError = $this->_exportFavorites(array('old' => $aRow['medID'], 'new' => $iFileId));
         if ($sError) {
             $this->setResultStatus($sError);
             return MIGRATION_FAILED;
         }
         $sError = $this->_exportVotings(array('old' => $aRow['medID'], 'new' => $iFileId));
         if ($sError) {
             $this->setResultStatus($sError);
             return MIGRATION_FAILED;
         }
         $sError = $this->_exportComments(array('old' => $aRow['medID'], 'new' => $iFileId));
         if ($sError) {
             $this->setResultStatus($sError);
             return MIGRATION_FAILED;
         }
     }
     // set as finished;
     $this->setResultStatus('All photos were transferred');
     return MIGRATION_SUCCESSFUL;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:63,代码来源:BxDataMigrationSharedPhotos.php


示例4: processing

 function processing()
 {
     global $sModule;
     global $sFfmpegPath;
     global $sModulesPath;
     global $sFilesPath;
     $iFilesCount = getSettingValue($sModule, "processCount");
     if (!is_numeric($iFilesCount)) {
         $iFilesCount = 2;
     }
     $iFailedTimeout = getSettingValue($sModule, "failedTimeout");
     if (!is_numeric($iFailedTimeout)) {
         $iFailedTimeout = 1;
     }
     $iFailedTimeout *= 86400;
     $sDbPrefix = DB_PREFIX . ucfirst($sModule);
     $iCurrentTime = time();
     do {
         //remove all tokens older than 10 minutes
         if (!getResult("DELETE FROM `" . $sDbPrefix . "Tokens` WHERE `Date`<'" . ($iCurrentTime - 600) . "'")) {
             break;
         }
         if (!getResult("UPDATE `" . $sDbPrefix . "Files` SET `Date`='" . $iCurrentTime . "', `Status`='" . STATUS_FAILED . "' WHERE `Status`='" . STATUS_PROCESSING . "' AND `Date`<'" . ($iCurrentTime - $iFailedTimeout) . "'")) {
             break;
         }
         $rResult = getResult("SELECT * FROM `" . $sDbPrefix . "Files` WHERE `Status`='" . STATUS_PENDING . "' ORDER BY `ID` LIMIT " . $iFilesCount);
         if (!$rResult) {
             break;
         }
         for ($i = 0; $i < mysql_num_rows($rResult); $i++) {
             $aFile = mysql_fetch_assoc($rResult);
             if (convertVideo($aFile['ID'])) {
                 $sType = 'bx_videos';
                 //album counter & cover update
                 if (getSettingValue($sModule, "autoApprove") == TRUE_VAL) {
                     $oAlbum = new BxDolAlbums($sType);
                     $oAlbum->updateObjCounterById($aFile['ID']);
                     if (getParam($oAlbum->sAlbumCoverParam) == 'on') {
                         $oAlbum->updateLastObjById($aFile['ID']);
                     }
                 }
                 //tags & categories parsing
                 $oTag = new BxDolTags();
                 $oTag->reparseObjTags($sType, $aFile['ID']);
                 $oCateg = new BxDolCategories($aFile['Owner']);
                 $oCateg->reparseObjTags($sType, $aFile['ID']);
             } else {
                 if (!getResult("UPDATE `" . $sDbPrefix . "Files` SET `Status`='" . STATUS_FAILED . "' WHERE `ID`='" . $aFile['ID'] . "'")) {
                     break;
                 }
             }
         }
     } while (false);
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:54,代码来源:BxDolCronVideo.php


示例5: processing

 function processing()
 {
     $aIds = array();
     if ($this->_oModule->_oDb->publish($aIds)) {
         foreach ($aIds as $iId) {
             //--- Entry -> Publish for Alerts Engine ---//
             $oAlert = new BxDolAlerts($this->_oModule->_oConfig->getAlertsSystemName(), 'publish', $iId);
             $oAlert->alert();
             //--- Entry -> Publish for Alerts Engine ---//
             //--- Reparse Global Tags ---//
             $oTags = new BxDolTags();
             $oTags->reparseObjTags($this->_oModule->_oConfig->getTagsSystemName(), $iId);
             //--- Reparse Global Tags ---//
             //--- Reparse Global Categories ---//
             $oCategories = new BxDolCategories();
             $oCategories->reparseObjTags($this->_oModule->_oConfig->getCategoriesSystemName(), $iId);
             //--- Reparse Global Categories ---//
         }
     }
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:20,代码来源:BxDolTextCron.php


示例6: displayList

 function displayList($aParams)
 {
     $sSampleType = $aParams['sample_type'];
     $iViewerType = $aParams['viewer_type'];
     $iStart = isset($aParams['start']) ? (int) $aParams['start'] : -1;
     $iPerPage = isset($aParams['count']) ? (int) $aParams['count'] : -1;
     $bShowEmpty = isset($aParams['show_empty']) ? $aParams['show_empty'] : true;
     $bAdminPanel = $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (isset($aParams['admin_panel']) && $aParams['admin_panel'] || $sSampleType == 'admin');
     $sModuleUri = $this->_oConfig->getUri();
     $aEntries = $this->_oDb->getEntries($aParams);
     if (empty($aEntries)) {
         return $bShowEmpty ? MsgBox(_t('_' . $sModuleUri . '_msg_no_results')) : "";
     }
     $oTags = new BxDolTags();
     $oCategories = new BxDolCategories();
     //--- Language translations ---//
     $sLKLinkPublish = _t('_' . $sModuleUri . '_lcaption_publish');
     $sLKLinkEdit = _t('_' . $sModuleUri . '_lcaption_edit');
     $sLKLinkDelete = _t('_' . $sModuleUri . '_lcaption_delete');
     $sBaseUri = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri();
     $sJsMainObject = $this->_oConfig->getJsObject();
     $aResult['sample'] = $sSampleType;
     $aResult['bx_repeat:entries'] = array();
     foreach ($aEntries as $aEntry) {
         $sVotes = "";
         if ($this->_oConfig->isVotesEnabled()) {
             $oVotes = $this->_oModule->_createObjectVoting($aEntry['id']);
             $sVotes = $oVotes->getJustVotingElement(0, $aEntry['id']);
         }
         $aTags = $oTags->explodeTags($aEntry['tags']);
         $aCategories = $oCategories->explodeTags($aEntry['categories']);
         $aTagItems = array();
         foreach ($aTags as $sTag) {
             $sTag = trim($sTag);
             $aTagItems[] = array('href' => $sBaseUri . 'tag/' . title2uri($sTag), 'title' => $sTag);
         }
         $aCategoryItems = array();
         foreach ($aCategories as $sCategory) {
             $sCategory = trim($sCategory);
             $aCategoryItems[] = array('href' => $sBaseUri . 'category/' . title2uri($sCategory), 'title' => $sCategory);
         }
         $aResult['bx_repeat:entries'][] = array('id' => $this->_oConfig->getSystemPrefix() . $aEntry['id'], 'caption' => str_replace("\$", "&#36;", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet' : '', 'date' => getLocaleDate($aEntry['when_uts'], BX_DOL_LOCALE_DATE), 'comments' => (int) $aEntry['cmts_count'], 'bx_repeat:categories' => $aCategoryItems, 'bx_repeat:tags' => $aTagItems, 'content' => str_replace("\$", "&#36;", $aEntry['content']), 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'], 'voting' => $sVotes, 'bx_if:checkbox' => array('condition' => $bAdminPanel, 'content' => array('id' => $aEntry['id'])), 'bx_if:status' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('status' => _t('_' . $sModuleUri . '_status_' . $aEntry['status']))), 'bx_if:featured' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (int) $aEntry['featured'] == 1, 'content' => array()), 'bx_if:edit_link' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('edit_link_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'admin/' . $aEntry['uri'], 'edit_link_caption' => $sLKLinkEdit)));
     }
     $aResult['paginate'] = '';
     if (!in_array($sSampleType, array('id', 'uri', 'view', 'search_unit'))) {
         if (!empty($sSampleType)) {
             $this->_updatePaginate($aParams);
         }
         $aResult['paginate'] = $this->oPaginate->getPaginate($iStart, $iPerPage);
     }
     $aResult['loading'] = LoadingBox($sModuleUri . '-' . $sSampleType . '-loading');
     $sRes = $this->parseHtmlByName('list.html', $aResult);
     return $sRes;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:54,代码来源:BxDolTextTemplate.php


示例7: BxDolCategories

 function BxDolCategories($iPossOwner = 0)
 {
     parent::BxDolTags();
     $this->iViewer = (int) $iPossOwner > 0 ? (int) $iPossOwner : $this->iViewer;
     $this->sCacheFile = 'sys_objects_categories';
     $this->sNonParseParams = 'tags_non_parsable';
     $this->sCacheTable = 'sys_objects_categories';
     $this->sTagTable = 'sys_categories';
     $this->aTagFields = array('id' => 'ID', 'type' => 'Type', 'tag' => 'Category', 'owner' => 'Owner', 'status' => 'Status', 'date' => 'Date');
     $this->sAutoApprovePrefix = 'category_auto_app_';
     $this->bToLower = false;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:12,代码来源:BxDolCategories.php


示例8: savePage


//.........这里部分代码省略.........
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'file':
                     $sTable = 'ml_clonetwo_files';
                     $iIdField = 'entry_id';
                     $iMedIdField = 'media_id';
                     if (!empty($_POST[$sValue . '_check_files'])) {
                         foreach ($_POST[$sValue . '_check_files'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iMedIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     if (BxDolRequest::serviceExists("files", "perform_file_upload", 'Uploader')) {
                         $i = 0;
                         if ($sData) {
                             foreach ($aMediaData as $sData) {
                                 $aInfo = array('medTitle' => $_POST[$sValue . '_title_files'][$i] ? $_POST[$sValue . '_title_files'][$i] : $_FILES[$sValue]['name'][$i], 'Categories' => array($aUpd['title'] . ' ' . _t("_bx_{$sKey}s")), 'album' => _t('_ml_clonetwo_photo_album', $aUpd['title']));
                                 $this->looper();
                                 $iMediaId = BxDolService::call("files", "perform_file_upload", array($GLOBALS['dir']['tmp'] . $sData, $aInfo, false), 'Uploader');
                                 if ($iMediaId) {
                                     @unlink($GLOBALS['dir']['tmp'] . $sData);
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'youtube':
                     $i = 0;
                     $sTable = 'ml_clonetwo_youtube';
                     $iUIdField = 'id';
                     $iIdField = 'id_entry';
                     $sUrlField = 'url';
                     $sTitleField = 'title';
                     if (!empty($_POST[$sValue . '_check_youtube'])) {
                         foreach ($_POST[$sValue . '_check_youtube'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iUIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     foreach ($aMediaData as $sData) {
                         if ($sData) {
                             $sTitle = $_POST[$sValue . '_title_youtube'][$i];
                             if (db_value("SHOW TABLES LIKE '{$sTable}'") && $sData) {
                                 db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$sUrlField}` = '{$sData}', `{$sTitleField}` = '{$sTitle}'");
                             }
                         }
                         $i++;
                     }
                     break;
                 case 'rss':
                     $i = 0;
                     $sTable = 'ml_clonetwo_rss';
                     $iUIdField = 'id';
                     $iIdField = 'id_entry';
                     $sUrlField = 'url';
                     $sTitleField = 'name';
                     if (!empty($_POST[$sValue . '_check_rss'])) {
                         foreach ($_POST[$sValue . '_check_rss'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iUIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     foreach ($aMediaData as $sData) {
                         if ($sData) {
                             $sTitle = $_POST[$sValue . '_title_rss'][$i];
                             if (db_value("SHOW TABLES LIKE '{$sTable}'") && $sData) {
                                 db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$sUrlField}` = '{$sData}', `{$sTitleField}` = '{$sTitle}'");
                             }
                         }
                         $i++;
                     }
                     break;
             }
         }
     }
     $oModuleDb = new BxDolModuleDb();
     $aModule = $oModuleDb->getModuleByUri('clonetwo');
     $iProfileId = getLoggedId();
     bx_import('BxDolTags');
     $o = new BxDolTags();
     $o->reparseObjTags('ml_clonetwo', $this->iPageID);
     bx_import('BxDolCategories');
     $o = new BxDolCategories();
     $o->reparseObjTags('ml_clonetwo', $this->iPageID);
     $this->oPC->updatePage($this->iPageID, $aUpd);
 }
开发者ID:scriptologist,项目名称:Multi-Module-Creator-Plus,代码行数:101,代码来源:MlClonetwoPageEditProcessor.php


示例9: _actDelete

 function _actDelete($aIds)
 {
     if (!$this->_isDeleteAllowed(true)) {
         return false;
     }
     if (is_int($aIds) || is_string($aIds)) {
         $aIds = array((int) $aIds);
     }
     $bResult = $this->_oDb->deleteEntries($aIds);
     if ($bResult) {
         $oTags = new BxDolTags();
         $oCategories = new BxDolCategories();
         $oSubscription = BxDolSubscription::getInstance();
         foreach ($aIds as $iId) {
             //--- Entry -> Delete for Alerts Engine ---//
             $oAlert = new BxDolAlerts($this->_oConfig->getAlertsSystemName(), 'delete', $iId, BxDolTextData::getAuthorId());
             $oAlert->alert();
             //--- Entry -> Delete for Alerts Engine ---//
             //--- Reparse Global Tags ---//
             $oTags->reparseObjTags($this->_oConfig->getTagsSystemName(), $iId);
             //--- Reparse Global Tags ---//
             //--- Reparse Global Categories ---//
             $oCategories->reparseObjTags($this->_oConfig->getCategoriesSystemName(), $iId);
             //--- Reparse Global Categories ---//
             //--- Remove all subscriptions ---//
             $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_oConfig->getSubscriptionsSystemName(), 'object_id' => $iId));
             //--- Remove all subscriptions ---//
         }
     }
     return $bResult;
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:31,代码来源:BxDolTextModule.php


示例10: reparseObjTags

function reparseObjTags($sType, $iID)
{
    $oTags = new BxDolTags();
    $oTags->reparseObjTags($sType, $iID);
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:5,代码来源:tags.inc.php


示例11: initMusicFile

 function initMusicFile($iMusicID, $sTitle, $sCategories, $sTags, $sDesc)
 {
     $sMedUri = uriGenerate($sTitle, $this->oModule->_oDb->sFileTable, $this->oModule->_oDb->aFileFields['medUri']);
     $bRes = $this->oModule->_oDb->updateData($iMusicID, array('Categories' => $sCategories, 'medTitle' => $sTitle, 'medTags' => $sTags, 'medDesc' => $sDesc, 'medUri' => $sMedUri));
     $oTag = new BxDolTags();
     $oTag->reparseObjTags('bx_sounds', $iMusicID);
     $oCateg = new BxDolCategories();
     $oCateg->reparseObjTags('bx_sounds', $iMusicID);
     $bRes = true;
     //TODO chech why if false
     return $bRes;
 }
开发者ID:noormcs,项目名称:studoro,代码行数:12,代码来源:BxSoundsUploader.php


示例12: insertSharedMediaToDb

 function insertSharedMediaToDb($sExt, $aFileInfo, $iAuthorId = 0, $aExtraData = array())
 {
     if (!$iAuthorId) {
         $iAuthorId = $this->_iOwnerId;
     }
     if (getParam($this->oModule->_oConfig->aGlParams['auto_activation']) == 'on') {
         $bAutoActivate = true;
         $sStatus = 'approved';
     } else {
         $bAutoActivate = false;
         $sStatus = 'pending';
     }
     $sFileTitle = $aFileInfo['medTitle'];
     $sFileDesc = $aFileInfo['medDesc'];
     $sFileTags = $aFileInfo['medTags'];
     $sCategory = implode(CATEGORIES_DIVIDER, $aFileInfo['Categories']);
     $sDimension = isset($aFileInfo['dimension']) ? $aFileInfo['dimension'] : (int) $aFileInfo['medSize'];
     $sAlbum = mb_strlen($_POST['extra_param_album']) > 0 ? $_POST['extra_param_album'] : getParam('sys_album_default_name');
     $sAlbum = isset($aFileInfo['album']) ? $aFileInfo['album'] : $sAlbum;
     $sMedUri = uriGenerate($sFileTitle, $this->oModule->_oDb->sFileTable, $this->oModule->_oDb->aFileFields['medUri']);
     $sExtDb = trim($sExt, '.');
     $sCurTime = time();
     $aData = array('medProfId' => $iAuthorId, 'medExt' => $sExtDb, 'medTitle' => $sFileTitle, 'medUri' => $sMedUri, 'medDesc' => $sFileDesc, 'medTags' => $sFileTags, 'Categories' => $sCategory, 'medSize' => $sDimension, 'Approved' => $sStatus, 'medDate' => $sCurTime);
     $aData = array_merge($aData, $aExtraData);
     $iInsertedID = $this->oModule->_oDb->insertData($aData);
     if (0 < $iInsertedID) {
         $oTag = new BxDolTags();
         $oTag->reparseObjTags($this->oModule->_oConfig->sPrefix, $iInsertedID);
         $oCateg = new BxDolCategories();
         $oCateg->reparseObjTags($this->oModule->_oConfig->sPrefix, $iInsertedID);
         $aAlbumParams = isset($aFileInfo['albumPrivacy']) ? array('privacy' => $aFileInfo['albumPrivacy']) : array();
         $this->addObjectToAlbum($this->oModule->oAlbums, $sAlbum, $iInsertedID, $bAutoActivate, $iAuthorId, $aAlbumParams);
         return $iInsertedID;
     }
     return 0;
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:36,代码来源:BxDolFilesUploader.php


示例13: AddNewPostForm


//.........这里部分代码省略.........
        if (empty($aForm['inputs']['allowComment']['value']) || !$aForm['inputs']['allowComment']['value']) {
            $aForm['inputs']['allowComment']['value'] = BX_DOL_PG_ALL;
        }
        $oForm = new BxTemplFormView($aForm);
        $oForm->initChecker();
        if ($oForm->isSubmittedAndValid()) {
            $this->CheckLogged();
            $iOwnID = $this->_iVisitorID;
            $sCurTime = time();
            $sPostUri = uriGenerate(bx_get('PostCaption'), $this->_oConfig->sSQLPostsTable, 'PostUri');
            $sAutoApprovalVal = getParam('blogAutoApproval') == 'on' ? "approval" : "disapproval";
            /*$aCategories = array();
            		foreach (bx_get('Category') as $sKey => $sVal) {
            			if ($sVal != '') {
            				$aCategories[] = process_db_input($sVal);
            			}
            		}
            		$sCategories = implode(CATEGORIES_DIVIDER, $aCategories);*/
            $aValsAdd = array('PostDate' => $sCurTime, 'PostStatus' => $sAutoApprovalVal);
            if ($iPostID == 0) {
                $aValsAdd['OwnerID'] = $iOwnID;
                $aValsAdd['PostUri'] = $sPostUri;
            }
            $iBlogPostID = -1;
            if ($iPostID > 0) {
                unset($aValsAdd['PostDate']);
                $oForm->update($iPostID, $aValsAdd);
                $this->isAllowedPostEdit($iOwnerID, true);
                $iBlogPostID = $iPostID;
            } else {
                $iBlogPostID = $oForm->insert($aValsAdd);
                $this->isAllowedPostAdd(true);
            }
            if ($iBlogPostID) {
                $this->iLastPostedPostID = $iBlogPostID;
                if ($_FILES) {
                    for ($i = 0; $i < count($_FILES['BlogPic']['tmp_name']); $i++) {
                        if ($_FILES['BlogPic']['error'][$i]) {
                            continue;
                        }
                        if (0 < $_FILES['BlogPic']['size'][$i] && 0 < strlen($_FILES['BlogPic']['name'][$i]) && 0 < $iBlogPostID) {
                            $sTmpFile = $_FILES['BlogPic']['tmp_name'][$i];
                            if (file_exists($sTmpFile) == false) {
                                break;
                            }
                            $aSize = getimagesize($sTmpFile);
                            if (!$aSize) {
                                @unlink($sTmpFile);
                                break;
                            }
                            switch ($aSize[2]) {
                                case IMAGETYPE_JPEG:
                                case IMAGETYPE_GIF:
                                case IMAGETYPE_PNG:
                                    $sOriginalFilename = $_FILES['BlogPic']['name'][$i];
                                    $sExt = strrchr($sOriginalFilename, '.');
                                    $sFileName = 'blog_' . $iBlogPostID . '_' . $i;
                                    @unlink($sFileName);
                                    move_uploaded_file($sTmpFile, BX_BLOGS_IMAGES_PATH . $sFileName . $sExt);
                                    @unlink($sTmpFile);
                                    if (strlen($sExt)) {
                                        imageResize(BX_BLOGS_IMAGES_PATH . $sFileName . $sExt, BX_BLOGS_IMAGES_PATH . 'small_' . $sFileName . $sExt, $this->iIconSize / 1, $this->iIconSize / 1);
                                        imageResize(BX_BLOGS_IMAGES_PATH . $sFileName . $sExt, BX_BLOGS_IMAGES_PATH . 'big_' . $sFileName . $sExt, $this->iThumbSize, $this->iThumbSize);
                                        imageResize(BX_BLOGS_IMAGES_PATH . $sFileName . $sExt, BX_BLOGS_IMAGES_PATH . 'orig_' . $sFileName . $sExt, $this->iImgSize, $this->iImgSize);
                                        chmod(BX_BLOGS_IMAGES_PATH . 'small_' . $sFileName . $sExt, 0644);
                                        chmod(BX_BLOGS_IMAGES_PATH . 'big_' . $sFileName . $sExt, 0644);
                                        chmod(BX_BLOGS_IMAGES_PATH . 'orig_' . $sFileName . $sExt, 0644);
                                        $this->_oDb->performUpdatePostWithPhoto($iBlogPostID, $sFileName . $sExt);
                                        @unlink(BX_BLOGS_IMAGES_PATH . $sFileName . $sExt);
                                    }
                                    break;
                                default:
                                    @unlink($sTempFileName);
                                    return false;
                            }
                        }
                    }
                }
                //reparse tags
                bx_import('BxDolTags');
                $oTags = new BxDolTags();
                $oTags->reparseObjTags('blog', $iBlogPostID);
                //reparse categories
                $oCategories = new BxDolCategories();
                $oCategories->reparseObjTags('bx_blogs', $iBlogPostID);
                $sAlertAction = $iPostID == 0 ? 'create' : 'edit_post';
                bx_import('BxDolAlerts');
                $oZ = new BxDolAlerts('bx_blogs', $sAlertAction, $iBlogPostID, $this->_iVisitorID);
                $oZ->alert();
                return $this->GenPostPage($iBlogPostID);
            } else {
                return MsgBox($sErrorC);
            }
        } else {
            $sAddingForm = $oForm->getCode();
        }
        $sCaption = $iPostID ? $sEditPostC : $sNewPostC;
        $sAddingFormVal = '<div class="blogs-view usualTextMarg">' . $sAddingForm . '</div>';
        return $bBox ? DesignBoxContent($sCaption, '<div class="blogs-view usualTextMarg">' . $sAddingForm . '</div>', 1) : $sAddingFormVal;
    }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:101,代码来源:BxBlogsModule.php


示例14: adminDisapproveFile

 function adminDisapproveFile($iFileId)
 {
     $iFileId = (int) $iFileId;
     $aInfo = $this->_oDb->getFileInfo(array('fileId' => $iFileId), true, array('Approved'));
     $this->_oDb->disapproveFile($iFileId);
     if ($aInfo['Approved'] == 'approved') {
         $this->oAlbums->updateObjCounterById($iFileId, false);
         bx_import('BxDolCategories');
         //tags & categories parsing
         $oTag = new BxDolTags();
         $oTag->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
         $oCateg = new BxDolCategories();
         $oCateg->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
     }
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:15,代码来源:BxDolFilesModule.php


示例15: deletePoll

 function deletePoll($iId)
 {
     $aPoll = $this->_oDb->getPollInfo($iId);
     if (empty($aPoll) || !is_array($aPoll)) {
         return false;
     }
     $aPoll = array_shift($aPoll);
     if (!isLogged() || !isAdmin() && $aPoll['id_profile'] != getLoggedId()) {
         return false;
     }
     $this->_oDb->deletePoll($iId);
     $oTag = new BxDolTags();
     $oTag->reparseObjTags('bx_poll', $iId);
     $oCateg = new BxDolCategories();
     $oCateg->reparseObjTags('bx_poll', $iId);
     // create system event
     $oZ = new BxDolAlerts('bx_poll', 'delete_poll', $iId);
     $oZ->alert();
     return true;
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:20,代码来源:BxPollModule.php


示例16: getEditForm

 function getEditForm($aValues, $aAddFields = array())
 {
     $oCategories = new BxDolCategories();
     if (isset($this->_aForm['inputs']['categories'])) {
         //--- convert post form to edit one ---//
         $this->_aForm['inputs']['categories'] = $oCategories->getGroupChooser($this->_oModule->_oConfig->getCategoriesSystemName(), $this->_iOwnerId, true, $aValues['categories']);
     }
     if (!empty($aValues) && is_array($aValues)) {
         foreach ($aValues as $sKey => $sValue) {
             if (array_key_exists($sKey, $this->_aForm['inputs'])) {
                 if ($this->_aForm['inputs'][$sKey]['type'] == 'checkbox') {
                     $this->_aForm['inputs'][$sKey]['checked'] = (int) $sValue == 1 ? true : false;
                 } else {
                     if ($this->_aForm['inputs'][$sKey]['type'] == 'select_box' && $this->_aForm['inputs'][$sKey]['name'] == 'Categories') {
                         $aCategories = preg_split('/[' . $oCategories->sTagsDivider . ']/', $sValue, 0, PREG_SPLIT_NO_EMPTY);
                         $this->_aForm['inputs'][$sKey]['value'] = $aCategories;
                     } else {
                         $this->_aForm['inputs'][$sKey]['value'] = $sValue;
                     }
                 }
             }
         }
         unset($this->_aForm['inputs']['author_id']);
         $this->_aForm['inputs']['id'] = array('type' => 'hidden', 'name' => 'id', 'value' => $aValues['id'], 'db' => array('pass' => 'Int'));
         $this->_aForm['inputs']['post']['value'] = _t("_td_edit");
     }
     $oForm = new BxTemplFormView($this->_aForm);
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         $iDateNow = mktime();
         $iDatePublish = $oForm->getCleanValue('when');
         if ($iDatePublish > $iDateNow) {
             $iStatus = BX_TD_STATUS_PENDING;
         } else {
             if ($iDatePublish <= $iDateNow && $this->_oModule->_oConfig->isAutoapprove()) {
                 $iStatus = BX_TD_STATUS_ACTIVE;
             } else {
                 $iStatus = BX_TD_STATUS_INACTIVE;
             }
         }
         $aDefFields = array('date' => $iDateNow, 'status' => $iStatus);
         $oForm->update($aValues['id'], array_merge($aDefFields, $aAddFields));
         //--- 'System' -> Edit for Alerts Engine ---//
         bx_import('BxDolAlerts');
         $oAlert = new BxDolAlerts($this->_oModule->_oConfig->getAlertsSystemName(), 'edit', $aValues['id'], $this->_iOwnerId);
         $oAlert->alert();
         //--- 'System' -> Edit for Alerts Engine ---//
         //--- Reparse Global Tags ---//
         $oTags = new BxDolTags();
         $oTags->reparseObjTags($this->_oModule->_oConfig->getTagsSystemName(), $aValues['id']);
         //--- Reparse Global Tags ---//
         //--- Reparse Global Categories ---//
         $oCategories->reparseObjTags($this->_oModule->_oConfig->getCategoriesSystemName(), $aValues['id']);
         //--- Reparse Global Categories ---//
         header('Location: ' . $oForm->aFormAttrs['action']);
     } else {
         return $oForm->getCode();
     }
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:59,代码来源:BxDolTextData.php


示例17: ActionDeleteAdvertisement

 /**
  * Deleting Advertisement from `bx_ads_main`
  *
  * @param $iID	ID of deleting Advertisement
  * @return Text presentation of result
  */
 function ActionDeleteAdvertisement($iID)
 {
     $iDeleteAdvertisementID = (int) $iID;
     $iAdvOwner = $this->_oDb->getOwnerOfAd($iDeleteAdvertisementID);
     if (!$this->isAllowedDelete($iAdvOwner)) {
         return $this->_oTemplate->displayAccessDenied();
     }
     if ($iDeleteAdvertisementID > 0) {
         $sSuccDel = _t("_bx_ads_Ad_succ_deleted");
         $sFailDel = _t("_bx_ads_Ad_fail_delete");
         $sRetHtml = '';
         $sMediaIDs = $this->_oDb->getMediaOfAd($iDeleteAdvertisementID);
         if ($sMediaIDs != '') {
             $aChunks = explode(',', $sMediaIDs);
             foreach ($aChunks as $sMedId) {
                 $iMedId = (int) $sMedId;
                 if ($iMedId) {
                     $sMediaFileName = $this->_oDb->getMediaFile($iMedId);
                     if ($sMediaFileName != '') {
                         @unlin 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BxDolTemplate类代码示例发布时间:2022-05-23
下一篇:
PHP BxDolSubscription类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap