Thursday, 15 July 2010

Joomla 1.5. How to add Like / Dislike button on videos / images? -



Joomla 1.5. How to add Like / Dislike button on videos / images? -

i'm useing joomla 1.5 allvideoshare (version 1.2.4) extension.

question part 1

i want inquire how create button on videos thumbs/images? illustration if user likes video clip or image can click button , counts how many users it. can simple button or facebook button if possible. maybe possible create / dislike buttons (if user don't video/image can dislike it)

example want place: http://img689.imageshack.us/img689/268/likecp.png

this part of code videos publishing:

<?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'); ($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 } ?>

question part 2

after add together / dislike buttons possible sort them "most popular" (which video have likes) or there hard work?

example: http://www.anekdotai.lt/

question part 3

in same place / dislike button want set facebook share button. have script works, can't succesfully add together place.

fb share script:

<?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>

if set video publishing code error: fatal error: phone call fellow member function get() on non-object in ..../juokoera.lt/public_html/components/com_allvideoshare/views/videos/tmpl/default.php on line 26

thank answers.

try adding next code define $params variable:

$params = jcomponenthelper::getparams( 'com_yourcomponent' );

image button video joomla facebook-like

No comments:

Post a Comment