If you use setting Topic generation upon file submission, when you unapprove a file, the topic created remains approved. With this tutorial, the topic created will be unapproved too... and vice versa.
Open sources\components_public\downloads\moderate.php and find:
Open sources\components_public\downloads\moderate.php and find:
if( $file['file_open'] == 0 )
{
$this->do_multi_approve( array( $id => $id ) );
$text = $this->ipsclass->lang['moderate_approve'];
}
else
{
$to_update['file_open'] = 0;
$this->ipsclass->DB->do_update( "downloads_files", $to_update, "file_id=".$id );
$text = $this->ipsclass->lang['moderate_unapprove'];
}
Change to: if( $file['file_open'] == 0 )
{
$this->do_multi_approve( array( $id => $id ) );
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 1 ), "tid=".$file['file_topicid'] );
$text = $this->ipsclass->lang['moderate_approve'];
}
else
{
$to_update['file_open'] = 0;
$this->ipsclass->DB->do_update( "downloads_files", $to_update, "file_id=".$id );
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 0 ), "tid=".$file['file_topicid'] );
$text = $this->ipsclass->lang['moderate_unapprove'];
}
$modfunc = $this->ipsclass->load_class( ROOT_PATH.'sources/lib/func_mod.php', 'func_mod' );
$modfunc->forum_recount( $this->catlib->cat_lookup[$file['file_cat']]['coptions']['opt_topicf'] );
$modfunc->stats_recount();
$this->ipsclass->update_forum_cache();
Find:$this->ipsclass->DB->do_update( "downloads_files", $to_update, "file_id=".$id );Add below:
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 1 ), "tid=".$file['file_topicid'] );Find:
return $num; } } /*-------------------------------------------------------------------------*/ // Do multi-unapprove /*-------------------------------------------------------------------------*/Add above:
$modfunc = $this->ipsclass->load_class( ROOT_PATH.'sources/lib/func_mod.php', 'func_mod' ); $modfunc->forum_recount( $this->catlib->cat_lookup[$file['file_cat']]['coptions']['opt_topicf'] ); $modfunc->stats_recount(); $this->ipsclass->update_forum_cache();Find:
$this->ipsclass->DB->do_update( "downloads_files", array( 'file_open' => 0 ), "file_id=".$id );Add below:
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 0 ), "tid=".$file['file_topicid'] );Find:
return $num; } } /*-------------------------------------------------------------------------*/ // Do multi-move /*-------------------------------------------------------------------------*/Add above:
$modfunc = $this->ipsclass->load_class( ROOT_PATH.'sources/lib/func_mod.php', 'func_mod' ); $modfunc->forum_recount( $this->catlib->cat_lookup[$file['file_cat']]['coptions']['opt_topicf'] ); $modfunc->stats_recount(); $this->ipsclass->update_forum_cache();Screenshot:
File unapproved on IP.Downloads and below the topic unapproved too













