2018-08-23, 07:08 AM
,Hi all,
I have a question regarding the custom pages. Usually I use the default template from MyBB docs for creating custom page i.e.
Now I have observed something interesting,
- If I use the secureCookieFlag enabled, $mybb->user['uid'] is not identified
- If I disable secureCookieFlag, $mybb->user['uid'] is not identified
(Make sure to logout and Login after changing this setting)
My question - Is there anything missing in custom page template that should be there ?
Regards
WallBB
I have a question regarding the custom pages. Usually I use the default template from MyBB docs for creating custom page i.e.
<?php
// Set some useful constants that the core may require or use
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'my_plugin.php');
// Including global.php gives us access to a bunch of MyBB functions and variables
require_once "./global.php";
// Only required because we're using misc_help for our page wrapper
$lang->load("misc");
// Add a breadcrumb
add_breadcrumb('My Page', "my_plugin.php");
$hello_world = 'This text will appear on the page';
eval('$sections = "' . $templates->get('hello_world_template') . '";');
// Using the misc_help template for the page wrapper
eval("\$page = \"".$templates->get("misc_help")."\";");
// Spit out the page to the user once we've put all the templates and vars together
output_page($page);
?>
Now I have observed something interesting,
- If I use the secureCookieFlag enabled, $mybb->user['uid'] is not identified
- If I disable secureCookieFlag, $mybb->user['uid'] is not identified
(Make sure to logout and Login after changing this setting)
My question - Is there anything missing in custom page template that should be there ?
Regards
WallBB