/** * @return WpPosts|null The WpPosts object, that is a copy of this DLE post. */ public function LoadWpPosts() { $objWpUsers = $this->LoadWpUser(); if (!$objWpUsers) { return null; } return WpPosts::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::WpPosts()->PostAuthor, $objWpUsers->Id), QQ::Equal(QQN::WpPosts()->PostDate, $this->Date), QQ::Equal(QQN::WpPosts()->PostName, $this->AltName)), QQ::Clause(QQ::LimitInfo(1))); }
/** * @param DleStatic $objDleStatic The DB ORM object to process */ protected function process_object($objDleStatic) { $objWpPosts0 = $objDleStatic->LoadWpPost(); if ($objWpPosts0) { return; } $objWpUsers = WpUsers::LoadFirst(); if (!$objWpUsers) { return; } $objWpPosts = new WpPosts(); $objWpPosts->Initialize(); // set defaults $objWpPosts->PostAuthor = $objWpUsers->Id; $objWpPosts->PostDate = $objDleStatic->Date; $objWpPosts->PostModified = $objDleStatic->Date; $objWpPosts->PostDateGmt = $objDleStatic->Date; $objWpPosts->PostModifiedGmt = $objDleStatic->Date; $objWpPosts->PostContent = str_replace('{ACCEPT-DECLINE}', '', str_replace('\\»', '»', str_replace('\\"', '"', $objDleStatic->Template))); $objWpPosts->PostContentFiltered = ""; $objWpPosts->PostParent = 0; $objWpPosts->PostTitle = $objDleStatic->Descr; $objWpPosts->PostExcerpt = str_replace('\\»', '»', str_replace('\\"', '"', $objDleStatic->Metadescr)); $objWpPosts->CommentStatus = "open"; $objWpPosts->PingStatus = "open"; $objWpPosts->PostStatus = "publish"; $objWpPosts->PostPassword = ""; $objWpPosts->PostName = $objDleStatic->Name; $objWpPosts->ToPing = ""; $objWpPosts->Pinged = ""; $objWpPosts->Guid = ""; $objWpPosts->MenuOrder = 0; $objWpPosts->PostType = "page"; $objWpPosts->PostMimeType = ""; $objWpPosts->CommentCount = 0; $objWpPosts->Save(); $this->intPostCount++; }
/** * @param DlePost $objDlePost The DB ORM object to process */ protected function process_object($objDlePost) { $objWpPosts = $objDlePost->LoadWpPosts(); // check if already copied if (!$objWpPosts) { $objWpUsers = $objDlePost->LoadWpUser(); if ($objWpUsers) { $objWpPosts = new WpPosts(); $objWpPosts->Initialize(); // set defaults $objWpPosts->PostAuthor = $objWpUsers->Id; $objWpPosts->PostDate = $objDlePost->Date; $objWpPosts->PostModified = $objDlePost->Date; $objWpPosts->PostDateGmt = $objDlePost->Date; $objWpPosts->PostModifiedGmt = $objDlePost->Date; $objWpPosts->PostContent = str_replace('\\»', '»', str_replace('\\"', '"', $objDlePost->FullStory)); $objWpPosts->PostContentFiltered = ""; $objWpPosts->PostParent = 0; $objWpPosts->PostTitle = $objDlePost->Title; $objWpPosts->PostExcerpt = str_replace('\\»', '»', str_replace('\\"', '"', $objDlePost->ShortStory)); $objWpPosts->CommentStatus = "open"; $objWpPosts->PingStatus = "open"; $objWpPosts->PostStatus = "publish"; $objWpPosts->PostPassword = ""; $objWpPosts->PostName = $objDlePost->AltName; $objWpPosts->ToPing = ""; $objWpPosts->Pinged = ""; $objWpPosts->Guid = ""; $objWpPosts->MenuOrder = 0; $objWpPosts->PostType = "post"; $objWpPosts->PostMimeType = ""; $objWpPosts->CommentCount = 0; $objWpPosts->Save(); $this->intPostCount++; } } }
public function getFile($params) { $id = $params['id']; $this->resetStatus(); $wp_posts = WpPosts::where('ID', $id)->as_array()->get(1); $wp_posts['thumbnail'] = WpPosts::thumbnail($id); $content = $wp_posts["post_content"]; $this->status['success'] = 'ok'; $this->status['title'] = utf8_encode($wp_posts['post_title']); $this->status['content'] = ' <div class="row"> <div class="col-xs-6"> <img src="' . $wp_posts['thumbnail'] . "\" style=\"width:100%\" />\n </div>\n <div class=\"col-xs-6\"> " . utf8_encode($wp_posts["post_content"]) . '</div> </div>'; return $this->return_json($this->status); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objPost) { $objObject->objPost = WpPosts::GetSoapObjectFromObject($objObject->objPost, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPostId = null; } } return $objObject; }
public function files() { $scope = array('title' => 'Make Fit Real User Area', 'page-title' => Lang::get('page-title-files'), 'website' => $this->website, 'csrf' => $this->csrf, 'back' => Lang::get('back')); $navbar_stuff = $this->navbar_stuff(); $navbar_stuff = $this->navbar_stuff(); $scope['navbar-stuff'] = $navbar_stuff['stuff']; $scope['navbar-links'] = $navbar_stuff['links']; $scope['intro-title'] = Lang::get('intro-title-files'); $scope['intro-text'] = Lang::get('intro-text-files'); $scope['file-list'] = array(); //Get basic posts: $common_posts = array(27, 30); foreach ($common_posts as $common_post) { $wp_posts = WpPosts::where('ID', $common_post)->as_array()->get(1); $wp_thumbnail = WpPosts::thumbnail($common_post); $wp_posts['thumbnail'] = $wp_thumbnail; array_push($scope['file-list'], $wp_posts); } // Get User Posts //$coaching_files = (array)MfrUsers::user_files(); $coaching_files = MfrUsers::where('id', Session::get('id'))->files()->as_array()->get(); $number_of_files = sizeof($coaching_files); if ($number_of_files > 0) { foreach ($coaching_files as $coaching_file) { $wp_posts = WpPosts::where('ID', $coaching_file['mfr_user_files-file_id'])->as_array()->get(1); $wp_thumbnail = WpPosts::thumbnail($coaching_file['mfr_user_files-file_id']); $wp_posts['thumbnail'] = $wp_thumbnail; array_push($scope['file-list'], $wp_posts); } } View::render('coaching/user/files/index.php', $scope); }
/** * @return int The number of object in the DLE database to process. */ protected function get_process_objects_count() { return WpPosts::CountAll(); }
/** * Counts all associated WpPostsesAsPostAuthor * @return int */ public function CountWpPostsesAsPostAuthor() { if (is_null($this->intId)) { return 0; } return WpPosts::CountByPostAuthor($this->intId); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objCommentPostIDObject) { $objObject->objCommentPostIDObject = WpPosts::GetSoapObjectFromObject($objObject->objCommentPostIDObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intCommentPostID = null; } } if ($objObject->dttCommentDate) { $objObject->dttCommentDate = $objObject->dttCommentDate->qFormat(QDateTime::FormatSoap); } if ($objObject->dttCommentDateGmt) { $objObject->dttCommentDateGmt = $objObject->dttCommentDateGmt->qFormat(QDateTime::FormatSoap); } if ($objObject->objCommentParentObject) { $objObject->objCommentParentObject = WpComments::GetSoapObjectFromObject($objObject->objCommentParentObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intCommentParent = null; } } if ($objObject->objUser) { $objObject->objUser = WpUsers::GetSoapObjectFromObject($objObject->objUser, false); } else { if (!$blnBindRelatedObjects) { $objObject->intUserId = null; } } return $objObject; }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objPostAuthorObject) { $objObject->objPostAuthorObject = WpUsers::GetSoapObjectFromObject($objObject->objPostAuthorObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPostAuthor = null; } } if ($objObject->dttPostDate) { $objObject->dttPostDate = $objObject->dttPostDate->qFormat(QDateTime::FormatSoap); } if ($objObject->dttPostDateGmt) { $objObject->dttPostDateGmt = $objObject->dttPostDateGmt->qFormat(QDateTime::FormatSoap); } if ($objObject->dttPostModified) { $objObject->dttPostModified = $objObject->dttPostModified->qFormat(QDateTime::FormatSoap); } if ($objObject->dttPostModifiedGmt) { $objObject->dttPostModifiedGmt = $objObject->dttPostModifiedGmt->qFormat(QDateTime::FormatSoap); } if ($objObject->objPostParentObject) { $objObject->objPostParentObject = WpPosts::GetSoapObjectFromObject($objObject->objPostParentObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPostParent = null; } } return $objObject; }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objPost) { $objObject->objPost = WpPosts::GetSoapObjectFromObject($objObject->objPost, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPostId = null; } } if ($objObject->dttDateTime) { $objObject->dttDateTime = $objObject->dttDateTime->qFormat(QDateTime::FormatSoap); } if ($objObject->objUser) { $objObject->objUser = WpUsers::GetSoapObjectFromObject($objObject->objUser, false); } else { if (!$blnBindRelatedObjects) { $objObject->intUserId = null; } } return $objObject; }
public function LoadWpPost() { return WpPosts::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::WpPosts()->PostName, $this->Name), QQ::Equal(QQN::WpPosts()->PostType, "page")), QQ::Clause(QQ::LimitInfo(1))); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->dttTime) { $objObject->dttTime = $objObject->dttTime->qFormat(QDateTime::FormatSoap); } if ($objObject->objPostnumObject) { $objObject->objPostnumObject = WpPosts::GetSoapObjectFromObject($objObject->objPostnumObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->strPostnum = null; } } return $objObject; }