function export_skin() { if (!isset($this->post['skin'])) { $skin_box = $this->select_skins($this->skin); return $this->message('Export a skin', "\r\n\t\t\tSelect a skin to export:<br /><br />\r\n\t\t\t<form action='{$this->self}?a=templates&s=export' method='post'>\r\n\t\t\t\t<select name='skin'>\r\n\t\t\t\t\t{$skin_box}\r\n\t\t\t\t</select>\r\n\t\t\t\t<input type='submit' value='Export Skin'>\r\n\t\t\t</form>"); } else { $templates = $this->dump_database(array('templates' => "template_skin='{$this->post['skin']}'")); $skin = $this->db->fetch("SELECT * FROM {$this->pre}skins WHERE skin_dir='{$this->post['skin']}'"); $info = "<?php\r\n\$skin['name'] = \"" . addslashes($skin['skin_name']) . "\";\r\n\$skin['dir'] = \"" . addslashes($skin['skin_dir']) . "\";\r\n?>"; if (file_exists("../skins/{$this->post['skin']}/info.php")) { unlink("../skins/{$this->post['skin']}/info.php"); } if (file_exists("../skins/{$this->post['skin']}/templates.php")) { unlink("../skins/{$this->post['skin']}/templates.php"); } include '../lib/zip.php'; $this->chmod('..', 0777); $zip = new zip(); $zip->add("../skins/{$this->post['skin']}"); $zip->add_file($info, 'info.php'); $zip->add_file($templates, 'templates.php'); $zip->write_zip("../{$this->post['skin']}.mbs"); return $this->message('Export a Skin', 'Skin exported to the main MercuryBoard directory.', "{$this->post['skin']}.mbs", "../{$this->post['skin']}.mbs"); } }
function export_skin() { if (!isset($this->post['skin'])) { $skin_box = $this->htmlwidgets->select_skins($this->skin); return $this->message($this->lang->export_skin, "\n\t\t\t{$this->lang->export_select}:<br /><br />\n\t\t\t<form action='{$this->self}?a=templates&s=export' method='post'><div>\n\t\t\t\t<select name='skin'>\n\t\t\t\t\t{$skin_box}\n\t\t\t\t</select>\n\t\t\t\t<input type='submit' value='{$this->lang->export_skin}' /></div>\n\t\t\t</form>"); } else { $templates = $this->dump_database(array('templates' => "template_skin='{$this->post['skin']}'")); $skin = $this->db->fetch("SELECT * FROM {$this->pre}skins WHERE skin_dir='{$this->post['skin']}'"); $info = "<?php\n\$skin['name'] = \"" . addslashes($skin['skin_name']) . "\";\n\$skin['dir'] = \"" . addslashes($skin['skin_dir']) . "\";\n?>"; if (file_exists("../skins/{$this->post['skin']}/info.php")) { unlink("../skins/{$this->post['skin']}/info.php"); } if (file_exists("../skins/{$this->post['skin']}/templates.php")) { unlink("../skins/{$this->post['skin']}/templates.php"); } include '../lib/zip.php'; $this->chmod('../skins', 0777); $zip = new zip(); $zip->add("../skins/{$this->post['skin']}"); $zip->add_file($info, 'info.php'); $zip->add_file($templates, 'templates.php'); $zip->write_zip("../skins/{$this->post['skin']}.mbs"); return $this->message($this->lang->export_skin, $this->lang->export_done, "{$this->post['skin']}.mbs", "../skins/{$this->post['skin']}.mbs"); } }