W IP.Downloads możliwe jest ustawienie generowanie i pisanie nowego tematu jeśli zostanie dodany plik do bazy. Taki plik możemy edytować, kasować, ale jest możliwość również odrzucenia ( nie kasowania ) czyli ukrycia. Jednak wtedy temat założony automatycznie podczas wysyłania tego tematu nie zostanie ukryty. Poniżej przedstawiam sposób jak to zsynchronizować.
Otwórz plik: sources/components_public/downloads/moderate.php
Znajdź:
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'];
}
Zamień na:
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();
Znajdź:
$this->ipsclass->DB->do_update( "downloads_files", $to_update, "file_id=".$id );
Dodaj poniżej:
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 1 ), "tid=".$file['file_topicid'] );
Znajdź:
return $num;
}
}
/*-------------------------------------------------------------------------*/
// Do multi-unapprove
/*-------------------------------------------------------------------------*/
Dodaj powyżej:
$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();
Znajdź:
$this->ipsclass->DB->do_update( "downloads_files", array( 'file_open' => 0 ), "file_id=".$id );
Dodaj poniżej:
$this->ipsclass->DB->do_update( "topics", array ( 'approved' => 0 ), "tid=".$file['file_topicid'] );
Znajdź:
return $num;
}
}
/*-------------------------------------------------------------------------*/
// Do multi-move
/*-------------------------------------------------------------------------*/
Dodaj powyżej:
$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();
Zapisz i wyślij.
Gotowe!
Pozdrawiam,
DawPi