/** * Get the link to comments. * * @param integer $iId * @param string $sTable * @return void */ public static function link($iId, $sTable) { $oCommentModel = new CommentCoreModel(); $iCommentNumber = $oCommentModel->total($iId, $sTable); unset($oCommentModel); echo '<p><a href="', Uri::get('comment', 'comment', 'add', "{$sTable},{$iId}"), '">', t('Add a comment'), '</a>'; if ($iCommentNumber > 0) { $sCommentTxt = nt('Read Comment', 'Read the Comments', $iCommentNumber); echo ' - ', t('OR'), ' - <a href="', Uri::get('comment', 'comment', 'read', $sTable . ',' . $iId), '">', $sCommentTxt, ' (', $iCommentNumber, ')</a> <a href="', Uri::get('xml', 'rss', 'xmlrouter', 'comment-' . $sTable . ',' . $iId), '"><img src="', PH7_URL_STATIC, PH7_IMG, 'icon/small-feed.png" alt="', t('RSS Feed'), '" /></a>'; } echo '</p>'; }
public function delete() { $iId = $this->httpRequest->post('id'); CommentCoreModel::deleteRecipient($iId, 'Blog'); $this->oBlogModel->deleteCategory($iId); $this->oBlogModel->deletePost($iId); (new Blog())->deleteThumb($iId, 'blog', $this->file); /* Clean BlogModel Cache */ (new Framework\Cache\Cache())->start(BlogModel::CACHE_GROUP, null, null)->clear(); HeaderUrl::redirect(Uri::get('blog', 'main', 'index'), t('Your post was deleted!')); }
public function delete() { $iId = $this->httpRequest->post('id'); $iProfileId = $this->session->get('member_id'); CommentCoreModel::deleteRecipient($iId, 'Note'); $this->oNoteModel->deleteCategory($iId); $this->_deleteThumbFile($iId, $iProfileId); $this->oNoteModel->deletePost($iId, $iProfileId); /* Clean NoteModel Cache */ (new Framework\Cache\Cache())->start(NoteModel::CACHE_GROUP, null, null)->clear(); Header::redirect(Uri::get('note', 'main', 'index'), t('Your post was deleted!')); }
public function deleteVideo() { $iVideoId = $this->httpRequest->post('video_id', 'int'); CommentCoreModel::deleteRecipient($iVideoId, 'Video'); $bVideo = $this->oVideoModel->deleteVideo($this->session->get('member_id'), $this->httpRequest->post('album_id', 'int'), $iVideoId); (new Video())->deleteVideo($this->httpRequest->post('album_id'), $this->session->get('member_username'), $this->httpRequest->post('video_link')); /* Clean VideoModel Cache */ (new Framework\Cache\Cache())->start(VideoModel::CACHE_GROUP, null, null)->clear(); Header::redirect(Uri::get('video', 'main', 'album', $this->session->get('member_username') . ',' . $this->httpRequest->post('album_title') . ',' . $this->httpRequest->post('album_id')), t('Your video has been deleted!')); }
public function deletePhoto() { $iPictureId = $this->httpRequest->post('picture_id', 'int'); CommentCoreModel::deleteRecipient($iPictureId, 'Picture'); $this->oPictureModel->deletePhoto($this->session->get('member_id'), $this->httpRequest->post('album_id', 'int'), $iPictureId); (new Picture())->deletePhoto($this->httpRequest->post('album_id'), $this->session->get('member_username'), $this->httpRequest->post('picture_link')); /* Clean PictureModel Cache */ (new Framework\Cache\Cache())->start(PictureModel::CACHE_GROUP, null, null)->clear(); Framework\Url\Header::redirect(Framework\Mvc\Router\Uri::get('picture', 'main', 'album', $this->session->get('member_username') . ',' . $this->httpRequest->post('album_title') . ',' . $this->httpRequest->post('album_id')), t('Your picture has been deleted!')); }