mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
some changes for proper code documentation
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8783 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d7fa3f83ce
commit
4d7b9b76fa
6 changed files with 68 additions and 67 deletions
|
@ -685,7 +685,7 @@ inherit_from = {INHERIT_FROM}
|
|||
{
|
||||
trigger_error($user->lang['EDITOR_DISABLED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
|
||||
$this->page_title = 'EDIT_TEMPLATE';
|
||||
|
||||
$filelist = $filelist_cats = array();
|
||||
|
@ -698,7 +698,7 @@ inherit_from = {INHERIT_FROM}
|
|||
|
||||
// make sure template_file path doesn't go upwards
|
||||
$template_file = str_replace('..', '.', $template_file);
|
||||
|
||||
|
||||
// Retrieve some information about the template
|
||||
$sql = 'SELECT template_storedb, template_path, template_name
|
||||
FROM ' . STYLES_TEMPLATE_TABLE . "
|
||||
|
@ -711,7 +711,7 @@ inherit_from = {INHERIT_FROM}
|
|||
{
|
||||
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
if ($save_changes && !check_form_key('acp_styles'))
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
|
@ -998,17 +998,17 @@ inherit_from = {INHERIT_FROM}
|
|||
$ids[] = $template_row['template_inherits_id'];
|
||||
}
|
||||
$ids[] = $template_row['template_id'];
|
||||
|
||||
|
||||
$filemtime = array();
|
||||
$file_template_db = array();
|
||||
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$sql = 'SELECT template_filename, template_mtime
|
||||
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
|
||||
WHERE template_id = $id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$filemtime[$row['template_filename']] = $row['template_mtime'];
|
||||
|
@ -1024,22 +1024,22 @@ inherit_from = {INHERIT_FROM}
|
|||
foreach ($file_ary as $file)
|
||||
{
|
||||
$file = str_replace('/', '.', $file);
|
||||
|
||||
|
||||
// perform some dirty guessing to get the path right.
|
||||
// We assume that three dots in a row were '../'
|
||||
$tpl_file = str_replace('.', '/', $file);
|
||||
$tpl_file = str_replace('///', '../', $tpl_file);
|
||||
|
||||
|
||||
$filename = "{$cache_prefix}_$file.html.$phpEx";
|
||||
|
||||
if (!file_exists("{$phpbb_root_path}cache/$filename"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$file_tpl = "{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html";
|
||||
$inherited = false;
|
||||
|
||||
|
||||
if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
|
||||
{
|
||||
if (!$template_row['template_storedb'])
|
||||
|
@ -1059,7 +1059,7 @@ inherit_from = {INHERIT_FROM}
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$template->assign_block_vars('file', array(
|
||||
'U_VIEWSOURCE' => $this->u_action . "&action=cache&id=$template_id&source=$file",
|
||||
|
@ -1103,7 +1103,7 @@ inherit_from = {INHERIT_FROM}
|
|||
|
||||
// make sure theme_file path doesn't go upwards
|
||||
$theme_file = str_replace('..', '.', $theme_file);
|
||||
|
||||
|
||||
// Retrieve some information about the theme
|
||||
$sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data
|
||||
FROM ' . STYLES_THEME_TABLE . "
|
||||
|
@ -1284,7 +1284,7 @@ inherit_from = {INHERIT_FROM}
|
|||
$imgsize = request_var('imgsize', false);
|
||||
$imgwidth = request_var('imgwidth', 0);
|
||||
$imgheight = request_var('imgheight', 0);
|
||||
|
||||
|
||||
$imgname = preg_replace('#[^a-z0-9\-+_]#i', '', $imgname);
|
||||
$imgpath = str_replace('..', '.', $imgpath);
|
||||
|
||||
|
@ -1580,7 +1580,7 @@ inherit_from = {INHERIT_FROM}
|
|||
{
|
||||
$msg .= '<br />' . $values['template_name'];
|
||||
}
|
||||
|
||||
|
||||
trigger_error($msg . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
@ -2162,14 +2162,14 @@ inherit_from = {INHERIT_FROM}
|
|||
$style_default = request_var('style_default', 0);
|
||||
$store_db = request_var('store_db', 0);
|
||||
|
||||
$sql = "SELECT {$mode}_id
|
||||
$sql = "SELECT {$mode}_id
|
||||
FROM $sql_from
|
||||
WHERE {$mode}_id <> $style_id
|
||||
WHERE {$mode}_id <> $style_id
|
||||
AND {$mode}_name = '" . $db->sql_escape(strtolower($name)) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$conflict = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
if ($mode == 'style' && (!$template_id || !$theme_id || !$imageset_id))
|
||||
{
|
||||
$error[] = $user->lang['STYLE_ERR_NO_IDS'];
|
||||
|
@ -2207,7 +2207,7 @@ inherit_from = {INHERIT_FROM}
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
// Check length settings
|
||||
|
@ -2374,8 +2374,8 @@ inherit_from = {INHERIT_FROM}
|
|||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($mode == 'template')
|
||||
{
|
||||
$super = array();
|
||||
|
@ -3116,7 +3116,7 @@ inherit_from = {INHERIT_FROM}
|
|||
|
||||
// we parse the cfg here (again)
|
||||
$cfg_data = parse_cfg_file("$root_path$mode/$mode.cfg");
|
||||
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'template':
|
||||
|
@ -3157,7 +3157,7 @@ inherit_from = {INHERIT_FROM}
|
|||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
|
||||
if ($row)
|
||||
{
|
||||
|
@ -3197,7 +3197,7 @@ inherit_from = {INHERIT_FROM}
|
|||
$inherit_id = 0;
|
||||
$inherit_path = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (sizeof($error))
|
||||
{
|
||||
|
@ -3378,11 +3378,11 @@ inherit_from = {INHERIT_FROM}
|
|||
// Return store_db in case it had to be altered
|
||||
return $store_db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks downwards dependencies
|
||||
*
|
||||
* @visibility public
|
||||
* @access public
|
||||
* @param string $mode The element type to check - only template is supported
|
||||
* @param int $id The template id
|
||||
* @returns false if no component inherits, array with name, path and id for each subtemplate otherwise
|
||||
|
@ -3390,7 +3390,7 @@ inherit_from = {INHERIT_FROM}
|
|||
function check_inheritance($mode, $id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
$l_type = strtoupper($mode);
|
||||
|
||||
switch ($mode)
|
||||
|
@ -3413,10 +3413,10 @@ inherit_from = {INHERIT_FROM}
|
|||
WHERE {$mode}_inherits_id = " . (int) $id;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$names = array();
|
||||
$names = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
||||
|
||||
$names[$row["{$mode}_id"]] = array(
|
||||
"{$mode}_id" => $row["{$mode}_id"],
|
||||
"{$mode}_name" => $row["{$mode}_name"],
|
||||
|
@ -3434,11 +3434,11 @@ inherit_from = {INHERIT_FROM}
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks upwards dependencies
|
||||
*
|
||||
* @visibility public
|
||||
* @access public
|
||||
* @param string $mode The element type to check - only template is supported
|
||||
* @param int $id The template id
|
||||
* @returns false if the component does not inherit, array with name, path and id otherwise
|
||||
|
@ -3446,7 +3446,7 @@ inherit_from = {INHERIT_FROM}
|
|||
function get_super($mode, $id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
$l_type = strtoupper($mode);
|
||||
|
||||
switch ($mode)
|
||||
|
@ -3463,13 +3463,13 @@ inherit_from = {INHERIT_FROM}
|
|||
$sql_from = STYLES_IMAGESET_TABLE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT {$mode}_inherits_id
|
||||
|
||||
|
||||
$sql = "SELECT {$mode}_inherits_id
|
||||
FROM $sql_from
|
||||
WHERE {$mode}_id = " . (int) $id;
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -3478,10 +3478,10 @@ inherit_from = {INHERIT_FROM}
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$super_id = $row["{$mode}_inherits_id"];
|
||||
|
||||
$sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
|
||||
|
||||
$sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
|
||||
FROM $sql_from
|
||||
WHERE {$mode}_id = " . (int) $super_id;
|
||||
|
||||
|
@ -3491,21 +3491,21 @@ inherit_from = {INHERIT_FROM}
|
|||
$db->sql_freeresult($result);
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moves a template set and its subtemplates to the database
|
||||
*
|
||||
* @visibility public
|
||||
* @access public
|
||||
* @param string $mode The component to move - only template is supported
|
||||
* @param int $id The template id
|
||||
*/
|
||||
function store_in_db($mode, $id)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
|
||||
$error = array();
|
||||
$l_type = strtoupper($mode);
|
||||
if ($super = $this->get_super($mode, $id))
|
||||
|
@ -3513,9 +3513,9 @@ inherit_from = {INHERIT_FROM}
|
|||
$error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
|
||||
FROM " . STYLES_TEMPLATE_TABLE . '
|
||||
FROM " . STYLES_TEMPLATE_TABLE . '
|
||||
WHERE template_id = ' . (int) $id;
|
||||
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
@ -3540,14 +3540,14 @@ inherit_from = {INHERIT_FROM}
|
|||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moves a template set to the database
|
||||
*
|
||||
* @visibility private
|
||||
* @access private
|
||||
* @param string $mode The component to move - only template is supported
|
||||
* @param int $id The template id
|
||||
* @param string $path TThe path to the template files
|
||||
|
@ -3555,28 +3555,28 @@ inherit_from = {INHERIT_FROM}
|
|||
function _store_in_db($mode, $id, $path)
|
||||
{
|
||||
global $phpbb_root_path, $db;
|
||||
|
||||
|
||||
$filelist = filelist("{$phpbb_root_path}styles/{$path}/template", '', 'html');
|
||||
$this->store_templates('insert', $id, $path, $filelist);
|
||||
|
||||
|
||||
// Okay, we do the query here -shouldn't be triggered often.
|
||||
$sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . '
|
||||
SET template_storedb = 1
|
||||
WHERE template_id = ' . $id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moves a template set and its subtemplates to the filesystem
|
||||
*
|
||||
* @visibility public
|
||||
* @access public
|
||||
* @param string $mode The component to move - only template is supported
|
||||
* @param int $id The template id
|
||||
*/
|
||||
function store_in_fs($mode, $id)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
|
||||
$error = array();
|
||||
$l_type = strtoupper($mode);
|
||||
if ($super = $this->get_super($mode, $id))
|
||||
|
@ -3584,7 +3584,7 @@ inherit_from = {INHERIT_FROM}
|
|||
$error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
|
||||
return($error);
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
|
||||
FROM " . STYLES_TEMPLATE_TABLE . '
|
||||
WHERE template_id = ' . (int) $id;
|
||||
|
@ -3596,9 +3596,9 @@ inherit_from = {INHERIT_FROM}
|
|||
if (!sizeof($error))
|
||||
{
|
||||
$subs = $this->check_inheritance($mode, $id);
|
||||
|
||||
|
||||
$this->_store_in_fs($mode, $id, $row["{$mode}_path"]);
|
||||
|
||||
|
||||
if ($subs && sizeof($subs))
|
||||
{
|
||||
foreach ($subs as $sub_id => $sub)
|
||||
|
@ -3615,11 +3615,11 @@ inherit_from = {INHERIT_FROM}
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moves a template set to the filesystem
|
||||
*
|
||||
* @visibility private
|
||||
* @access private
|
||||
* @param string $mode The component to move - only template is supported
|
||||
* @param int $id The template id
|
||||
* @param string $path The path to the template
|
||||
|
@ -3627,7 +3627,7 @@ inherit_from = {INHERIT_FROM}
|
|||
function _store_in_fs($mode, $id, $path)
|
||||
{
|
||||
global $phpbb_root_path, $db, $user, $safe_mode;
|
||||
|
||||
|
||||
$store_db = 0;
|
||||
$error = array();
|
||||
if (!$safe_mode && @is_writable("{$phpbb_root_path}styles/{$path}/template"))
|
||||
|
@ -3666,7 +3666,7 @@ inherit_from = {INHERIT_FROM}
|
|||
SET template_storedb = 0
|
||||
WHERE template_id = ' . $id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -593,7 +593,7 @@ class phpbb_db_tools
|
|||
|
||||
/**
|
||||
* Private method for performing sql statements (either execute them or return them)
|
||||
* @private
|
||||
* @access private
|
||||
*/
|
||||
function _sql_run_sql($statements)
|
||||
{
|
||||
|
@ -624,7 +624,7 @@ class phpbb_db_tools
|
|||
|
||||
/**
|
||||
* Function to prepare some column information for better usage
|
||||
* @private
|
||||
* @access private
|
||||
*/
|
||||
function sql_prepare_column_data($table_name, $column_name, $column_data)
|
||||
{
|
||||
|
|
|
@ -2228,7 +2228,7 @@ function generate_link_hash($link_name)
|
|||
|
||||
/**
|
||||
* checks a link hash - for GET requests
|
||||
* @param string $token the submitted token
|
||||
* @param string $token the submitted token
|
||||
* @param string $link_name The name of the link
|
||||
* @return boolean true if all is fine
|
||||
*/
|
||||
|
|
|
@ -263,7 +263,8 @@ class filespec
|
|||
*
|
||||
* @param string $destination_path Destination path, for example $config['avatar_path']
|
||||
* @param bool $overwrite If set to true, an already existing file will be overwritten
|
||||
* @param string $chmod Permission mask for chmodding the file after a successful move. The mode entered here reflects the mode of {@inline phpbb_chmod()}
|
||||
* @param string $chmod Permission mask for chmodding the file after a successful move. The mode entered here reflects the mode defined by {@link phpbb_chmod()}
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)
|
||||
|
|
|
@ -147,7 +147,7 @@ function user_update_name($old_name, $new_name)
|
|||
*
|
||||
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
|
||||
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
|
||||
* @return: the new user's ID.
|
||||
* @return the new user's ID.
|
||||
*/
|
||||
function user_add($user_row, $cp_data = false)
|
||||
{
|
||||
|
@ -2314,7 +2314,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . (($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id']);
|
||||
|
@ -3087,7 +3087,7 @@ function group_validate_groupname($group_id, $group_name)
|
|||
/**
|
||||
* Set users default group
|
||||
*
|
||||
* @private
|
||||
* @access private
|
||||
*/
|
||||
function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
|
||||
{
|
||||
|
|
|
@ -391,7 +391,7 @@ class bbcode_firstpass extends bbcode
|
|||
|
||||
/**
|
||||
* Parse code text from code tag
|
||||
* @private
|
||||
* @access private
|
||||
*/
|
||||
function bbcode_parse_code($stx, &$code)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue