Skip to content
This repository has been archived by the owner on Apr 29, 2018. It is now read-only.

Commit

Permalink
Aktualizacja plików MyBB i tłumaczenia dla PPM 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigik committed Feb 27, 2015
1 parent ad11c99 commit bfd5f17
Show file tree
Hide file tree
Showing 190 changed files with 12,771 additions and 10,163 deletions.
9 changes: 4 additions & 5 deletions Upload/admin/inc/class_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ function generate_group_select($name, $selected=array(), $options=array())
}
}

$select .= "<option value=\"{$group['gid']}\"{$selected_add}>".htmlspecialchars_uni(strip_tags($group['title']))."</option>";
$select .= "<option value=\"{$group['gid']}\"{$selected_add}>".htmlspecialchars_uni($group['title'])."</option>";
}

$select .= "</select>";
Expand Down Expand Up @@ -833,7 +833,7 @@ function generate_date_select($name, $day="",$month="",$year="")

$built = $this->generate_select_box($name.'_day', $days, (int)$day, array('id' => $name.'_day'))." &nbsp; ";
$built .= $this->generate_select_box($name.'_month', $months, (int)$month, array('id' => $name.'_month'))." &nbsp; ";
$built .= $this->generate_text_box($name.'_year', (int)$year, array('id' => $name.'_year', 'style' => 'width: 100px;'));
$built .= $this->generate_numeric_field($name.'_year', $year, array('id' => $name.'_year', 'style' => 'width: 100px;', 'min' => 0));
return $built;
}

Expand Down Expand Up @@ -894,7 +894,7 @@ class DefaultFormContainer
/**
* Initialise the new form container.
*
* @param string The title of the forum container
* @param string The title of the form container
* @param string An additional class to apply if we have one.
*/
function __construct($title='', $extra_class='')
Expand Down Expand Up @@ -1050,5 +1050,4 @@ function end($return=false)
echo $this->_container->output($this->_title, 1, "general form_container {$this->extra_class}", false);
}
}
}

}
76 changes: 70 additions & 6 deletions Upload/admin/inc/class_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function output_header($title="")
echo " <title>".$title."</title>\n";
echo " <meta name=\"author\" content=\"MyBB Group\" />\n";
echo " <meta name=\"copyright\" content=\"Copyright ".COPY_YEAR." MyBB Group.\" />\n";
echo " <link rel=\"stylesheet\" href=\"styles/".$this->style."/main.css\" type=\"text/css\" />\n";
echo " <link rel=\"stylesheet\" href=\"styles/".$this->style."/main.css?ver=1804\" type=\"text/css\" />\n";
echo " <link rel=\"stylesheet\" href=\"styles/".$this->style."/modal.css\" type=\"text/css\" />\n";

// Load stylesheet for this module if it has one
Expand All @@ -115,7 +115,7 @@ function output_header($title="")
echo " <link rel=\"stylesheet\" href=\"jscripts/jqueryui/css/redmond/jquery-ui.min.css\" />\n";
echo " <link rel=\"stylesheet\" href=\"jscripts/jqueryui/css/redmond/jquery-ui.structure.min.css\" />\n";
echo " <link rel=\"stylesheet\" href=\"jscripts/jqueryui/css/redmond/jquery-ui.theme.min.css\" />\n";
echo " <script src=\"jscripts/jqueryui/js/jquery-ui.min.js\"></script>\n";
echo " <script src=\"jscripts/jqueryui/js/jquery-ui.min.js?ver=1804\"></script>\n";

// Stop JS elements showing while page is loading (JS supported browsers only)
echo " <style type=\"text/css\">.popup_button { display: none; } </style>\n";
Expand Down Expand Up @@ -505,6 +505,69 @@ function show_login($message="", $class="success")
exit;
}

function show_2fa()
{
global $lang, $cp_style, $mybb;

$mybb2fa_page = <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head profile="http://gmpg.org/xfn/1">
<title>{$lang->my2fa}</title>
<meta name="author" content="MyBB Group" />
<meta name="copyright" content="Copyright {$copy_year} MyBB Group." />
<link rel="stylesheet" href="./styles/{$cp_style}/login.css" type="text/css" />
<script type="text/javascript" src="../jscripts/jquery.js"></script>
<script type="text/javascript" src="../jscripts/general.js"></script>
<script type="text/javascript" src="./jscripts/admincp.js"></script>
<script type="text/javascript">
//<![CDATA[
loading_text = '{$lang->loading_text}';
//]]>
</script>
</head>
<body>
<div id="container">
<div id="header">
<div id="logo">
<h1><a href="../" title="{$lang->return_to_forum}"><span class="invisible">{$lang->mybb_acp}</span></a></h1>
</div>
</div>
<div id="content">
<h2>{$lang->my2fa}</h2>
EOF;
// Make query string nice and pretty so that user can go to his/her preferred destination
$query_string = '';
if($_SERVER['QUERY_STRING'])
{
$query_string = '?'.preg_replace('#adminsid=(.{32})#i', '', $_SERVER['QUERY_STRING']);
$query_string = preg_replace('#my_post_key=(.{32})#i', '', $query_string);
$query_string = str_replace('action=logout', '', $query_string);
$query_string = preg_replace('#&+#', '&', $query_string);
$query_string = str_replace('?&', '?', $query_string);
$query_string = htmlspecialchars_uni($query_string);
}
$mybb2fa_page .= <<<EOF
<p>{$lang->my2fa_code}</p>
<form method="post" action="index.php{$query_string}">
<div class="form_container">
<div class="label"><label for="code">{$lang->my2fa_label}</label></div>
<div class="field"><input type="text" name="code" id="code" class="text_input initial_focus" /></div>
</div>
<p class="submit">
<input type="submit" value="{$lang->login}" />
<input type="hidden" name="do" value="do_2fa" />
</p>
</form>
</div>
</div>
</body>
</html>
EOF;
echo $mybb2fa_page;
exit;
}

/**
* Generate the lockout page
*
Expand Down Expand Up @@ -867,6 +930,7 @@ function build_codebuttons_editor($bind, $editor_language, $smilies)
{
if($smilie['showclickable'] != 0)
{
$smilie['image'] = str_replace("{theme}", "images", $smilie['image']);
$smiliecache[$smilie['find']] = $smilie['image'];
}
}
Expand All @@ -887,8 +951,8 @@ function build_codebuttons_editor($bind, $editor_language, $smilies)
$finds_count = count($finds);

// Only show the first text to replace in the box
$find = htmlspecialchars_uni($finds[0]);
$image = htmlspecialchars_uni($image);
$find = str_replace(array('\\', '"'), array('\\\\', '\"'), htmlspecialchars_uni($finds[0]));
$image = str_replace(array('\\', '"'), array('\\\\', '\"'), htmlspecialchars_uni($image));
if(substr($image, 0, 4) != "http")
{
$image = $mybb->settings['bburl']."/".$image;
Expand All @@ -904,7 +968,7 @@ function build_codebuttons_editor($bind, $editor_language, $smilies)

for($j = 1; $j < $finds_count; ++$j)
{
$find = htmlspecialchars_uni($finds[$j]);
$find = str_replace(array('\\', '"'), array('\\\\', '\"'), htmlspecialchars_uni($finds[$j]));
$hiddensmilies .= '"'.$find.'": "'.$image.'",';
}
++$i;
Expand Down Expand Up @@ -975,7 +1039,7 @@ function build_codebuttons_editor($bind, $editor_language, $smilies)
<script type="text/javascript">
var partialmode = {$mybb->settings['partialmode']},
opt_editor = {
plugins: "bbcode",
plugins: "bbcode,undo",
style: "../jscripts/sceditor/textarea_styles/jquery.sceditor.mybb.css",
rtl: {$lang->settings['rtl']},
locale: "mybblang",
Expand Down
34 changes: 14 additions & 20 deletions Upload/admin/inc/class_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ class DefaultTable
*/
function construct_cell($data, $extra=array())
{
foreach(array('class', 'style', 'id') as $field)
{
// Common-used fields
if(!isset($extra[$field]))
{
$extra[$field] = '';
}
}

$this->_cells[] = array("data" => $data, "extra" => $extra);
}

Expand All @@ -58,19 +49,16 @@ function construct_row($extra = array())
$i = 1;
$cells = '';

foreach(array('class', 'style', 'id', 'rowspan', 'width') as $field)
{
// Common-used fields
if(!isset($extra[$field]))
{
$extra[$field] = '';
}
}

// We construct individual cells here
foreach($this->_cells as $key => $cell)
{
$cells .= "\t\t\t<td";

if(!isset($cell['extra']['class']))
{
$cell['extra']['class'] = '';
}

if($key == 0)
{
$cell['extra']['class'] .= " first";
Expand All @@ -85,7 +73,7 @@ function construct_row($extra = array())
$i = 0;
}
$i++;
if(isset($cell['extra']['class']))
if($cell['extra']['class'])
{
$cells .= " class=\"".trim($cell['extra']['class'])."\"";
}
Expand Down Expand Up @@ -258,10 +246,16 @@ function construct_html($heading="", $border=1, $class=null, $table_id="")
foreach($this->_rows as $key => $table_row)
{
$table .= "\t\t<tr";
if($table_row['extra']['id'])
if(isset($table_row['extra']['id']))
{
$table .= " id=\"{$table_row['extra']['id']}\"";
}

if(!isset($table_row['extra']['class']))
{
$table_row['extra']['class'] = '';
}

if($key == 0)
{
$table_row['extra']['class'] .= " first";
Expand Down
8 changes: 4 additions & 4 deletions Upload/admin/inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function log_admin_action()
"dateline" => TIME_NOW,
"module" => $db->escape_string($mybb->get_input('module')),
"action" => $db->escape_string($mybb->get_input('action')),
"data" => $db->escape_string(@serialize($data))
"data" => $db->escape_string(@my_serialize($data))
);

$db->insert_query("adminlog", $log_entry);
Expand Down Expand Up @@ -70,7 +70,7 @@ function update_admin_session($name, $value)

$admin_session['data'][$name] = $value;
$updated_session = array(
"data" => $db->escape_string(@serialize($admin_session['data']))
"data" => $db->escape_string(@my_serialize($admin_session['data']))
);
$db->update_query("adminsessions", $updated_session, "sid='{$admin_session['sid']}'");
}
Expand Down Expand Up @@ -234,7 +234,7 @@ function save_quick_perms($fid)
$field_list = $db->show_fields_from("forumpermissions");
foreach($field_list as $field)
{
if(strpos($field['Field'], 'can') !== false)
if(strpos($field['Field'], 'can') !== false || strpos($field['Field'], 'mod') !== false)
{
$permission_fields[$field['Field']] = 1;
}
Expand Down Expand Up @@ -579,7 +579,7 @@ function change_admin_permission($tab, $page="", $default=1)
}
}

$db->update_query("adminoptions", array('permissions' => $db->escape_string(serialize($adminoption['permissions']))), "uid='{$adminoption['uid']}'");
$db->update_query("adminoptions", array('permissions' => $db->escape_string(my_serialize($adminoption['permissions']))), "uid='{$adminoption['uid']}'");
}
}

Expand Down
44 changes: 15 additions & 29 deletions Upload/admin/inc/functions_themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function import_theme_xml($xml, $options=array())
else
{
$db->delete_query("themestylesheets", "tid='{$options['tid']}'");
$db->update_query("themes", array("properties" => $db->escape_string(serialize($properties))), "tid='{$options['tid']}'");
$db->update_query("themes", array("properties" => $db->escape_string(my_serialize($properties))), "tid='{$options['tid']}'");
$theme_id = $options['tid'];
}

Expand Down Expand Up @@ -327,7 +327,7 @@ function import_theme_xml($xml, $options=array())
}
// Now we have our list of built stylesheets, save them
$updated_theme = array(
"stylesheets" => $db->escape_string(serialize($theme_stylesheets))
"stylesheets" => $db->escape_string(my_serialize($theme_stylesheets))
);

if(is_array($properties['disporder']))
Expand All @@ -344,7 +344,7 @@ function import_theme_xml($xml, $options=array())
}

$properties['disporder'] = $orders;
$updated_theme['properties'] = $db->escape_string(serialize($properties));
$updated_theme['properties'] = $db->escape_string(my_serialize($properties));
}

$db->update_query("themes", $updated_theme, "tid='{$theme_id}'");
Expand Down Expand Up @@ -441,27 +441,8 @@ function cache_stylesheet($tid, $filename, $stylesheet)
@fwrite($fp_min, $stylesheet_min);
@fclose($fp_min);

if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))
{
$cdn_path = rtrim($mybb->settings['cdnpath'], '/\\');
$cache_themes_dir = $cdn_path . '/' . $theme_directory;

$copy_to_cdn = true;

if(!is_dir($cache_themes_dir))
{
if(!@mkdir($cache_themes_dir))
{
$copy_to_cdn = false;
}
}

if($copy_to_cdn)
{
@copy(MYBB_ROOT . "{$theme_directory}/{$filename}", "{$cache_themes_dir}/{$filename}");
@copy(MYBB_ROOT . "{$theme_directory}/{$filename_min}", "{$cache_themes_dir}/{$filename_min}");
}
}
copy_file_to_cdn(MYBB_ROOT . "{$theme_directory}/{$filename}");
copy_file_to_cdn(MYBB_ROOT . "{$theme_directory}/{$filename_min}");

return "{$theme_directory}/{$filename}";
}
Expand Down Expand Up @@ -634,9 +615,9 @@ function build_new_theme($name, $properties=null, $parent=1)
}
if(!empty($stylesheets))
{
$updated_theme['stylesheets'] = $db->escape_string(serialize($stylesheets));
$updated_theme['stylesheets'] = $db->escape_string(my_serialize($stylesheets));
}
$updated_theme['properties'] = $db->escape_string(serialize($properties));
$updated_theme['properties'] = $db->escape_string(my_serialize($properties));

if(count($updated_theme) > 0)
{
Expand Down Expand Up @@ -922,7 +903,7 @@ function copy_stylesheet_to_theme($stylesheet, $tid)

function update_theme_stylesheet_list($tid, $theme = false, $update_disporders = true)
{
global $db, $cache;
global $mybb, $db, $cache, $plugins;

$stylesheets = array();

Expand Down Expand Up @@ -984,6 +965,11 @@ function update_theme_stylesheet_list($tid, $theme = false, $update_disporders =
}
}
}

if(is_object($plugins))
{
$plugins->run_hooks('update_theme_stylesheet_list_set_css_url', $css_url);
}

$attachedto = $stylesheet['attachedto'];
if(!$attachedto)
Expand Down Expand Up @@ -1021,7 +1007,7 @@ function update_theme_stylesheet_list($tid, $theme = false, $update_disporders =

// Now we have our list of built stylesheets, save them
$updated_theme = array(
"stylesheets" => $db->escape_string(serialize($theme_stylesheets))
"stylesheets" => $db->escape_string(my_serialize($theme_stylesheets))
);

// Do we have a theme present? If so, update the stylesheet display orders
Expand Down Expand Up @@ -1072,7 +1058,7 @@ function update_theme_stylesheet_list($tid, $theme = false, $update_disporders =

asort($orders);
$properties['disporder'] = $orders;
$updated_theme['properties'] = $db->escape_string(serialize($properties));
$updated_theme['properties'] = $db->escape_string(my_serialize($properties));
}

$db->update_query("themes", $updated_theme, "tid = '{$tid}'");
Expand Down
Loading

0 comments on commit bfd5f17

Please sign in to comment.