← SMF

Ajudinha com PHP

Lida 1333 vezes

Offline

CasaTuga 
Membro
Mensagens 397 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Avatar Tenth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Alguem me dá uma mãosinha com PHP ??


Queria fazer um "if página do Portal"
e carregava o ficheiro 1

else
carregar ficheiro 2

Para carregar um ficheiro de template ligeiramente alterado....



Aqui fica (parte) do meu  index do fórum SMF, com Portal em TP

Código: [Seleccione]
// Action and board are both empty... maybe the portal page?
if (empty($board) && empty($topic) && $settings['TPortal_front_type']!='boardindex')
{
require_once($sourcedir . '/TPortal.php');
return 'TPortal';
}
if (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex' && (isset($_GET['cat']) || isset($_GET['page'])))
{
require_once($sourcedir . '/TPortal.php');
return 'TPortal';
}
// Action and board are still both empty...and no portal startpage - BoardIndex!
elseif (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex')
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}
// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
}
// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir . '/Display.php');
return 'Display';
}
}