Joomla 1.5 AllVideoShare (バージョン 1.2.4) 拡張機能を使用しています。
質問パート1
動画のサムネイル/画像にいいねボタンを付ける方法を教えてください。たとえば、ユーザーがビデオクリップや画像を気に入った場合、いいねボタンをクリックすると、気に入ったユーザーの数がカウントされます。できればボタンやフェイスブックのボタンのようなシンプルなものでも構いません。Like / Dislikeボタンを作ることも可能かもしれません(ユーザーがこのビデオ/画像が気に入らない場合は、それを嫌いにすることができます)
配置したい場所の例: http://img689.imageshack.us/img689/268/likecp.png
これは、ビデオが公開されているコードの私の部分です:
<?php if ($this->params->get('show_'.$header, 1)) : ?>
<h2> <?php echo $this->escape($this->params->get($header)); ?> </h2>
<?php endif; ?>
<div id="avs_gallery2<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php
if(!count($videos)) echo JText::_('ITEM_NOT_FOUND');
for ($i=0, $n=count($videos); $i < $n; $i++) {
$clear = '';
if($column >= $this->cols) {
$clear = '<div style="clear:both;"></div>';
$column = 0;
$row++;
}
$column++;
echo $clear;
?>
<span class="name"><?php echo $categories[$i]->name; ?></span>
<div id="testas" class="avs_thumb" style="width:190px;" onclick='javascript:location.href="<?php echo JRoute::_($link.$videos[$i]->slug.$qs); ?>"'>
<img class="arrow" src="<?php echo JURI::root(); ?>components/com_allvideoshare/assets/play.gif" border="0" style="margin-left:80px; margin-top:47px;" />
<img class="image" src="<?php echo $videos[$i]->thumb; ?>" width="190; " height="120;" title="<?php echo JText::_('CLICK_TO_VIEW') . ' : ' . $videos[$i]->title; ?>" border="0" />
<span class="title"><FONT COLOR="#000000"><?php echo $videos[$i]->title; ?></font></span>
<span class="views"><FONT COLOR="#000000"><?php echo JText::_('Peržiūros'); ?> : <strong><?php echo $videos[$i]->views*2+1; ?></strong></font></span>
<div class="avs_category_label"><?php echo JText::_('Kategorija'); ?> : <strong><?php echo $videos[$i]->category; ?></strong></div>
</div>
<?php } ?>
質問パート 2
Like / Dislikeボタンを追加した後、それらを「最も人気のある」(どのビデオが最も好きか)でソートできるようになりますか、それとも大変な作業がありますか?
質問パート3
Like/Dislike ボタンと同じ場所に Facebook のシェアボタンを置きたい。機能するスクリプトがありますが、この場所に正常に追加できません。
FB 共有スクリプト:
<?php
defined('_JEXEC') or die('Restricted access');
$linkTxt = $params->get( 'linkTxt', '' );
$linkColor = $params->get( 'linkColor', '' );
$linkHColor = $params->get( 'linkHColor', '' );
$theUrl = $params->get( 'theUrl', '1' );
$wholeUrl = "location.href.substring(0,location.href.lastIndexOf('/'))";
$currentUrl = "location.href";
?>
<script>function fbs_click() {u=<?php if($params->get('theUrl', 1))
{
echo $currentUrl;
}
else{
echo $wholeUrl;
} ?>;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 1px 1px 20px; height:17px; color:#<?php echo $linkColor ?>; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat left; } html .fb_share_button:hover { color:#<?php echo $linkHColor ?>; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat left; text-decoration:none; } </style> <a rel="nofollow" href="http://www.facebook.com/share.php?u=<url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;"><?php echo $linkTxt; ?></a>
それをビデオパブリッシングコードに入れると、エラーが発生します:
Fatal error: Call to a member function get() on a non-object in ..../juokoera.lt/public_html/components/com_allvideoshare/views/videos/tmpl/default.php on line 26
回答ありがとうございます。