Перейти к контенту
  • 0

Ошибка при ответе в голосовании!


Koznov

Вопрос

Кунул весь файлик! ОШИБКА ТАКАЯ ВЫЛАЗИТ!

Parse error: parse error, unexpected T_STRING, expecting '&' or T_VARIABLE or T_CONST in /home/pyma/pyma.alfaspace.net/skin_cache/cacheid_2/skin_poll.php on line 191

 

 

<?php
/*--------------------------------------------------*/
/* FILE GENERATED BY INVISION POWER BOARD           */
/* CACHE FILE: Skin set id: 2                     */
/* CACHE FILE: Generated: Fri, 04 Feb 2005 09:12:45 GMT */
/* DO NOT EDIT DIRECTLY - THE CHANGES WILL NOT BE   */
/* WRITTEN TO THE DATABASE AUTOMATICALLY            */
/*--------------------------------------------------*/

class skin_poll {

//===========================================================================
// button_null_vote
//===========================================================================
function button_null_vote() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<input type="submit" name="nullvote" value="{$ibforums->lang['poll_null_vote']}" title="{$ibforums->lang['tt_poll_null']}" />
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// button_show_results
//===========================================================================
function button_show_results() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<input type="button" value="{$ibforums->lang['pl_show_results']}" title="{$ibforums->lang['tt_poll_show']}" onclick="go_gadget_show()" />
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// button_show_voteable
//===========================================================================
function button_show_voteable() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<input type="button" name="viewresult" value="{$ibforums->lang['pl_show_vote']}"  title="{$ibforums->lang['tt_poll_svote']}" onclick="go_gadget_vote()" />
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// button_vote
//===========================================================================
function button_vote() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<input type="submit" name="submit" value="{$ibforums->lang['poll_add_vote']}" title="{$ibforums->lang['tt_poll_vote']}" />
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// delete_link
//===========================================================================
function delete_link($tid="",$fid="",$key="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<a href="{$ibforums->base_url}act=Mod&CODE=22&f=$fid&t=$tid&auth_key=$key"><{P_DELETE}></a>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// edit_link
//===========================================================================
function edit_link($tid="",$fid="",$key="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<a href="{$ibforums->base_url}act=Mod&CODE=20&f=$fid&t=$tid&auth_key=$key"><{P_EDIT}></a>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// poll_answerpublic
//===========================================================================
function poll_answerpublic() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
      	 <td class="row1" colspan="3"><input type="checkbox" name="display_votepublic" value="1" class="radiobutton" checked="checked" /> <b>{$ibforums->lang['make_answerpublic']}</b></td>
       </tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// poll_header
//===========================================================================
function poll_header($tid="",$poll_q="",$edit="",$delete="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<!--IBF.POLL_JS-->
<form action="{$ibforums->base_url}act=Poll&t=$tid&st={$ibforums->input['st']}" method="post">
 <table cellspacing="1">
	 <tr>
   <th colspan="3" align="center"><b>$poll_q</b></th>
	 </tr>
	 <tr>
   <td colspan="3" class="formsubtitle" align="right">$edit $delete</td>
	 </tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// poll_javascript
//===========================================================================
function poll_javascript($tid="",$fid="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<script type="text/javascript">
function go_gadget_show()
{
window.location = "{$ibforums->base_url}&act=ST&f=$fid&t=$tid&mode=show&st={$ibforums->input['start']}";
}
function go_gadget_vote()
{
window.location = "{$ibforums->base_url}&act=ST&f=$fid&t=$tid&st={$ibforums->input['start']}";
}
function show_uservotes() {
url = "index.{$ibforums->vars['php_ext']}?act=who_voted&tid={$tid}&s={$ibforums->session_id}";
window.open(url,'ViewVoteHistory','width=600,height=700,resizable=yes,scrollbars=yes');    
}
</script>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// Render_multirow_form
//===========================================================================
function Render_multirow_form($votes="",id="",answer="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
       <td class="row1" colspan="3"><input type="checkbox" name="poll_vote_{$id}" value="1" class="radiobutton" /> <strong>$answer</strong></td>
       </tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// Render_row_form
//===========================================================================
function Render_row_form($votes="",$id="",$answer="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
    <td class="row1" colspan="3"><input type="radio" name="poll_vote" value="$id" class="radiobutton" /> <b>$answer</b></td>
</tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// Render_row_results
//===========================================================================
function Render_row_results($votes="",$id="",$answer="",$percentage="",$width="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
<td class="row1">$answer</td>
<td class="row1"> [ <b>$votes</b> ] </td>
<td class="row1"><{BAR_LEFT}><img src="{$ibforums->vars['img_url']}/bar.gif" width="$width" height="11" align="middle" alt="" /><{BAR_RIGHT}> [$percentage%]</td>
</tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// show_total_votes
//===========================================================================
function show_total_votes($total_votes="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
    <td class="row1" colspan="3" align="center"><b>{$ibforums->lang['pv_total_votes']}: $total_votes</b></td>
</tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// show_users_votes
//===========================================================================
function show_users_votes() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
      	 <td class="row1" colspan="3" align="center"><a href="javascript:show_uservotes();"><b>{$ibforums->lang['view_uservotes']}</b></a></td>
       </tr>
EOF;

//--endhtml--//
return $IPBHTML;
}

//===========================================================================
// ShowPoll_footer
//===========================================================================
function ShowPoll_footer() {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<tr>
	 <td colspan="3" class="formbuttonrow"><!--IBF.VOTE--> <!--IBF.SHOW--></td>
 </tr>
 <tr>
	 <td class="catend" colspan="3"><!-- no content --></td>
 </tr>
 </table>
</form>
EOF;

//--endhtml--//
return $IPBHTML;
}



}

/*--------------------------------------------------*/
/*<changed bits>

</changed bits>*/
/* END OF FILE                                      */
/*--------------------------------------------------*/

?>

Ссылка на комментарий
Поделиться на других сайтах

Рекомендуемые сообщения

  • 0
Я тебе говорю, не юзай ТАКОЙ форум! 125 модов - не шутка! Ошибка в кэше скина!
Ссылка на комментарий
Поделиться на других сайтах

  • 0

Koznov

Ты не можешь понять одно - у этого форума я лично обнаружил дыры и глюки! А ошибка у тебя в кэше. Ее исправить НЕВОЗМОЖНО!

Ссылка на комментарий
Поделиться на других сайтах

  • 0

d1pro Отлично! :D;):)

 

Добавлено в [mergetime]1107602106[/mergetime]

Теперь при ответе в голосовани!!

 

Parse error: parse error, unexpected T_BOOLEAN_AND in /home/pyma/pyma.alfaspace.net/sources/lib/add_poll.php on line 148

 

 

148

 

         if ($id == $ibforums->input['poll_vote']) && ($this->topic['poll_type'] == "single" || $this->topic['poll_type'] == "")) {

 

 

 

<?php

/*
+--------------------------------------------------------------------------
|   Invision Power Board v2.0.3 
|   =============================================
|   by Matthew Mecham
|   © 2001 - 2004 Invision Power Services, Inc.
|   [URL=http://www.invisionpower.com]http://www.invisionpower.com[/URL]
|   =============================================
|   Web: [URL=http://www.invisionboard.com]http://www.invisionboard.com[/URL]
|   Time: Tue, 23 Nov 2004 17:16:48 GMT
|   Release: ba6b11d2a3a3a2876400e58d0634e1da
|   Licence Info: [URL=http://www.invisionboard.com/?license]http://www.invisionboard.com/?license[/URL]
+---------------------------------------------------------------------------
|
|   > Add POLL module
|   > Module written by Matt Mecham
|   > DBA Checked: Fri 21 May 2004
|
+--------------------------------------------------------------------------
|
|   QUOTE OF THE MODULE: (Taken from BtVS)
|   --------------------
|	Drusilla: I'm naming all the stars...
|   Spike: You can't see the stars love, That's the ceiling. Also, it's day.
|
+-------------------------------------------------------------------------- 
*/

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}

class poll {


var $topic = array();
var $poll  = array();
var $upload = array();
var $poll_count = 0;
var $poll_choices = "";

function auto_run() {
  global $ibforums, $std, $DB, $print;
  
  $ibforums->lang      = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id);
  
  // Lets do some tests to make sure that we are allowed to start a new topic
  
  if (! $ibforums->member['g_vote_polls'])
  {
  	$std->Error( array( LEVEL => 1, MSG => 'no_reply_polls') );
  }
  
  /*// Did we choose a choice?
  
  if (!$ibforums->input['nullvote'])
  {
  	if (! isset($ibforums->input['poll_vote']) )
  	{
    $std->Error( array( LEVEL => 1, MSG => 'no_vote') );
  	}
  }*/

  // Make sure we have a valid poll id
  
       	$ibforums->input['t'] = intval($ibforums->input['t']);
       	
  if (! $ibforums->input['t'] )
  {
  	$std->Error( array( LEVEL => 1, MSG => 'missing_files') );
  }
   
     // Load the topic and poll
     
     $DB->cache_add_query( 'poll_get_poll_with_topic', array( 'tid' => $ibforums->input['t'] ) );
  $DB->cache_exec_query();
  
     $this->topic = $DB->fetch_row();
     
     if (! $this->topic['tid'] )
     {
     	$std->Error( array( LEVEL => 1, MSG => 'poll_none_found') );
     }

     if ($this->topic['state'] != 'open')
     {
     	$std->Error( array( LEVEL => 1, MSG => 'locked_topic') );
     }
     
  // Did we choose a choice?
  
  if (!$ibforums->input['nullvote'])
  {
  	if(!isset($ibforums->input['poll_vote']) && $this->topic['poll_type'] != "multiple") {
    $std->Error( array( LEVEL => 1, MSG => 'no_vote') );
  	} else if($this->topic['poll_type'] == "multiple") {
    $set_answers = 0;
    for($i=0;$i<$this->topic['poll_qcount'];$i++) {
    	if(isset($ibforums->input['poll_vote_'.$i])) {
      $set_answers++;
    	}
    }
    if($set_answers == false) {
    	$std->Error( array( LEVEL => 1, MSG => 'no_vote') );
    }
    if(($set_answers > $ibforums->member['g_maxpollvotes']) && ($ibforums->member['g_maxpollvotes'] > 0)) {
    	$std->Error( array( LEVEL => 1, MSG => 'multipoll_tomanyvotes') );    
    }
  	}	
  }
  
  // Have we voted before?
  
  $DB->simple_construct( array( 'select' => 'member_id', 'from' => 'voters', 'where' => "tid={$this->topic['tid']} and member_id=".$ibforums->member['id'] ) );
  $DB->simple_exec();
  
  if ( $DB->get_num_rows() )
  {
  	$std->Error( array( LEVEL => 1, MSG => 'poll_you_voted') );
  }
  
  // If we're here, lets add the vote
  
  $DB->do_insert( 'voters', array( 'member_id'  => $ibforums->member['id'],
           'ip_address' => $ibforums->input['IP_ADDRESS'],
           'tid'        => $this->topic['tid'],
           'forum_id'   => $this->topic['forum_id'],
           'vote_date'  => time(),
          ) );
             
  // If this isn't a null vote...
  
  if ( ! $ibforums->input['nullvote'] )
  {
  	$poll_answers = unserialize(stripslashes($this->topic['choices']));
         reset($poll_answers);
         $new_poll_array = array();
         foreach ($poll_answers as $entry)
         {
         	$id     = $entry[0];
         	$choice = $entry[1];
         	$votes  = $entry[2];
         	
         	if ($id == $ibforums->input['poll_vote']) && ($this->topic['poll_type'] == "single" || $this->topic['poll_type'] == "")) {
           $votes++;
    	$total_votes = 1;
         	} else if(($ibforums->input['poll_vote_'.$id] == 1) && ($this->topic['poll_type'] == "multiple")) {
    	$votes++;
    	$total_votes++;
    }
         	
    // This way people who use the "Multiple Choice Polls" modification still have this working
    if(($votes != $entry[2]) && ($ibforums->input['display_votepublic'] == 1 || $ibforums->member['g_choosetoview'] == 0)) {
    	$DB->do_insert('vote_logs',array(	'tid'  => $this->topic['tid'],
              'mid'  => $ibforums->member['id'],
              'date'  => time(),
              'voted_for'	=> $id,));
    }
         	$new_poll_array[] = array( $id, $choice, $votes);
         }
         
         $this->topic['choices'] = addslashes(serialize($new_poll_array));
         
         $DB->simple_exec_query( array( 'update' => 'polls',
                   'set'    => "votes=votes+{$total_votes},choices='{$this->topic['choices']}'",
                   'where'  => "pid={$this->topic['poll_id']}" ) );
             
         if ($this->topic['allow_pollbump'])
         {
         	$this->topic['last_vote'] = time();
         	$this->topic['last_post'] = time();
    
    $DB->do_update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid='.$this->topic['tid'] );
         }
         else
         {
         	$this->topic['last_vote'] = time();
         	
         	$DB->do_update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid='.$this->topic['tid'] );
         }
        }

  $lang = $ibforums->input['nullvote'] ? $ibforums->lang['poll_viewing_results'] : $ibforums->lang['poll_vote_added'];
  
  $print->redirect_screen( $lang , "act=ST&f={$this->topic['forum_id']}&t={$this->topic['tid']}&st={$ibforums->input['st']}" );


}

}

?>

Изменено пользователем Koznov
Ссылка на комментарий
Поделиться на других сайтах

  • 0

if (($id == $ibforums->input['poll_vote']) && ($this->topic['poll_type'] == "single" || $this->topic['poll_type'] == "")) {

А не проще ребилд кэша сделать, а?

Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.