Zastanawiam się jak zrobić podstronę w (panelu użytkownika) MyBB w której będzie notatnik i tam będzie się wpisywało kod CSS a następnie on aktualizował się do pola "css" w mybb_users
tabela mybb_users, pole "css"
UPDATE `mybb_users` SET `css` = 'kod CSS'
--- podstrona w usercp, jak zrobić
pierw szukamy tego, i poniżej dodajemy
Kod
case "attachments":
add_breadcrumb($lang->ucp_nav_attachments);
break;
}
add_breadcrumb($lang->ucp_nav_attachments);
break;
}
ten kod
Kod
if($mybb->input['action'] == css)
{
eval("\$podstr = \"".$templates->get("css")."\";");
output_page($podstr);
}
{
eval("\$podstr = \"".$templates->get("css")."\";");
output_page($podstr);
}
Dalej. Szablony globalne > Nowy szablon. Tworzysz szablon o nazwie css Treść szablonu:
Kod
<html>
<head>
<title>{$mybb->settings['bbname']} - CSS</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
{$usercpnav}
<td valign="top">
{$errors}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>CSS</strong></td>
</tr>
<tr>
<td class="tcat" colspan="2"><strong>CSS</strong></td>
</tr>
<tr>
<td class="trow2" width="40%"><strong>Tutaj jakiś tekst.</strong></td>
</tr>
</table>
<br />
</td>
</tr>
</table>
{$footer}
</body>
</html>
<head>
<title>{$mybb->settings['bbname']} - CSS</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
{$usercpnav}
<td valign="top">
{$errors}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>CSS</strong></td>
</tr>
<tr>
<td class="tcat" colspan="2"><strong>CSS</strong></td>
</tr>
<tr>
<td class="trow2" width="40%"><strong>Tutaj jakiś tekst.</strong></td>
</tr>
</table>
<br />
</td>
</tr>
</table>
{$footer}
</body>
</html>
bodajże ten "notatnik" będzie wyglądał tak, lecz nie wiem co mam zmienić w podstronie żeby aktualizowało pole "css"
Kod
<form action="usercp.php?action=css" method="post">
<textarea name="tekst" rows="7" cols="100"></textarea>
<input type="submit" value="Aktualizuj" name="update" class="button"/>
<textarea name="tekst" rows="7" cols="100"></textarea>
<input type="submit" value="Aktualizuj" name="update" class="button"/>