oBlogs = &$oBlogs; parent::BxDolPageView('bx_blogs'); } function getBlockCode_PostActions() { return $this->oBlogs->getActionsBlock(); } function getBlockCode_PostRate() { return $this->oBlogs->getRateBlock(); } function getBlockCode_PostOverview() { return $this->oBlogs->getPostOverviewBlock(); } function getBlockCode_PostCategories() { return $this->oBlogs->getPostCategoriesBlock(); } function getBlockCode_PostFeature() { return $this->oBlogs->getPostFeatureBlock(); } function getBlockCode_PostTags() { return $this->oBlogs->getPostTagsBlock(); } function getBlockCode_PostComments() { return $this->oBlogs->getCommentsBlock(); } function getBlockCode_PostView() { return $this->oBlogs->getBlogPostBlock(); } } class BxDolBlogsHomePageView extends BxDolPageView { var $oBlogs; function BxDolBlogsHomePageView(&$oBlogs) { parent::BxDolPageView('bx_blogs_home'); $this->oBlogs = &$oBlogs; } function getBlockCode_Top() { return $this->oBlogs->GenBlogLists('top', false); } function getBlockCode_Latest() { return $this->oBlogs->GenPostLists('last', false); } } /** * Blogs module by BoonEx * * This module allow user to keep blog. * * Example of using this module to get any member blog page: * * bx_import('BxDolModuleDb'); * require_once( BX_DIRECTORY_PATH_MODULES . 'boonex/blogs/classes/BxBlogsModule.php'); * $oModuleDb = new BxDolModuleDb(); * $aModule = $oModuleDb->getModuleByUri('blogs'); * $oBlogs = new BxBlogsModule($aModule); * echo $oBlogs->GenMemberBlog($iMemberID); * * * * Profile's Wall: * no events * * * * Spy: * 'create' event are displayed on profile's wall * * * * Memberships/ACL: * View blog - BX_BLOG_VIEW * View posts - BX_BLOG_POST_VIEW * Browse blogs - BX_BLOGS_BROWSE * Browse posts - BX_BLOGS_POSTS_BROWSE * Use search and view search results - BX_BLOG_POST_SEARCH * Add posts - BX_BLOG_POST_ADD * Edit any post (as admin) - BX_BLOG_POSTS_EDIT_ANY_POST * Delete any post (as admin) - BX_BLOG_POSTS_DELETE_ANY_POST * Approve any post (as admin) - BX_BLOG_POSTS_APPROVING * * * * Service methods: * * Delete blog (carefully with it) * @see BxBlogsModule::serviceActionDeleteBlog * BxDolService::call('bx_blogs', 'action_delete_blog', array()); * * Blogs block for index page (as PHP function) * @see BxBlogsModule::serviceBlogsIndexPage * BxDolService::call('bx_blogs', 'blogs_index_page', array()); * * Blogs block for profile page (as PHP function) * @see BxBlogsModule::serviceBlogsProfilePage * BxDolService::call('bx_blogs', 'blogs_profile_page', array($_iProfileID)); * * Generation of member RSS feeds * @see BxBlogsModule::serviceBlogsRss * BxDolService::call('bx_blogs', 'blogs_rss', array()); * * Get common css * @see BxBlogsModule::serviceGetCommonCss * BxDolService::call('bx_blogs', 'get_common_css', array()); * * Get member menu item * @see BxBlogsModule::serviceGetMemberMenuItem * BxDolService::call('bx_blogs', 'get_member_menu_item', array()); * * Get Spy data * @see BxBlogsModule::serviceGetSpyData * BxDolService::call('bx_blogs', 'get_spy_data', array()); * * Get Spy blog post * @see BxBlogsModule::serviceGetSpyPost * BxDolService::call('bx_blogs', 'get_spy_post', array($sAction, $iObjectId, $iSenderId)); * * * * Alerts: * Alerts type/unit - 'bx_blogs' * The following alerts are rised * * view_post - view post * $this->iViewingPostID - viewing post id * $this->_iVisitorID - visitor id * * create - creating of new post * $iPostID - post id (for new post - 0) * $iPostOwnerID - post owner id * * edit_post - editing of existed post * $iPostID - post id * $iPostOwnerID - post owner id * * delete_post - deleting of existed post * $iPostID - post id * $iPostOwnerID - post owner id * */ class BxBlogsModule extends BxDolModule { //variables //max sizes of pictures for resizing during upload var $iIconSize; var $iThumbSize; var $iBigThumbSize; var $iImgSize; //admin mode, can All actions var $bAdminMode; //path to spacer image var $sSpacerPath; var $iLastPostedPostID; var $iPostViewType; var $iViewingPostID; var $aViewingPostInfo; var $sHomeUrl; var $sHomePath; var $oPrivacy; var $_iVisitorID; var $_sPageHeader; // Constructor function BxBlogsModule($aModule) { parent::BxDolModule($aModule); $this->iIconSize = (int)getParam('bx_blogs_iconsize'); $this->iThumbSize = (int)getParam('bx_blogs_thumbsize'); $this->iBigThumbSize = (int)getParam('bx_blogs_bigthumbsize'); $this->iImgSize = (int)getParam('bx_blogs_imagesize'); $this->sHomeUrl = $this->_oConfig->getHomeUrl(); $this->sHomePath = $this->_oConfig->getHomePath(); $this->_iVisitorID = (isMember()) ? (int)$_COOKIE['memberID'] : 0; //temple $this->bAdminMode = ($this->isAdmin()==true) ? true: $this->bAdminMode; $this->iPostViewType = 1; $this->iViewingPostID = -1; $this->iLastPostedPostID = -1; $this->aViewingPostInfo = array(); $this->sSpacerPath = getTemplateIcon('spacer.gif'); $this->_sPageHeader = ''; $this->oPrivacy = new BxBlogsPrivacy($this); } function CheckLogged() { $iProfileId = (isset($_COOKIE['memberID']) && ($GLOBALS['logged']['member'] || $GLOBALS['logged']['admin'])) ? (int)$_COOKIE['memberID'] : 0; if (! $iProfileId) { member_auth(0); } } /** * Return string for Header, depends at POST params * * @return Textpresentation of data */ function GetHeaderString() { switch ( bx_get('action') ) { case 'home': $sCaption = _t('_bx_blog_Blogs_Home'); break; case 'all': $sCaption = _t('_bx_blog_All_Blogs'); break; case 'tags': $sCaption = _t('_Tags'); break; case 'all_posts': $sCaption = _t('_bx_blog_All_Posts'); break; case 'top_posts': $sCaption = _t('_bx_blog_Top_Posts'); break; case 'popular_posts': $sCaption = _t('_bx_blog_Popular_Posts'); break; case 'featured_posts': $sCaption = _t('_bx_blog_Featured_Posts'); break; /*case 'show_categories': $sCaption = _t('_bx_blog_Categories'); break;*/ case 'show_calendar': $sCaption = _t('_bx_blog_Calendar'); break; case 'show_calendar_day' : $sDate = bx_get('date'); $aDate = explode('/', $sDate); $iValue1 = (int)$aDate[0]; $iValue2 = (int)$aDate[1]; $iValue3 = (int)$aDate[2]; $sCaption = _t('_bx_blog_caption_browse_by_day') . getLocaleDate( strtotime("{$iValue1}-{$iValue2}-{$iValue3}") , BX_DOL_LOCALE_DATE_SHORT); break; case 'add_category': $sCaption = _t('_Add Category'); break; case 'new_post': $sCaption = _t('_Add Post'); break; case 'show_member_blog': $sCaption = _t('_bx_blog_My_blog'); $iMemberID = $this->defineUserId(); $sUser = ($iMemberID>0) ? getNickName($iMemberID) : _t('_Admin'); $sAsBlog = _t('_bx_blog_Members_blog', $sUser); //$GLOBALS['oTopMenu']->setCustomSubHeader($sAsBlog); $sCaption = $sAsBlog; break; case 'edit_post': $sCaption = _t('_Post'); if (false !== bx_get('EditPostID')) { $iPostID = (int)bx_get('EditPostID'); $sCaption = htmlspecialchars($this->_oDb->getPostCaptionByID($iPostID)); } break; case 'show_member_post': $sCaption = _t('_Post'); if (false !== bx_get('postUri')) { $sPostUri = process_db_input(bx_get('postUri'), BX_TAGS_STRIP); $sPostCapt = $this->_oDb->getPostCaptionByUri($sPostUri); } elseif (false !== bx_get('post_id')) { $iPostID = (int)bx_get('post_id'); $sPostCapt = $this->_oDb->getPostCaptionByID($iPostID); } if ($sPostCapt != '') { $sCaption = htmlspecialchars($sPostCapt); } break; case 'search_by_tag': $sCaption = _t('_Search result'); break; case 'my_page': switch (bx_get('mode')) { case 'add': $sCaption = _t('_bx_blog_Add') . ' ' . _t('_Post'); break; case 'manage': $sCaption = _t('_bx_blog_Manage'); break; case 'pending': $sCaption = _t('_bx_blog_pending_approval'); break; default: $sCaption = _t('_bx_blog_My_blog'); break; } break; default: $sCaption = _t('_bx_blog_Blogs'); break; } $this->_sPageHeader = $sCaption; return $sCaption; } /** * Generate common forms and includes js * * @return void */ function GenCommandForms() { $this -> _oTemplate -> addJs('main.js'); } // ================================== permissions function isAllowedComments (&$aBlogPost) { if (($aBlogPost['OwnerID'] == $this->_iVisitorID && isMember()) || $this->isAdmin ()) return true; return $this->oPrivacy->check('comment', $aBlogPost['PostID'], $this->_iVisitorID); } function isAllowedCreatorCommentsDeleteAndEdit (&$aBlogPost, $isPerformAction = false) { if ($this->isAdmin()) return true; if (! isMember() || $aBlogPost['OwnerID'] != $this->_iVisitorID) return false; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POSTS_COMMENTS_DELETE_AND_EDIT, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedBlogView($iOwnerID, $isPerformAction = false) { if ($this->isAdmin() || $iOwnerID == $this->_iVisitorID) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_VIEW, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedBlogPostView($iOwnerID, $isPerformAction = false) { if ($this->isAdmin() || $iOwnerID == $this->_iVisitorID) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POST_VIEW, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedBlogsBrowse($isPerformAction = false) { if ($this->isAdmin()) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOGS_BROWSE, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedBlogsPostsBrowse($isPerformAction = false) { if ($this->isAdmin()) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOGS_POSTS_BROWSE, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedBlogPostSearch($isPerformAction = false) { if ($this->isAdmin()) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POST_SEARCH, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedPostAdd($isPerformAction = false) { if ($this->isAdmin()) return true; if (isMember() == false) return false; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POST_ADD, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedPostEdit($iOwnerID, $isPerformAction = false) { if ($this->isAdmin() || (isMember() && $iOwnerID == $this->_iVisitorID)) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POSTS_EDIT_ANY_POST, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedPostDelete($iOwnerID, $isPerformAction = false) { if ($this->isAdmin() || (isMember() && $iOwnerID == $this->_iVisitorID)) return true; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POSTS_DELETE_ANY_POST, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAllowedApprove($isPerformAction = false) { if ($this->isAdmin()) return true; if (isMember() == false) return false; $this->_defineActions(); $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POSTS_APPROVING, $isPerformAction); return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED; } function isAdmin() { return isAdmin($this->_iVisitorID) || isModerator($this->_iVisitorID); } function _defineActions () { defineMembershipActions(array ('blog view', 'blog post view', 'blogs browse', 'blogs posts browse', 'blog post search', 'blog post add', 'blog posts edit any post', 'blog posts delete any post', 'blog posts approving', 'blog posts comments delete and edit')); } function GenBlogAdminIndex() { if ($this->bAdminMode) { //actions if (bx_get('action_approve') && is_array(bx_get('bposts'))) { foreach (bx_get('bposts') as $iBPostID) { if ($this->_oDb->setPostStatus((int)$iBPostID, 'approval')) { } } } elseif (bx_get('action_disapprove') && is_array(bx_get('bposts'))) { foreach (bx_get('bposts') as $iBPostID) { if ($this->_oDb->setPostStatus((int)$iBPostID)) { } } } elseif (bx_get('action_delete') && is_array(bx_get('bposts'))) { foreach (bx_get('bposts') as $iBPostID) { $this->ActionDeletePost((int)$iBPostID); //$this->onPostDeleted ($iBPostID); } } $sPostLink = $this->sHomeUrl . $this->_oConfig->sAdminExFile; require_once( $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'); $oBlogSearch = new BxBlogsSearchUnit(); $oBlogSearch->PerformObligatoryInit($this, 4); $oBlogSearch->aCurrent['restriction']['activeStatus'] = ''; $oBlogSearch->bShowCheckboxes = true; $oBlogSearch->aCurrent['paginate']['perPage'] = 10; $sPosts = $oBlogSearch->displayResultBlock(); $sPosts = ($oBlogSearch->aCurrent['paginate']['totalNum'] == 0) ? MsgBox(_t('_bx_blog_No_blogs_available')) : $sPosts; $sAdmPanel = $oBlogSearch->showAdminActionsPanel('bposts_box', array('action_approve' => '_Approve', 'action_disapprove' => '_Disapprove', 'action_delete' => '_Delete'), 'bposts'); // Prepare link to pagination $sRequest = $sPostLink . '?page={page}&per_page={per_page}'; // End of prepare link to pagination $oBlogSearch->aCurrent['paginate']['page_url'] = $sRequest; $sPostPagination = $oBlogSearch->showPagination3(); $sPostsBox = $sPosts . '
' . $sPostPagination; //$sOwnerBlogLink = $this->genBlogLink('show_member_blog_home', array('Permalink'=>$sAdminC, 'Link'=>0)); $aVariables = array ( 'admin_page' => $sPostLink, 'units' => $sPostsBox, 'admin_panel' => $sAdmPanel, ); return $this->_oTemplate->parseHtmlByTemplateName('admin_page', $aVariables); } } function GenBlogHome() { $oHomePageView = new BxDolBlogsHomePageView($this); return $oHomePageView->getCode(); } /** * Generate List of Blogs * * @param $sType - tyle of list ('top', 'last') * @return HTML presentation of data */ function GenBlogLists($sType = '', $bBlock = true) { if (!$this->isAllowedBlogsBrowse()) { return $this->_oTemplate->displayAccessDenied(); } // lang keys $sPostsC = _t('_bx_blog_Posts'); $sNoBlogsC = _t('_Empty'); $sAllBlogsC = _t('_bx_blog_All_Blogs'); $sTopBlogsC = _t('_bx_blog_Top_Blogs'); $iCheckedMemberID = $this->_iVisitorID; //////////////////pagination addition////////////////////////// //number elements for per page $iPerPage = ( false !== bx_get('per_page') ) ? (int) bx_get('per_page') : 10; if ( $iPerPage > 100 ) $iPerPage = 100; $iCurPage = ( false !== bx_get('page') ) ? (int)bx_get('page') : 1; $sLimitFrom = ( $iCurPage - 1 ) * $iPerPage; $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; //////////////////////////// $sCaption = $sAllBlogsC; $sStatusFilter = ($this->isAdmin() == true || $this -> isAllowedApprove() || $this -> isAllowedPostEdit(-1) || $this -> isAllowedPostDelete(-1)) ? '1' : "`PostStatus`='approval'"; switch ($sType) { case 'top': $vBlogsRes = $this->_oDb->getTopBlogs($sStatusFilter, $sqlLimit); $sCaption = $sTopBlogsC; break; case 'last': default: $vBlogsRes = $this->_oDb->getLastBlogs($sStatusFilter, $sqlLimit); break; } $iTotalBlogs = $this->_oDb->getAllBlogsCnt($sStatusFilter); // process database queries $iTotalNum = mysql_num_rows($vBlogsRes); if ($iTotalNum == 0) { $sCode = MsgBox($sNoBlogsC); return $bBlock ? DesignBoxContent($sCaption, $sCode, 1) : $sCode; } $iGenPostsCnt = 0; while ( $aBlogsRes = mysql_fetch_assoc($vBlogsRes) ) { if ($aBlogsRes['PostCount'] == 0 && $sType == 'top') //in Top blogs skip posts with 0 comments continue; $sOwnerNickname = getNickName($aBlogsRes['OwnerID']); if ($aBlogsRes['OwnerID']==0) $sOwnerNickname = _t('_Admin'); if ($sOwnerNickname) { $sCont = get_member_thumbnail($aBlogsRes['OwnerID'], 'left' ); $sBlogOwnerLink = $this->genBlogLink('show_member_blog', array('Permalink'=>$sOwnerNickname, 'Link'=>$aBlogsRes['OwnerID'])); $sDescription = htmlspecialchars(strip_tags($aBlogsRes['Description'])); $aBlogUnitVariables = array ( 'owner_thumbnail' => $sCont, 'owner_nickname' => $sOwnerNickname . ' ' . _t('_bx_blog_Blog'), 'posts_count' => $aBlogsRes['PostCount'] . ' ' . $sPostsC, 'blog_link' => $sBlogOwnerLink, 'blog_description' => $sDescription ); $sRetHtml .= $this->_oTemplate->parseHtmlByTemplateName('blog_unit', $aBlogUnitVariables); $iGenPostsCnt++; } } /////////pagination addition////////////////// if ($this->isPermalinkEnabled()==false) { $sRequest = bx_html_attribute($_SERVER['PHP_SELF']) . '?action=top_blogs&page={page}&per_page={per_page}'; } else { $sRequest = (bx_get('action') == 'top_blogs') ? BX_DOL_URL_ROOT . 'blogs/top/' : BX_DOL_URL_ROOT . 'blogs/all/'; $sRequest .= '{per_page}/{page}' . $sPaginAddon; } /////////////////////////// $oPaginate = new BxDolPaginate ( array ( 'page_url' => $sRequest, 'count' => $iTotalBlogs, 'per_page' => $iPerPage, 'page' => $iCurPage, 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null, ) ); $sPagination = $oPaginate->getPaginate(); $sRetHtmlVal = << {$sRetHtml} {$sPagination} EOF; return $bBlock ? DesignBoxContent($sCaption, $sRetHtmlVal, 1) : $sRetHtmlVal; } /** * Generate List of Posts * * @param $sType - tyle of list ('top', 'last'), but now realized only Top posts * @return HTML presentation of data */ function GenPostLists($sType = '', $bBlock = true) { $sDisplayMode = ''; $sTypeMode = ''; switch ($sType) { case 'last': $sDisplayMode = 'last'; break; case 'popular': $sDisplayMode = 'popular'; break; case 'featured': $sTypeMode = 'featured'; $sDisplayMode = 'last'; break; case 'top': default: $sDisplayMode = 'top'; break; } $this->iPostViewType = 4; $sCaption = ($this->_sPageHeader != '') ? $this->_sPageHeader : _t('_bx_blog_Top_Posts'); if (!$this->isAllowedBlogsPostsBrowse()) { return DesignBoxContent($sCaption, $this->_oTemplate->displayAccessDenied(), 1); } require_once ($this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'); $oTmpBlogSearch = new BxBlogsSearchUnit($this); $oTmpBlogSearch->PerformObligatoryInit($this, $this->iPostViewType); $oTmpBlogSearch->aCurrent['paginate']['perPage'] = (int)getParam('blog_step'); $oTmpBlogSearch->aCurrent['sorting'] = $sDisplayMode; if ($sTypeMode!='' && $sTypeMode=='featured') { $oTmpBlogSearch->aCurrent['restriction']['featuredStatus']['value'] = 1; } //privacy changes if ($sType == 'last') { if ($this->_iVisitorID) { $oTmpBlogSearch->aCurrent['restriction']['allow_view']['value'] = array(BX_DOL_PG_ALL, BX_DOL_PG_MEMBERS); } else { $oTmpBlogSearch->aCurrent['restriction']['allow_view']['value'] = array(BX_DOL_PG_ALL); } } $sCode = $oTmpBlogSearch->displayResultBlock(); $sCode = ($oTmpBlogSearch->aCurrent['paginate']['totalNum'] == 0) ? MsgBox(_t('_Empty')) : $sCode; // Prepare link to pagination if ($this->bUseFriendlyLinks==false || $this->bAdminMode==true) { //old variant $sRequest = bx_html_attribute($_SERVER['PHP_SELF']) . '?action=top_posts&page={page}&per_page={per_page}'; } else { $sRequest = BX_DOL_URL_ROOT . 'blogs/top_posts/{per_page}/{page}'; } // End of prepare link to pagination $oTmpBlogSearch->aCurrent['paginate']['page_url'] = $sRequest; $sPagination = $oTmpBlogSearch->showPagination3(); $sRetHtmlVal = << {$sCode} {$sPagination} EOF; return $bBlock ? DesignBoxContent($sCaption, $sRetHtmlVal, 1) : $sRetHtmlVal; } function GenPostsOfCategory() { $sCatUri = process_db_input(bx_get('uri'), BX_TAGS_STRIP); if ($sCatUri) { $this->iPostViewType = 4; $sDisplayMode = 'last'; $sCaption = $sCatUri; if (!$this->isAllowedBlogsPostsBrowse()) { return DesignBoxContent($sCaption, $this->_oTemplate->displayAccessDenied(), 1); } require_once ($this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'); $oTmpBlogSearch = new BxBlogsSearchUnit(); $oTmpBlogSearch->PerformObligatoryInit($this, $this->iPostViewType); $oTmpBlogSearch->aCurrent['restriction']['category_uri']['value'] = $sCatUri; $oTmpBlogSearch->aCurrent['paginate']['perPage'] = (int)getParam('blog_step'); $oTmpBlogSearch->aCurrent['sorting'] = $sDisplayMode; $sCode = $oTmpBlogSearch->displayResultBlock(); $sCode = ($oTmpBlogSearch->aCurrent['paginate']['totalNum'] == 0) ? MsgBox(_t('_Empty')) : $sCode; $sRetHtmlVal = << {$sCode} EOF; return DesignBoxContent($sCaption, $sRetHtmlVal, 1); } } /** * Generate User Right Part for Blogs * * @param $aBlogsRes - Blog Array Data * @param $iView - type of view(1 is short view, 2 is full view, 3 is post view(short)) * @return HTML presentation of data */ function GenMemberDescrAndCat($aBlogsRes, $sCategoryName = '') { $sSureC = _t('_Are you sure?'); $sApplyChangesC = _t('_Submit'); $iMemberID = (int)$aBlogsRes['OwnerID']; $sOwnerNickname = getNickName($iMemberID); $aBlogInfo = $this->_oDb->getBlogInfo($iMemberID); $this->aViewingPostInfo = $aBlogInfo; if ($this->iViewingPostID == -1) { //$sOwnerBlogLink = $this->genBlogLink('show_member_blog_home', array('Permalink'=>$sOwnerNickname, 'Link'=>$iMemberID)); $aBlogID = (int)$aBlogInfo['ID']; $sWorkLink = $this->genBlogFormUrl(); $sProcessingFile = $this->genBlogSubUrl(); $aBlogActionKeys = array( 'visitor_id' => $this->_iVisitorID, 'owner_id' => $iMemberID, 'owner_name' => $sOwnerNickname, 'blog_owner_link' => '',//$sOwnerBlogLink, 'admin_mode' => "'" . $this->bAdminMode . "'", 'sure_label' => $sSureC, 'work_url' => $sProcessingFile, 'site_url' => BX_DOL_URL_ROOT, 'blog_id' => $aBlogID, 'blog_description_js' => $sDescrAct, ); $sBlogActionsVal = $GLOBALS['oFunctions']->genObjectsActions($aBlogActionKeys, 'bx_blogs_m', false); if (($this->_iVisitorID==$iMemberID && $iMemberID>0) || $this->bAdminMode==true) { $aBlogDesc = $aBlogInfo['Description']; $sDescrAct = $this->ActionPrepareForEdit($aBlogDesc); $sBlogDescription = process_html_output($aBlogDesc); $sBlogActionsVal .= <<