• 03-03-2009, 23:21:50
    #1
    selamlar,
    bir joomla modülünü kurup aktifleştirince
    Fatal error: Cannot redeclare class modPollHelper in /home/progryco/public_html/modules/mod_coolpoll/helper.php on line 18 hatası alıyorum. Ne yapmam gerek

    Bahsettiği helper.php dosyası şu şekilde
    <?php
    /**
    * @version		$Id: helper.php 10381 2008-06-01 03:35:53Z pasamio $
    * @package		Joomla
    * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
    * @license		GNU/GPL, see LICENSE.php
    * Joomla! is free software. This version may have been modified pursuant
    * to the GNU General Public License, and as distributed it includes or
    * is derivative of works licensed under the GNU General Public License or
    * other free or open source software licenses.
    * See COPYRIGHT.php for copyright notices and details.
    */
    // no direct access
    defined('_JEXEC') or die('Restricted access');
    class modPollHelper
    {	function getPoll($id)
    	{
    		$db		=& JFactory::getDBO();
    		$result	= null;
    		$query = 'SELECT id, title, lag,'
    			.' CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\':\', id, alias) ELSE id END as slug '
    			.' FROM #__polls'
    			.' WHERE id = '.(int) $id
    			.' AND published = 1'
    			;
    		$db->setQuery($query);
    		$result = $db->loadObject();
    		if ($db->getErrorNum()) {
    			JError::raiseWarning( 500, $db->stderr() );
    		}
    		return $result;
    	}
    	function getPollOptions($id)
    	{
    		$db	=& JFactory::getDBO();
    		$query = 'SELECT id, text' .
    			' FROM #__poll_data' .
    			' WHERE pollid = ' . (int) $id .
    			' AND text <> ""' .
    			' ORDER BY id';
    		$db->setQuery($query);
    		if (!($options = $db->loadObjectList())) {
    			echo "MD ".$db->stderr();
    			return;
    		}
    		return $options;
    	}
    	function PollVote( $poll_id, $option_id )
    	{
        	$db =& JFactory::getDBO();
    		$poll_id	= (int) $poll_id;
    		$option_id	= (int) $option_id;
    		$query = 'UPDATE #__poll_data'
    			. ' SET hits = hits + 1'
    			. ' WHERE pollid = ' . (int) $poll_id
    			. ' AND id = ' . (int) $option_id
    			;
    		$db->setQuery( $query );
    		$db->query();
    		$query = 'UPDATE #__polls'
    			. ' SET voters = voters + 1'
    			. ' WHERE id = ' . (int) $poll_id
    			;
    		$db->setQuery( $query );
    		$db->query();
    		$date =& JFactory::getDate();
    		$query = 'INSERT INTO #__poll_date'
    			. ' SET date = ' . $db->Quote($date->toMySQL())
    			. ', vote_id = ' . (int) $option_id
    			. ', poll_id = ' . (int) $poll_id
    		;
    		$db->setQuery( $query );
    		$db->query();
    		//return "yes";
    	}
    }
    ?>
  • 04-03-2009, 15:46:06
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    modPollHelper adında başka bir class olduğu için redeclare hatası almaktasın.
  • 04-03-2009, 15:55:56
    #3
    ne yapmam gerek
  • 04-03-2009, 16:16:53
    #4
    isim değiştirmen gerek ve ayarları ona göre yapmanız gerek
  • 04-03-2009, 16:45:49
    #5
    ayni modülü 2 kere kurmuş olabilirmisiniz ?
  • 04-10-2009, 03:25:40
    #6
    konuyu hortlatcam ama, takıldığım bir yer vardı burayı buldum, çözümü bulduk yazalım

    include ile çağırdığınız class ları , include_once yaparak tekrar çağırtarak bu sorunu aşabilirsiniz.