TeraCell
March 19th, 2008, 08:25 PM
I am trying to program a feature for Invision Power Board 2.3 where the member can enter a password for a topic and others can only see the topic if they know the password. I am basing it of some old code for from a previous version, however I get this error now:
Fatal error: Call to a member function topic_password_log_in() on a non-object
The bit of code I added is this:
if( $this->topic['topic_read_perms'] && $this->topic['topic_read_perms'] != '*' )
{
if( $this->ipsclass->member['id'] != $this->topic['starter_id'] )
{
if( ! $this->ipsclass->input['L'] )
{
$cookie_pass = $this->ipsclass->my_getcookie( 'ipbtopicpass_'.$this->topic['tid'] );
if( trim($cookie_pass) != md5($this->topic['topic_read_perms']) )
{
$this->output = $this->ipsclass->compiled_templates['skin_topic']->topic_password_log_in( $this->topic['tid'] );
$this->nav = $this->ipsclass->forums->forums_breadcrumb_nav( $this->forum['id'] );
$this->nav[] = "<a href='{$this->ipsclass->base_url}showtopic={$this->topic['tid']}'>{$this->topic['title']}</a>";
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name']." -> ".$this->topic['title'],
'JS' => 0,
'NAV' => $this->nav,
) );
}
}
else
{
if( $this->ipsclass->input['topic_pwd'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) );
}
if( $this->ipsclass->input['topic_pwd'] != $this->topic['topic_read_perms'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'wrong_pass' ) );
}
$this->ipsclass->my_setcookie( "ipbtopicpass_".$this->topic['tid'], md5($this->ipsclass->input['topic_pwd']) );
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['logged_in'], "showtopic=".$this->topic['tid'] );
}
}
}
Any ideas? :) Help would be GREATLY appreciated.
Fatal error: Call to a member function topic_password_log_in() on a non-object
The bit of code I added is this:
if( $this->topic['topic_read_perms'] && $this->topic['topic_read_perms'] != '*' )
{
if( $this->ipsclass->member['id'] != $this->topic['starter_id'] )
{
if( ! $this->ipsclass->input['L'] )
{
$cookie_pass = $this->ipsclass->my_getcookie( 'ipbtopicpass_'.$this->topic['tid'] );
if( trim($cookie_pass) != md5($this->topic['topic_read_perms']) )
{
$this->output = $this->ipsclass->compiled_templates['skin_topic']->topic_password_log_in( $this->topic['tid'] );
$this->nav = $this->ipsclass->forums->forums_breadcrumb_nav( $this->forum['id'] );
$this->nav[] = "<a href='{$this->ipsclass->base_url}showtopic={$this->topic['tid']}'>{$this->topic['title']}</a>";
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name']." -> ".$this->topic['title'],
'JS' => 0,
'NAV' => $this->nav,
) );
}
}
else
{
if( $this->ipsclass->input['topic_pwd'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) );
}
if( $this->ipsclass->input['topic_pwd'] != $this->topic['topic_read_perms'] )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'wrong_pass' ) );
}
$this->ipsclass->my_setcookie( "ipbtopicpass_".$this->topic['tid'], md5($this->ipsclass->input['topic_pwd']) );
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['logged_in'], "showtopic=".$this->topic['tid'] );
}
}
}
Any ideas? :) Help would be GREATLY appreciated.