コード例 #1
0
ファイル: disqusapi.php プロジェクト: lukyanov84/disqus-php
 function test_setVersion()
 {
     $api = new DisqusAPI();
     $this->assertEquals($api->version, '3.0');
     $api->setVersion('3.1');
     $this->assertEquals($api->version, '3.1');
 }
コード例 #2
0
 public function getIndex()
 {
     if (Auth::guest() || Auth::user()->isAdmin == 0) {
         return Redirect::secure('/');
     }
     // layouts variables
     $this->layout->title = 'Админ панел | Нещо Шантаво';
     $this->layout->canonical = 'https://neshto.shantavo.com/admin/';
     $this->layout->robots = 'noindex,nofollow,noodp,noydir';
     $users = count(User::all());
     $admins = count(User::where('isAdmin', ">", 0)->get());
     $categories = count(Category::all());
     $albums = count(Album::all());
     $votes = count(DB::table('votes')->get());
     $pictures = count(Picture::all());
     $pictureSize = 0;
     foreach (Picture::all() as $p) {
         $pictureSize += $p->size;
     }
     // get disqus stats
     include app_path() . '/config/_disqus.php';
     $disqus = new DisqusAPI(getDisqusKey());
     $disqus->setSecure(false);
     $comments = $disqus->posts->list(array('forum' => 'shantavo'));
     // nesting the view into the layout
     $this->layout->nest('content', 'admin.index', array('users' => $users, 'admins' => $admins, 'votes' => $votes, 'categories' => $categories, 'albums' => $albums, 'pictures' => $pictures, 'pictureSize' => $pictureSize, 'comments' => $comments));
 }
コード例 #3
0
ファイル: disqus.php プロジェクト: kalail/php-disqus
 /**
  * @depends test_get_forum_posts
  */
 public function test_get_thread_posts()
 {
     $dsq = new DisqusAPI(USER_API_KEY, null, DISQUS_API_URL);
     $response = $dsq->get_forum_list();
     $this->assertTrue($response !== false);
     $forum_id = $response[0]->id;
     $response = $dsq->get_forum_posts($forum_id);
     $this->assertTrue($response !== false);
     $thread_id = $response[0]->thread->id;
     $response = $dsq->get_thread_posts($thread_id);
     $this->assertTrue($response !== false);
 }