コード例 #1
0
ファイル: actions.class.php プロジェクト: auphau/joyreactor
 public function executeMainPageTrigger(sfWebRequest $request)
 {
     sfApplicationConfiguration::getActive()->loadHelpers(array('Partial'));
     $this->filename = 'error';
     $post = Doctrine::getTable('Post')->find(array($this->getRequestParameter('post_id')));
     $admin = sfGuardUser::getAdminUser();
     if ($admin && $admin->getProfile()->getUsecrossposting() && urldecode($this->getRequestParameter('login')) == $admin->getProfile()->getLjlogin() && urldecode($this->getRequestParameter('pass')) == $admin->getProfile()->getLjpassword() && $post != null) {
         if (!$post->getLj() && $post->getRating() >= sfConfig::get('app_post_mainpage_threshold')) {
             func::crossposting($admin->getProfile()->getLjlogin(), $admin->getProfile()->getLjpassword(), get_partial('post/post_lj', array('post' => $post, 'showUsername' => 1)), $post->getMoodNameI18N(), $post->getMoodSmile());
             $post->setLj(1);
             $post->save();
             $this->filename = 'ok';
         }
     }
     return $this->renderPartial('upload', array('filename' => $this->filename));
 }
コード例 #2
0
ファイル: Post.class.php プロジェクト: auphau/joyreactor
 public function postInsert($event)
 {
     sfApplicationConfiguration::getActive()->loadHelpers('Partial');
     try {
         if ($this->getUser()->getProfile()->getUsecrossposting()) {
             func::crossposting($this->getUser()->getProfile()->getLjlogin(), $this->getUser()->getProfile()->getLjpassword(), get_partial('post/post_lj', array('post' => $this)), $this->getMoodNameI18N(), $this->getMoodSmile());
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }