The voting system

Phoca Gallery - image gallery extension
gidaban
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Oct 2012, 16:17

The voting system

Post by gidaban »

Hi,

I have a question about, and so much of a good gallery. Is it possible to transfer images to a different assessment on the page? He wanted me to be placed directly under the photo, and not, as is so far only after giving a preview.

Regards Tom
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: The voting system

Post by Jan »

Hi, for now there is no such feature, so this needs to be customized.

Jan
If you find Phoca extensions useful, please support the project
gidaban
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Oct 2012, 16:17

Re: The voting system

Post by gidaban »

Do you have any suggestions on how to do this?


Ok i have code

Code: Select all

$amp = PhocaGalleryUtils::setQuestionmarkOrAmp($this->tmpl['action']);
if ((int)$this->tmpl['displayratingimg'] == 1 || $this->tmpl['mb_rating']) {
	// Leave message for already voted images
	$vote = JRequest::getVar('vote', 0, '', 'int');
	if ($vote == 1) {
		$voteMsg = JText::_('COM_PHOCAGALLERY_ALREADY_RATED_IMG_THANKS');
	} else {
		$voteMsg = JText::_('COM_PHOCAGALLERY_ALREADY_RATE_IMG');
	}

	echo '<table style="text-align:left" border="0">tu'
		.'<tr>'
		.'<td><strong>' . JText::_('COM_PHOCAGALLERY_RATING'). '</strong>: ' . $this->tmpl['votesaverageimg'] .' / '.$this->tmpl['votescountimg'] . ' ' . JText::_($this->tmpl['votestextimg']). '&nbsp;&nbsp;</td>';
		
	if ($this->tmpl['alreadyratedimg']) {
		echo '<td style="text-align:left">ocen<ul class="star-rating">'
			.'<li class="current-rating" style="width:'.$this->tmpl['voteswidthimg'].'px"></li>'
			.'<li><span class="star1"></span></li>';

		for ($i = 2;$i < 6;$i++) {
			echo '<li><span class="stars'.$i.'"></span></li>';
		}
		echo '</ul></td>';
		
		if ($this->tmpl['enable_multibox'] == 1) {
			echo '<td></td></tr>';
			echo '<tr><td style="text-align:left" colspan="4" class="pg-rating-msg">'.$voteMsg.'</td></tr>';
		} else {
			echo '<td style="text-align:left" colspan="4" class="pg-rating-msg">&nbsp;&nbsp;'.$voteMsg.'</td></tr>';
		}

			
	} else if ($this->tmpl['notregisteredimg']) {

		echo '<td style="text-align:left"><ul class="star-rating">'
			.'<li class="current-rating" style="width:'.$this->tmpl['voteswidthimg'].'px"></li>'
			.'<li><span class="star1"></span></li>';

		for ($i = 2;$i < 6;$i++) {
			echo '<li><span class="stars'.$i.'"></span></li>';
		}
		echo '</ul></td>';
		
		if ($this->tmpl['enable_multibox'] == 1) {
			echo '<td></td></tr>';
			echo '<tr><td style="text-align:left" colspan="4" class="pg-rating-msg">'.JText::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_RATE_IMAGE').'</td></tr>';
		} else {
			echo '<td style="text-align:left" colspan="4" class="pg-rating-msg">&nbsp;&nbsp;' . JText::_('COM_PHOCAGALLERY_COMMENT_ONLY_REGISTERED_LOGGED_RATE_IMAGE').'</td></tr>';
		}
		
			
	} else {
		
		echo '<td style="text-align:left"><ul class="star-rating">'
			.'<li class="current-rating" style="width:'.$this->tmpl['voteswidthimg'].'px"></li>'
			//.'<li><a href="'.$this->tmpl['action'].$amp.'controller=detail&task=rate&rating=1" title="1 '. JText::_('COM_PHOCAGALLERY_STAR_OUT_OF').' 5" class="star1">1</a></li>';
		
			.'<li><a href="'.$this->tmpl['action'].$amp.'controller=detail&task=rate&rating=1" title="'. JText::sprintf('COM_PHOCAGALLERY_STAR_OUT_OF', 1, 5). '" class="star1">1</a></li>'; 
		
		for ($i = 2;$i < 6;$i++) {
			//echo '<li><a href="'.$this->tmpl['action'].$amp.'controller=detail&task=rate&rating='.$i.'" title="'.$i.' '. JText::_('COM_PHOCAGALLERY_STARS_OUT_OF').' 5" class="stars'.$i.'">'.$i.'</a></li>';
			
			echo '<li><a href="'.$this->tmpl['action'].$amp.'controller=detail&task=rate&rating='.$i.'" title="'.JText::sprintf('COM_PHOCAGALLERY_STARS_OUT_OF', $i, 5). '" class="stars'.$i.'">'.$i.'</a></li>';
		}
		echo '</ul></td></tr>';
	}
	echo '</table>';
}
I copied it in place of the stars but unfortunately I can not read-values ​​from the database.
gidaban
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Oct 2012, 16:17

Re: The voting system

Post by gidaban »

REFRESH :-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: The voting system

Post by Jan »

Hi, I don't have any clue advices for this customization as I didn't do such yet :-(

Jan
If you find Phoca extensions useful, please support the project
Post Reply