1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +02:00

Obsolete template parsing method removed, FPW template improvements

This commit is contained in:
secretr
2011-07-22 12:33:55 +00:00
parent 7bc26e7ad5
commit 3f4dd7a25c
2 changed files with 42 additions and 41 deletions

View File

@@ -10,7 +10,7 @@ if(!isset($FPW_TABLE))
{
$FPW_TABLE = "
<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<form method='post' action='".SITEURL."fpw.php'>
<table style='".USER_WIDTH."' class='fborder'>
<tr>
@@ -37,7 +37,8 @@ if(!isset($FPW_TABLE))
</td>
</tr>";
if($FPW_TABLE_SECIMG_SECIMG){
if(deftrue('USE_IMAGECODE'))
{
$FPW_TABLE .= "
<tr>
<td class='forumheader3' style='width:25%'>{FPW_TABLE_SECIMG_LAN}</td>
@@ -65,7 +66,7 @@ if(!isset($FPW_TABLE_HEADER))
$FPW_TABLE_HEADER = "
<div style='width:100%;text-align:center;margin-left:auto;margin-right:auto'>
<div style='width:70%;margin-left:auto;margin-right:auto;text-align:center;'><br />
".(file_exists(THEME."images/login_logo.png") ? "<img src='".THEME."images/login_logo.png' alt='' />\n" : "<img src='".e_IMAGE."logo.png' alt='' />\n")."
{FPW_LOGIN_LOGO}
<br />";
}
// ##### ------------------------------------------------------------------------------------------

32
fpw.php
View File

@@ -14,6 +14,7 @@
*/
require_once('class2.php');
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
$tp = e107::getParser();
if (USER)
{
@@ -36,12 +37,15 @@ else
if ($pref['membersonly_enabled'])
{
if (!$FPW_TABLE_HEADER)
$sc = array (
'FPW_LOGIN_LOGO' => file_exists(THEME."images/login_logo.png") ? "<img src='".THEME_ABS."images/login_logo.png' alt='' />\n" : "<img src='".e_IMAGE_ABS."logo.png' alt='' />\n"
);
//if (!$FPW_TABLE_HEADER)
{
require_once (e107::coreTemplatePath('fpw')); //correct way to load a core template.
}
$HEADER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_HEADER);
$FOOTER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_FOOTER);
$HEADER = $tp->simpleParse($FPW_TABLE_HEADER, $sc);
$FOOTER = $tp->simpleParse($FPW_TABLE_FOOTER, $sc);
}
$user_info = e107::getUserSession();
@@ -208,26 +212,22 @@ if (isset($_POST['pwsubmit']))
}
$sc = array();
if (USE_IMAGECODE)
{
$FPW_TABLE_SECIMG_LAN = LAN_FPW2;
$FPW_TABLE_SECIMG_HIDDEN = "<input type='hidden' name='rand_num' value='".$sec_img->random_number."' />";
$FPW_TABLE_SECIMG_SECIMG = $sec_img->r_image();
$FPW_TABLE_SECIMG_TEXTBOC = "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20' />";
$sc = array (
'FPW_TABLE_SECIMG_LAN' => LAN_FPW2,
'FPW_TABLE_SECIMG_HIDDEN' => "<input type='hidden' name='rand_num' value='".$sec_img->random_number."' />",
'FPW_TABLE_SECIMG_SECIMG' => $sec_img->r_image(),
'FPW_TABLE_SECIMG_TEXTBOC' => "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20' />"
);
}
if (!$FPW_TABLE)
{
if (file_exists(THEME.'fpw_template.php'))
{
require_once(THEME.'fpw_template.php');
require_once (e107::coreTemplatePath('fpw')); //correct way to load a core template.
}
else
{
require_once(e_THEME.'templates/fpw_template.php');
}
}
$text = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE);
$text = $tp->simpleParse($FPW_TABLE, $sc);
$ns->tablerender(LAN_03, $text);
require_once(FOOTERF);