--- a/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Apr 28 19:05:19 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Apr 28 19:49:05 2010 +0200
@@ -22,39 +22,8 @@
// Initialize query
$query = Doctrine_Query::create()
->from('ThdFilm F')
- ->leftJoin('F.images I ')
- ->leftJoin('F.videos V')
- //->where("cu.code='{$culture}' AND mo.code='{$module}' AND ms.code='{$section}'")
->orderBy('RAND()');
$this->film = $query->execute()->getFirst();
-
- // Get image filename
- $images = $this->film->getImages();
- $this->imageFilename = null;
-
- if ($images) {
- $image = $images[0];
- $this->imageFilename = $image->getFile();
- }
-
-
- // Get Tag cloud
- // Only display 10 tags
- $this->tagCloud = ThdUtil::getTagCloud($this->film->getTagCloud(), 10);
-
- // Get video filename
- $videos = $this->film->getVideos();
- $this->videoFilename = null;
-
- if ($videos) {
- $video = $videos[0];
- $this->videoFilename = $video->getFile();
- }
-
- // Create tag action
- $controller = $this->getController();
- $this->actionUri = $controller->genUrl('@editVideoSegment?film_slug='.$this->film->getSlugUrl());
-
}
public function executeLastTaggedList() {
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_randomFilm.php Wed Apr 28 19:05:19 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_randomFilm.php Wed Apr 28 19:49:05 2010 +0200
@@ -1,108 +1,4 @@
-<script type="text/javascript">
- // Charge le player
- flowplayer("player", "<?php echo flash_path('flowplayer-3.1.2.swf') ?>",
- {
- clip: {url: "<?php echo video_path($filmVideo['file']); ?>",
- autoPlay: false,
- autoBuffering: true,
- onSeek: function() {
- playerSeek();
- }
- },
-
- plugins: {
-
- content: {url: "<?php echo flash_path('flowplayer.content-3.1.0.swf') ?>",
- backgroundColor: 'transparent',
- display: 'none',
- style: {p: {fontSize: 15}}
- }
-
- },
-
- onLoad: function() {
- playerLoaded(this);
- },
-
- onUnload: function() {
- playerUnloaded(this);
- },
- onError: function(code,msg) {
- alert(msg);
- },
- });
-
-
- function loadSegments() {
-
- if ($f().getClip() == undefined) {
- window.setTimeout("loadSegments()",2000);
- return false;
- }
-
- var duration = Math.round($f().getClip().fullDuration*10) * 100;
-
-
- var segments = tagTool.segments;
-
- for (seg in segments) {
- var segd = segments[seg].sout - segments[seg].sin;
- var percent = Math.round(segd * 100 / duration);
- var offset = Math.round(segments[seg].sin * 100 / duration);
- var c = $('#seg_container_template').clone().removeAttr("id");
- $("#segments").append(c);
- $("span", c).html('<strong>' + tagTool.segments[seg].tag +'</strong> par ' + segments[seg].user);
- $("#seg_0", c).css({'margin-left': offset+'%', 'width': percent+'%'})
- .attr('id', 'seg_' + seg)
- .click(function() {
- seg_id = $(this).attr("id");
- seg_id = seg_id.substr(seg_id.indexOf('_') + 1);
- tagTool.playSegment(seg_id, $("#pauseAfter").val());
- });
- c.show();
- }
- }
-
-
- function playerSeek() {
- tagTool.rebuildCurrentTags(tagTool.player.getTime() * 1000);
- }
-
-
- function playerLoaded(player) {
-
- // Charge les tags
-
-
- tagTool.player = $f("player");
- tagTool.showTagInPage = false;
-
- }
- </script>
<div id="player">
<h3 class="head">Regardez et annotez des extraits :</h3>
- <div id="player-ba" class="player-ba" style="background:transparent url('<?php echo uc_url_for_scimage(film_image_path($imageFilename), 720, 405); ?>') no-repeat;">
- <div class="infos">
- <a href="<?php echo $actionUri; ?>" class="title"><?php echo $film->getTitle(); ?></a><br/><span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span>
- </div>
- <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
- <div class="tags">
- <ul class="item-list tag-list">
- <li><span class="head">
- <i>Tags liƩs au film :</i>
- </span></li>
- <?php
- foreach($film->getTagsArray() as $item) {
- if($item){
- $tag = $item;
- echo '<li class="tag-score-'.$tag['score'].'"><a href="">'.$tag.'</a>
- </li>';
-
- }
- } ?>
-
- </ul>
- </div>
- </div>
-</div>
-<div class="tag-action"><a href="<?php echo $actionUri ?>" class="link-button">Tagger le film</a></div>
+ <?php include_component('partials', 'filmItem', Array('film' => $film, 'size' => 'big')); ?>
+</div>
\ No newline at end of file
--- a/web/thdProject/apps/frontend/modules/partials/actions/components.class.php Wed Apr 28 19:05:19 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/partials/actions/components.class.php Wed Apr 28 19:49:05 2010 +0200
@@ -18,8 +18,14 @@
}
public function executeFilmItem() {
- // FIXME
- $this->tag = Array('score' => 3);
+ // Process thumb
+ $this->thumbWidth = 337;
+ $this->thumbHeight = 190;
+
+ if (isset($this->size) && $this->size == 'big') {
+ $this->thumbWidth = 720;
+ $this->thumbHeight = 405;
+ }
// Get image filename
$images = $this->film->getImages();
@@ -30,7 +36,6 @@
$this->imageFilename = $image->getFile();
}
-
// Get Tag cloud
// Only display 10 tags
$this->tagCloud = ThdUtil::getTagCloud($this->film->getTagCloud(), 10);
--- a/web/thdProject/apps/frontend/modules/partials/templates/_filmItem.php Wed Apr 28 19:05:19 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/partials/templates/_filmItem.php Wed Apr 28 19:49:05 2010 +0200
@@ -1,8 +1,8 @@
-<div id="player-<?php echo $film->getRef(); ?>" class="player-item" style="background:transparent url('<?php echo film_image_path($imageFilename); ?>') no-repeat;" href="<?php echo film_video_path($videoFilename);?>">
+<div id="player-<?php echo $film->getRef(); ?>" class="player-item player-item-<?php echo ((isset($size) && $size == 'big') ? 'big' : 'mini');?>" style="background:transparent url('<?php echo uc_url_for_scimage(film_image_path($imageFilename), $thumbWidth, $thumbHeight); ?>') no-repeat;" href="<?php echo film_video_path($videoFilename);?>">
<div class="infos">
<a href="<?php echo $actionUri; ?>" class="title" target="_top"><?php echo $film->getTitle(); ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span>
</div>
- <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
+ <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ class="play-button"></a>
<?php if ($tagCloud): ?>
<div class="tags">
<ul class="item-list tag-list">
--- a/web/thdProject/web/css/flashplayer.css Wed Apr 28 19:05:19 2010 +0200
+++ b/web/thdProject/web/css/flashplayer.css Wed Apr 28 19:49:05 2010 +0200
@@ -80,11 +80,20 @@
margin: 0;
padding: 0;
display: block;
- width:337px;
- height:190px;
text-align:center;
cursor: pointer;
}
+
+.player-item-mini {
+ width:337px;
+ height:190px;
+}
+
+.player-item-big {
+ width:720px;
+ height:410px;
+}
+
.player-item .infos a.title {
font-size: 20px;
font-weight: normal;
@@ -108,11 +117,16 @@
.player-item .infos .film-infos {
font-size:11px;
}
-.player-item #play {
+.player-item-mini .play-button {
position: relative;
top: 30px;
- /*background:#000000 url(images/buttons/btn_play.png) no-repeat;*/
}
+
+.player-item-big .play-button {
+ position: relative;
+ top: 150px;
+}
+
.player-item .tags {
position:relative;
top: 19px;