some fixes

git-svn-id: file:///svn/phpbb/trunk@7286 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-04-06 14:03:20 +00:00
parent 088c6e1c3e
commit ba536c6270
11 changed files with 75 additions and 40 deletions

View file

@ -6,7 +6,7 @@
/* *\
/* ********************************************************************** *\
Please see: http://www.phpbb.com/about/ for a list of all the people currently
Please see: http://www.phpbb.com/about/team/ for a list of all the people currently
involved in phpBB.
phpBB Project Manager : theFinn (James Atkinson)

View file

@ -558,6 +558,7 @@ class acp_groups
'S_RANK_OPTIONS' => $rank_options,
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
'AVATAR' => $avatar_img,
'AVATAR_IMAGE' => $avatar_img,
'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',

View file

@ -287,24 +287,26 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{
foreach ($subforums[$forum_id] as $subforum_id => $subforum_row)
{
// Update unread information if needed
if (!$forum_unread)
{
$forum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false;
}
$subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false;
if ($subforum_row['display'] && $subforum_row['name'])
{
$subforums_list[] = array(
'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
'name' => $subforum_row['name'],
'unread' => $forum_unread,
'unread' => $subforum_unread,
);
}
else
{
unset($subforums[$forum_id][$subforum_id]);
}
// If one subforum is unread the forum gets unread too...
if ($subforum_unread)
{
$forum_unread = true;
}
}
$l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': ';

View file

@ -54,7 +54,7 @@ class template_compile
* Load template source from file
* @access private
*/
function _tpl_load_file($handle)
function _tpl_load_file($handle, $store_in_db = false)
{
// Try and open template for read
if (!file_exists($this->template->files[$handle]))
@ -66,6 +66,23 @@ class template_compile
// Actually compile the code now.
$this->compile_write($handle, $this->template->compiled_code[$handle]);
// Store in database if required...
if ($store_in_db)
{
global $db, $user;
$sql_ary = array(
'template_id' => $user->theme['template_id'],
'template_filename' => $this->template->filename[$handle],
'template_included' => '',
'template_mtime' => time(),
'template_data' => trim(@file_get_contents($this->template->files[$handle])),
);
$sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
}
/**

View file

@ -222,44 +222,56 @@ class template
if (isset($user->theme['template_storedb']) && $user->theme['template_storedb'])
{
$sql = 'SELECT * FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
$sql = 'SELECT *
FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
WHERE template_id = ' . $user->theme['template_id'] . "
AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
OR template_included LIKE '%" . $db->sql_escape($this->filename[$handle]) . ":%')";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
while ($row = $db->sql_fetchrow($result))
if ($row)
{
if ($row['template_mtime'] < filemtime($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
do
{
if ($row['template_mtime'] < filemtime($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
{
if ($row['template_filename'] == $this->filename[$handle])
{
$compile->_tpl_load_file($handle);
}
else
{
$this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename'];
$compile->_tpl_load_file($row['template_filename']);
unset($this->compiled_code[$row['template_filename']]);
unset($this->files[$row['template_filename']]);
}
}
if ($row['template_filename'] == $this->filename[$handle])
{
$compile->_tpl_load_file($handle);
$this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
$compile->compile_write($handle, $this->compiled_code[$handle]);
}
else
{
$this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename'];
$compile->_tpl_load_file($row['template_filename']);
unset($this->compiled_code[$row['template_filename']]);
unset($this->files[$row['template_filename']]);
}
}
if ($row['template_filename'] == $this->filename[$handle])
{
$this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
$compile->compile_write($handle, $this->compiled_code[$handle]);
}
else
{
// Only bother compiling if it doesn't already exist
if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
{
$this->filename[$row['template_filename']] = $row['template_filename'];
$compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
unset($this->filename[$row['template_filename']]);
// Only bother compiling if it doesn't already exist
if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
{
$this->filename[$row['template_filename']] = $row['template_filename'];
$compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
unset($this->filename[$row['template_filename']]);
}
}
}
while ($row = $db->sql_fetchrow($result));
}
else
{
// Try to load from filesystem and instruct to insert into the styles table...
$compile->_tpl_load_file($handle, true);
return false;
}
$db->sql_freeresult($result);

View file

@ -679,6 +679,7 @@ class ucp_groups
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
'S_RANK_OPTIONS' => $rank_options,
'AVATAR' => $avatar_img,
'AVATAR_IMAGE' => $avatar_img,
'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',

View file

@ -272,7 +272,7 @@ $lang = array_merge($lang, array(
// PHP info
$lang = array_merge($lang, array(
'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by <a href="http://www.phpbb.com/about/">official team members</a> on the support forums.',
'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by <a href="http://www.phpbb.com/about/team/">official team members</a> on the support forums.',
'NO_PHPINFO_AVAILABLE' => 'The PHP informations are unable to be determined. Phpinfo() has been disabled for security reasons.',
));

View file

@ -138,11 +138,12 @@
</div>
<!-- ENDIF -->
<!-- IF S_MCP_QUEUE or S_MCP_REPORTS or RETURN_TOPIC -->
<!-- IF S_MCP_QUEUE or S_MCP_REPORT or RETURN_TOPIC -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORTS -->{RETURN_REPORTS}<!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
<p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
<span class="corners-bottom"><span></span></span></div>
</div>

View file

@ -44,7 +44,7 @@
<dl>
<dt><label for="sf1">{L_SEARCH_WITHIN}:</label></dt>
<dd><label for="sf1"><input type="radio" name="sf" id="sf1" value="all" checked="checked" /> {L_SEARCH_TITLE_MSG}</label></dd>
<dd><label for="sf2"><input type="radio" name="sf" id="sf2" value="msgonly" checked="checked" /> {L_SEARCH_MSG_ONLY}</label></dd>
<dd><label for="sf2"><input type="radio" name="sf" id="sf2" value="msgonly" /> {L_SEARCH_MSG_ONLY}</label></dd>
<dd><label for="sf3"><input type="radio" name="sf" id="sf3" value="titleonly" /> {L_SEARCH_TITLE_ONLY}</label></dd>
<dd><label for="sf4"><input type="radio" name="sf" id="sf4" value="firstpost" /> {L_SEARCH_FIRST_POST}</label></dd>
</dl>

View file

@ -9,11 +9,12 @@
<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody">
<!-- IF U_DELETE or U_EDIT or U_QUOTE -->
<ul class="profile-icons">
<!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_EDIT_PM}</span></a></li><!-- ENDIF -->
<!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_PM}</span></a></li><!-- ENDIF -->
<!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_QUOTE_PM}</span></a></li><!-- ENDIF -->
<!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_POST_EDIT_PM}</span></a></li><!-- ENDIF -->
<!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_MESSAGE}</span></a></li><!-- ENDIF -->
<!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_POST_QUOTE_PM}</span></a></li><!-- ENDIF -->
</ul>
<!-- ENDIF -->

View file

@ -45,7 +45,7 @@
<th colspan="2" align="center">{L_POST_DETAILS}</th>
</tr>
<tr>
<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
</tr>
<tr>
<td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td>