Zeile 168 | Zeile 168 |
---|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
$contents = fetch_remote_file("http://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);
| $contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);
|
if(!$contents) {
| if(!$contents) {
|
Zeile 214 | Zeile 214 |
---|
); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
$table->construct_cell("<img src=\"http://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));
| $table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));
|
$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");
|
$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");
|
$table->construct_cell("<strong><a href=\"http://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
| $table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center"));
|
$table->construct_row(); } }
| $table->construct_row(); } }
|
Zeile 286 | Zeile 286 |
---|
// Recommended themes = Default; Otherwise search results & pagination if($mybb->request_method == "post") {
|
// Recommended themes = Default; Otherwise search results & pagination if($mybb->request_method == "post") {
|
$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));
| $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));
|
} else {
|
} else {
|
$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));
| $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));
|
}
echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&action=browse{$keywords}&page={page}");
| }
echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&action=browse{$keywords}&page={page}");
|
Zeile 584 | Zeile 584 |
---|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_themes = array();
| $inherited_themes = $theme_stylesheets = array();
|
if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
| if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
|
Zeile 592 | Zeile 592 |
---|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
}
$theme_stylesheets = array();
| |
|
|
if(count($inherited_load) > 0) {
| |
$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 614 | Zeile 609 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; } else
| $filename = $theme_stylesheets[$style['sid']]; } else
|
Zeile 667 | Zeile 662 |
---|
$plugins->run_hooks("admin_style_themes_export_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_themes_export_commit");
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
| $theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
|
Zeile 682 | Zeile 677 |
---|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&action=export");
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&action=export");
|
|
|
$page->output_header("{$lang->themes} - {$lang->export_theme}");
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}",
|
$page->output_header("{$lang->themes} - {$lang->export_theme}");
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}",
|
);
| );
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
| $sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
|
Zeile 699 | Zeile 694 |
---|
'title' => $lang->export_theme, 'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc
|
'title' => $lang->export_theme, 'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc
|
);
| );
|
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme, 'link' => "index.php?module=style-themes&action=duplicate&tid={$mybb->input['tid']}", 'description' => $lang->duplicate_theme_desc );
|
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme, 'link' => "index.php?module=style-themes&action=duplicate&tid={$mybb->input['tid']}", 'description' => $lang->duplicate_theme_desc );
|
|
|
$page->output_nav_tabs($sub_tabs, 'export_theme');
if($errors)
|
$page->output_nav_tabs($sub_tabs, 'export_theme');
if($errors)
|
{
| {
|
$page->output_inline_error($errors); }
| $page->output_inline_error($errors); }
|
Zeile 756 | Zeile 751 |
---|
{ $query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'"); $numthemes = $db->fetch_field($query, 'numthemes');
|
{ $query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'"); $numthemes = $db->fetch_field($query, 'numthemes');
|
|
|
if($numthemes) { $errors[] = $lang->error_theme_already_exists;
| if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
Zeile 766 | Zeile 761 |
---|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
$sid = $properties['sid'];
| $sid = $properties['templateset'];
|
$nprops = null; if($mybb->input['duplicate_templates']) {
| $nprops = null; if($mybb->input['duplicate_templates']) {
|
Zeile 823 | Zeile 818 |
---|
log_admin_action($tid, $theme['tid']);
flash_message($lang->success_duplicated_theme, 'success');
|
log_admin_action($tid, $theme['tid']);
flash_message($lang->success_duplicated_theme, 'success');
|
admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid); } }
| admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid); } }
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->duplicate_theme, "index.php?module=style-themes&action=duplicate&tid={$theme['tid']}");
| $page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->duplicate_theme, "index.php?module=style-themes&action=duplicate&tid={$theme['tid']}");
|
Zeile 871 | Zeile 866 |
---|
$form_container = new FormContainer($lang->duplicate_theme); $form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->input['duplicate_templates'], 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");
|
$form_container = new FormContainer($lang->duplicate_theme); $form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->input['duplicate_templates'], 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
|
$form->output_submit_wrapper($buttons);
$form->end();
|
$form->output_submit_wrapper($buttons);
$form->end();
|
|
|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_style_themes_add");
| if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_style_themes_add");
|
Zeile 899 | Zeile 894 |
---|
{ $errors[] = $lang->error_missing_name; }
|
{ $errors[] = $lang->error_missing_name; }
|
else if(in_array($mybb->input['name'], $themes)) { $errors[] = $lang->error_theme_already_exists; }
| else if(in_array($mybb->input['name'], $themes)) { $errors[] = $lang->error_theme_already_exists; }
|
if(!$errors) { $tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
$plugins->run_hooks("admin_style_themes_add_commit");
|
if(!$errors) { $tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
$plugins->run_hooks("admin_style_themes_add_commit");
|
|
|
// Log admin action
|
// Log admin action
|
log_admin_action(htmlspecialchars_uni($mybb->input['name']), $tid);
| log_admin_action($mybb->input['name'], $tid);
|
flash_message($lang->success_theme_created, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
| flash_message($lang->success_theme_created, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
|
Zeile 919 | Zeile 914 |
---|
}
$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&action=add");
|
}
$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&action=add");
|
|
|
$page->output_header("{$lang->themes} - {$lang->create_new_theme}");
$page->output_nav_tabs($sub_tabs, 'create_theme');
if($errors)
|
$page->output_header("{$lang->themes} - {$lang->create_new_theme}");
$page->output_nav_tabs($sub_tabs, 'create_theme');
if($errors)
|
{
| {
|
$page->output_inline_error($errors); }
| $page->output_inline_error($errors); }
|
Zeile 974 | Zeile 969 |
---|
while($theme2 = $db->fetch_array($query)) { $theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);
|
while($theme2 = $db->fetch_array($query)) { $theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);
|
|
|
if(!$theme2['stylesheets']['inherited'])
|
if(!$theme2['stylesheets']['inherited'])
|
{
| {
|
continue;
|
continue;
|
}
| }
|
$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
|
$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
|
}
| }
|
$inherited_stylesheets = false;
// Are any other themes relying on stylesheets from this theme? Get a list and show an error
| $inherited_stylesheets = false;
// Are any other themes relying on stylesheets from this theme? Get a list and show an error
|
Zeile 997 | Zeile 992 |
---|
$inherited_stylesheets = true; } }
|
$inherited_stylesheets = true; } }
|
} }
| } }
|
if($inherited_stylesheets == true)
|
if($inherited_stylesheets == true)
|
{
| {
|
flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes");
|
flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes");
|
}
| }
|
$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); while($cachefile = $db->fetch_array($query)) { @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
|
$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); while($cachefile = $db->fetch_array($query)) { @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
|
}
| $filename_min = str_replace('.css', '.min.css', $cachefile['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}"); }
|
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");
$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
| @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");
$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
|
Zeile 1019 | Zeile 1017 |
---|
update_theme_stylesheet_list($theme['tid'], $theme, true);
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
update_theme_stylesheet_list($theme['tid'], $theme, true);
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
|
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");
|
$children = make_child_theme_list($theme['tid']); $child_tid = $children[0];
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'");
| $children = (array)make_child_theme_list($theme['tid']); $child_tids = array();
foreach($children as $child_tid) { if($child_tid != 0) { $child_tids[] = $child_tid; } }
if(!empty($child_tids)) { $db->update_query("themes", array('pid' => $theme['pid']), "tid IN (".implode(',', $child_tids).")"); }
|
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
$plugins->run_hooks("admin_style_themes_delete_commit");
// Log admin action
|
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
$plugins->run_hooks("admin_style_themes_delete_commit");
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
flash_message($lang->success_theme_deleted, 'success'); admin_redirect("index.php?module=style-themes");
| flash_message($lang->success_theme_deleted, 'success'); admin_redirect("index.php?module=style-themes");
|
Zeile 1080 | Zeile 1089 |
---|
foreach($colors as $color) {
|
foreach($colors as $color) {
|
$color = explode("=", $color);
$properties['colors'][$color[0]] = $color[1];
| $color = trim($color); if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color)) { $color = explode("=", $color); $properties['colors'][$color[0]] = $color[1]; } else { $errors[] = $lang->sprintf($lang->error_invalid_color, $color); }
|
}
|
}
|
}
| }
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
}
| }
|
$theme_properties = my_unserialize($theme['properties']);
|
$theme_properties = my_unserialize($theme['properties']);
|
if($theme_properties['disporder'])
| if(is_array($theme_properties['disporder']))
|
{ $properties['disporder'] = $theme_properties['disporder'];
|
{ $properties['disporder'] = $theme_properties['disporder'];
|
| } else { $errors[] = $lang->error_no_display_order;
|
}
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups'])) { foreach($mybb->input['allowedgroups'] as $gid)
|
}
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups'])) { foreach($mybb->input['allowedgroups'] as $gid)
|
{
| {
|
if($gid == "all") { $allowedgroups = "all";
| if($gid == "all") { $allowedgroups = "all";
|
Zeile 1136 | Zeile 1156 |
---|
if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
} }
| } }
|
if($update_array['pid']) { $query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");
| if($update_array['pid']) { $query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");
|
Zeile 1155 | Zeile 1175 |
---|
if(!$ts_check) { unset($properties['templateset']);
|
if(!$ts_check) { unset($properties['templateset']);
|
} }
| } }
|
if(!$properties['templateset']) { $errors[] = $lang->error_invalid_templateset;
| if(!$properties['templateset']) { $errors[] = $lang->error_invalid_templateset;
|
Zeile 1171 | Zeile 1191 |
---|
$plugins->run_hooks("admin_style_themes_edit_commit");
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
$plugins->run_hooks("admin_style_themes_edit_commit");
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
| update_theme_stylesheet_list($theme['tid']);
|
if($theme['def'] == 1) {
| if($theme['def'] == 1) {
|
Zeile 1178 | Zeile 1199 |
---|
}
// Log admin action
|
}
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
flash_message($lang->success_theme_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_theme_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 1219 | Zeile 1240 |
---|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_themes = array();
| $inherited_themes = $theme_stylesheets = array();
|
if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
| if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
|
Zeile 1227 | Zeile 1248 |
---|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
}
$theme_stylesheets = array();
| |
|
|
if(count($inherited_load) > 0) {
| |
$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 1338 | Zeile 1354 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; }
| $filename = $theme_stylesheets[$style['sid']]; }
|
Zeile 1355 | Zeile 1371 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; } else
| $filename = $theme_stylesheets[$style['sid']]; } else
|
Zeile 1527 | Zeile 1543 |
---|
echo $form->generate_hidden_field("tid", $theme['tid']); $form_container = new FormContainer($lang->edit_theme_properties); $form_container->output_row($lang->name." <em>*</em>", $lang->name_desc_edit, $form->generate_text_box('name', $theme['name'], array('id' => 'name')), 'name');
|
echo $form->generate_hidden_field("tid", $theme['tid']); $form_container = new FormContainer($lang->edit_theme_properties); $form_container->output_row($lang->name." <em>*</em>", $lang->name_desc_edit, $form->generate_text_box('name', $theme['name'], array('id' => 'name')), 'name');
|
|
|
$options = build_theme_array($theme['tid']); $form_container->output_row($lang->parent_theme." <em>*</em>", $lang->parent_theme_desc, $form->generate_select_box('pid', $options, $theme['pid'], array('id' => 'pid')), 'pid');
| $options = build_theme_array($theme['tid']); $form_container->output_row($lang->parent_theme." <em>*</em>", $lang->parent_theme_desc, $form->generate_select_box('pid', $options, $theme['pid'], array('id' => 'pid')), 'pid');
|
Zeile 1581 | Zeile 1597 |
---|
{ $colors = array('none' => $lang->colors_please_select); $colors = array_merge($colors, $properties['colors']);
|
{ $colors = array('none' => $lang->colors_please_select); $colors = array_merge($colors, $properties['colors']);
|
|
|
$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));
$mybb->input['colors'] = '';
| $color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));
$mybb->input['colors'] = '';
|
Zeile 1595 | Zeile 1611 |
---|
$mybb->input['colors'] .= "{$key}={$color}"; } }
|
$mybb->input['colors'] .= "{$key}={$color}"; } }
|
|
|
$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color'); $form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));
|
$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color'); $form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));
|
|
|
$form_container->end();
$buttons = array();
| $form_container->end();
$buttons = array();
|
Zeile 1608 | Zeile 1624 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "stylesheet_properties") { // Fetch the theme we want to edit this stylesheet in
| if($mybb->input['action'] == "stylesheet_properties") { // Fetch the theme we want to edit this stylesheet in
|
Zeile 1688 | Zeile 1704 |
---|
{ // We have a custom attached file $attached_id = (int)str_replace('attached_', '', $id);
|
{ // We have a custom attached file $attached_id = (int)str_replace('attached_', '', $id);
|
|
|
if($mybb->input['action_'.$attached_id] == 1) { // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
if($mybb->input['action_'.$attached_id] == 1) { // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
}
| }
|
if($actions_list) { $attached_to .= "?".$actions_list;
| if($actions_list) { $attached_to .= "?".$actions_list;
|
Zeile 1702 | Zeile 1718 |
---|
$attached[] = $attached_to; }
|
$attached[] = $attached_to; }
|
} }
| } }
|
else if($mybb->input['attach'] == 2) { if(!is_array($mybb->input['color'])) { $errors[] = $lang->error_no_color_picked;
|
else if($mybb->input['attach'] == 2) { if(!is_array($mybb->input['color'])) { $errors[] = $lang->error_no_color_picked;
|
}
| }
|
else { $attached = $mybb->input['color'];
|
else { $attached = $mybb->input['color'];
|
} }
| } }
|
// Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']), 'attachedto' => $db->escape_string(implode('|', $attached)) );
|
// Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']), 'attachedto' => $db->escape_string(implode('|', $attached)) );
|
if($stylesheet['name'] != $mybb->input['name'])
| if($stylesheet['name'] != $mybb->input['name'])
|
{ $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name'])); }
$db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
|
{ $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name'])); }
$db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
|
|
|
// If the name changed, re-cache our stylesheet $theme_c = $update_d = false; if($stylesheet['name'] != $mybb->input['name'])
| // If the name changed, re-cache our stylesheet $theme_c = $update_d = false; if($stylesheet['name'] != $mybb->input['name'])
|
Zeile 1738 | Zeile 1754 |
---|
$update_d = true;
$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
|
$update_d = true;
$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
|
if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
| if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet['stylesheet']))
|
{ $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1); } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
{ $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1); } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
| $filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
|
}
// Update the CSS file list for this theme
| }
// Update the CSS file list for this theme
|
Zeile 1751 | Zeile 1770 |
---|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");
// Log admin action
|
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], $theme['name']);
|
flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 1984 | Zeile 2003 |
---|
// Shows the page where you can actually edit a particular selector or the whole stylesheet if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
|
// Shows the page where you can actually edit a particular selector or the whole stylesheet if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
|
{ // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
| { // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'] || $theme['tid'] == 1) { flash_message($lang->error_invalid_theme, 'error');
| if(!$theme['tid'] || $theme['tid'] == 1) { flash_message($lang->error_invalid_theme, 'error');
|
Zeile 2056 | Zeile 2075 |
---|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)),
| "stylesheet" => $db->escape_string($new_stylesheet),
|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
| "lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
Zeile 2231 | Zeile 2250 |
---|
$form->output_submit_wrapper($buttons);
|
$form->output_submit_wrapper($buttons);
|
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';
| echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';
|
echo '<script type="text/javascript">
$(document).ready(function() {
| echo '<script type="text/javascript">
$(document).ready(function() {
|
Zeile 2291 | Zeile 2310 |
---|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])),
| "stylesheet" => $db->escape_string($mybb->input['stylesheet']),
|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
| "lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
Zeile 2330 | Zeile 2349 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js"></script> <script src="./jscripts/codemirror/addon/search/search.js"></script>
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1813"></script>
|
'; }
| '; }
|
Zeile 2458 | Zeile 2477 |
---|
{ $db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
{ $db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
| $filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
| // Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
|
Zeile 2465 | Zeile 2487 |
---|
$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");
// Log admin action
|
log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $theme['name']);
|
flash_message($lang->success_stylesheet_deleted, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_stylesheet_deleted, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 2593 | Zeile 2615 |
---|
$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");
// Log admin action
|
log_admin_action($sid, $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['name']);
|
flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));
| flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));
|
Zeile 2603 | Zeile 2625 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js"></script> <script src="./jscripts/codemirror/addon/search/search.js"></script>
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1813"></script>
|
'; }
| '; }
|
Zeile 2873 | Zeile 2895 |
---|
});</script>'; }
|
});</script>'; }
|
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';
| echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';
|
echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>'; echo '<script type="text/javascript"> $(function() {
| echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>'; echo '<script type="text/javascript"> $(function() {
|
Zeile 2917 | Zeile 2939 |
---|
$plugins->run_hooks("admin_style_themes_set_default_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_themes_set_default_commit");
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
flash_message($lang->success_theme_set_default, 'success'); admin_redirect("index.php?module=style-themes");
| flash_message($lang->success_theme_set_default, 'success'); admin_redirect("index.php?module=style-themes");
|
Zeile 2954 | Zeile 2976 |
---|
$db->update_query("users", $updated_users);
// Log admin action
|
$db->update_query("users", $updated_users);
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
flash_message($lang->success_theme_forced, 'success'); admin_redirect("index.php?module=style-themes");
| flash_message($lang->success_theme_forced, 'success'); admin_redirect("index.php?module=style-themes");
|