Changeset 35524

Show
Ignore:
Timestamp:
10/09/09 00:16:00 (4 years ago)
Author:
kaz_29
Message:

Twitterコメントの表示機能を実装

Location:
websites/events.php.gr.jp/trunk/app
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • websites/events.php.gr.jp/trunk/app/controllers/events_controller.php

    r20685 r35524  
    1616    var $name = 'Event'; 
    1717    var $helpers = array('Rss', 'Datespan', 'Javascript'); 
    18     var $uses = array('Event', 'Trackback','User'); 
     18    var $uses = array('Event', 'Trackback','User', 'Twitter'); 
    1919 
    2020    /** 
     
    129129        $this->set('is_over', $this->Event->isOver($id)); 
    130130        $this->set('data', $re); 
     131         
     132        $this->set( 'twitter', $this->Twitter->read(array("%23phpstudy","%23phpstudy-{$id}")) ) ; 
     133        $this->set( 'twitter_hashtag', "#phpstudy,#phpstudy-{$id}" ) ; 
    131134    } 
    132135 
  • websites/events.php.gr.jp/trunk/app/views/event/show.ctp

    r28857 r35524  
    162162  </div> 
    163163<?php endif; ?> 
     164<div class="twitter"> 
     165<h3>Twitterコメント一覧(ハッシュタグ:&nbsp;<?php echo $twitter_hashtag; ?>)</h3> 
     166<?php foreach ($twitter->results as $tweet) { ?> 
     167<div class="twitter-post"> 
     168        <div class="twitter-post-image"> 
     169                <?php echo $html->link( 
     170                                $html->image($tweet->profile_image_url, array('alt'=> $tweet->from_user, 'border'=>"0")), 
     171                                "http://twitter.com/{$tweet->from_user}", 
     172                                array('class' => 'author', 'target' => '_blank'), 
     173                                false,false 
     174                        ) ;?> 
     175        </div> 
     176        <div class="twitter-post-body"> 
     177                <?php echo $html->link( 
     178                        $tweet->from_user, 
     179                        'http://twitter.com/' . $tweet->from_user, 
     180                        array('class' => 'author', 'target' => '_blank') 
     181                ); ?><br /> 
     182                <?php echo ($tweet->text); ?> 
     183                (<?php echo $html->link( 
     184                        $time->relativeTime($tweet->created_at), 
     185                        "http://twitter.com/{$tweet->from_user}/status/{$tweet->id}", 
     186                        array('class' => 'timestamp', 'target' => '_blank') 
     187                ); ?>)<br style="clear: both;" /> 
     188        </div> 
     189</div> 
     190<?php } ?> 
     191</div> 
    164192 
    165193<div id="trackback"> 
  • websites/events.php.gr.jp/trunk/app/webroot/css/phpgrjp.css

    r19081 r35524  
    333333} 
    334334 
     335.twitter-post { 
     336        border-bottom: 1px dashed #B5D6FF; 
     337  margin-left: 20px; 
     338  margin-right: 20px; 
     339  margin-bottom: 3px; 
     340} 
     341 
     342.twitter-post img{ 
     343  float: left; 
     344  margin-left: 10px; 
     345  margin-right: 10px; 
     346} 
     347 
     348.twitter-post-body { 
     349  font-size:small; 
     350  margin-bottom: 3px; 
     351} 
    335352/* header */ 
    336353