MyBB Hacks

Full Version: Admin Notepad Function?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
"Administrator Notes
These notes are public to all administrators."

Those notes are easy to find in the datacache. Where is the function to retrieve the un-serialized text?


Edit:
I found this
$cache->update("adminnotes", $update_cache);  
...so I must be getting close.  Smile

Edit#2:

$adminmessage = $cache->read("adminnotes");
in the file
admin/modules/home/index.php

Now the only question is what to include in a 'custom' page, will "global.php" be enough?   (Edit: Yes, and No)


Edit#3:

PHP Code:
<?php
define('IN_MYBB', 1);
require_once "./global.php";

$adminmessage = $cache->read("adminnotes");
echo $adminmessage['adminmessage'];
?> 


Looks fine only when using view source (in the browser), still working on formatting...


Edit#4:
One (simple) answer to question #1

PHP Code:
<?php

define('IN_MYBB', 1);
require_once "./global.php";
$adminmessage = $cache->read("adminnotes");
?>

<textarea rows="30" cols="110">
<?php echo $adminmessage['adminmessage'] ; ?> 
</textarea>



Question #2
What file(s) to include to use the...
'  $table = new Table;  '  and   ' $form = new Form("index.php", "post"); '

...table and form functions?

Thank you


Edit#5:

require_once MYBB_ADMIN_DIR."inc/class_form.php";
require_once MYBB_ADMIN_DIR."inc/class_table.php";

Happy Thanksgiving  Smile

(11-25-2010 03:23 PM)Firefox Wins Wrote: [ -> ]Edit#4:
One (simple) answer to question #1

PHP Code:
<?php

define('IN_MYBB', 1);
require_once "./global.php";
$adminmessage = $cache->read("adminnotes");
?>

<textarea rows="30" cols="110">
<?php echo $adminmessage['adminmessage'] ; ?> 
</textarea>

Don't forget htmlspecialchars()
Thank you for the security reminder
Reference URL's