← Tutoriais

[PHPBB] Activar e Desativar Portal através do ACP

Lida 2962 vezes

Offline

gerardopedro 
Membro
Mensagens 596 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Encontrei isto e é bastante interessante...

MOD para phpbb que dá a possibilidade de activar/desactivar o ezportal do vosso fórum.

Código: [Seleccione]

 Files to Edit: admin/admin_board.php,
                templates/fisubsilversh/admin/board_config_body.tpl,
                language/lang_english/lang_admin.php,
                portal.php
 
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('activeportal','1');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$activeportal_yes = ( $new['activeportal'] ) ? "checked=\"checked\"" : "";
$activeportal_no = ( !$new['activeportal'] ) ? "checked=\"checked\"" : "";
#
#-----[ FIND ]------------------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_ACTIVEPORTAL" => $lang['activeportal'],
#
#-----[ FIND ]------------------------------------------
#
"PRUNE_YES" => $prune_yes,
"PRUNE_NO" => $prune_no,
#
#-----[ AFTER, ADD ]------------------------------------------
#
"ACTIVEPORTAL_YES" => $activeportal_yes,
"ACTIVEPORTAL_NO" => $activeportal_no,
#
#-----[ OPEN ]------------------------------------------
#
templates/fisubsilversh/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#
 
   <td class="row1">{L_DISABLE_BOARD_MSG}<br /><span class="gensmall">{L_DISABLE_BOARD_MSG_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" maxlength="255" size="40" name="board_disable_msg" value="{DISABLE_BOARD_MSG}" /></td></td>
</tr>

   
   
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1">{L_ACTIVEPORTAL}</td>
      <td class="row2"><input type="radio" name="activeportal" value="1" {ACTIVEPORTAL_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="activeportal" value="0" {ACTIVEPORTAL_NO} /> {L_NO}</td>
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Board_disable'] =
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['activeportal'] = "Ativar Portal?";
#
#-----[ OPEN ]------------------------------------------
#
portal.php
#
#-----[ FIND ]------------------------------------------
#
// Read Portal Configuration from DB
$portal_config = array();
$sql = "SELECT * FROM " . PORTAL_TABLE;

if( !($result = $db->sql_query($sql)) )
{
   message_die(CRITICAL_ERROR, "Could not query portal config information", "", __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#

if( !$board_config['activeportal'] )
{
   redirect(append_sid("./index.$phpEx"));
}
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM


cumps
Offline

+speed 
Membro
Mensagens 544 Gostos 0
Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2 Level 1

muito boa, principalmente pá malta que usa o phpBB2 Plus e que não teve oportunidade de escolha se queria ou não o portal

qual o nome desse mod. alguém sabe?? é que em principio vou tirar o portal e isto ajuda :wink:
Offline

[PT]Boy 
Membro
Mensagens 341 Gostos 0
Troféus totais: 24
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

nao ah um exemplo do tipo de portal que é ?