0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: vote.tar
vote.php 0000666 00000005551 15137301321 0006240 0 ustar 00 <?php /** * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access. defined('_JEXEC') or die; /** * Vote plugin. * * @package Joomla.Plugin * @subpackage Content.vote */ class plgContentVote extends JPlugin { /** * Constructor * * @access protected * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ public function __construct(& $subject, $config) { parent::__construct($subject, $config); $this->loadLanguage(); } /** * @since 1.6 */ public function onContentBeforeDisplay($context, &$row, &$params, $page=0) { $html = ''; if ($params->get('show_vote')) { $rating = intval(@$row->rating); $rating_count = intval(@$row->rating_count); $view = JRequest::getString('view', ''); $img = ''; // look for images in template if available $starImageOn = JHtml::_('image', 'system/rating_star.png', NULL, NULL, true); $starImageOff = JHtml::_('image', 'system/rating_star_blank.png', NULL, NULL, true); for ($i=0; $i < $rating; $i++) { $img .= $starImageOn; } for ($i=$rating; $i < 5; $i++) { $img .= $starImageOff; } $html .= '<span class="content_rating">'; $html .= JText::sprintf( 'PLG_VOTE_USER_RATING', $img, $rating_count ); $html .= "</span>\n<br />\n"; if ( $view == 'article' && $row->state == 1) { $uri = JFactory::getURI(); $uri->setQuery($uri->getQuery().'&hitcount=0'); $html .= '<form method="post" action="' . htmlspecialchars($uri->toString()) . '">'; $html .= '<div class="content_vote">'; $html .= JText::_( 'PLG_VOTE_POOR' ); $html .= '<input type="radio" title="'.JText::sprintf('PLG_VOTE_VOTE', '1').'" name="user_rating" value="1" />'; $html .= '<input type="radio" title="'.JText::sprintf('PLG_VOTE_VOTE', '2').'" name="user_rating" value="2" />'; $html .= '<input type="radio" title="'.JText::sprintf('PLG_VOTE_VOTE', '3').'" name="user_rating" value="3" />'; $html .= '<input type="radio" title="'.JText::sprintf('PLG_VOTE_VOTE', '4').'" name="user_rating" value="4" />'; $html .= '<input type="radio" title="'.JText::sprintf('PLG_VOTE_VOTE', '5').'" name="user_rating" value="5" checked="checked" />'; $html .= JText::_( 'PLG_VOTE_BEST' ); $html .= ' <input class="button" type="submit" name="submit_vote" value="'. JText::_( 'PLG_VOTE_RATE' ) .'" />'; $html .= '<input type="hidden" name="task" value="article.vote" />'; $html .= '<input type="hidden" name="hitcount" value="0" />'; $html .= '<input type="hidden" name="url" value="'. htmlspecialchars($uri->toString()) .'" />'; $html .= JHtml::_('form.token'); $html .= '</div>'; $html .= '</form>'; } } return $html; } } index.html 0000666 00000000037 15137301321 0006541 0 ustar 00 <!DOCTYPE html><title></title> vote.xml 0000666 00000001543 15137301321 0006246 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="2.5" type="plugin" group="content"> <name>plg_content_vote</name> <author>Joomla! Project</author> <creationDate>November 2005</creationDate> <copyright>Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>2.5.0</version> <description>PLG_VOTE_XML_DESCRIPTION</description> <files> <filename plugin="vote">vote.php</filename> <filename>index.html</filename> </files> <languages> <language tag="en-GB">en-GB.plg_content_vote.ini</language> <language tag="en-GB">en-GB.plg_content_vote.sys.ini</language> </languages> <config> <fields name="params"> </fields> </config> </extension> .htaccess 0000666 00000000177 15137301321 0006347 0 ustar 00 <FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>