2022-11-24, 08:53 PM
2022-11-24, 09:38 PM
hi, one way is get view access from guests in forums permissions. (remember set bots on registered groups that be able read your contents)
2022-11-25, 12:57 AM
(2022-11-24, 09:38 PM)Mostafa.Shiraali Wrote: [ -> ]hi, one way is get view access from guests in forums permissions. (remember set bots on registered groups that be able read your contents)
but I mean an extra page, I have created a new page in the root directory of my web. Example https://forum.com/example/ so I want to know how to make only registered users can access that extra page
2022-11-25, 08:38 AM
something like this :
if($mybb->user['uid'] > 0)
{
//your page code
}
else
{
error("only registered users can acess to this page");
}
2022-11-25, 06:28 PM
(2022-11-25, 08:38 AM)Mostafa.Shiraali Wrote: [ -> ]something like this :
if($mybb->user['uid'] > 0) { //your page code } else { error("only registered users can acess to this page"); }
thank you very much, you are the best
(2022-11-25, 08:38 AM)Mostafa.Shiraali Wrote: [ -> ]something like this :
if($mybb->user['uid'] > 0) { //your page code } else { error("only registered users can acess to this page"); }
One last question brother, what do you mean by the code of my page, and where can I see it?
2022-11-25, 06:35 PM
you said you have a extra page so you can put your php extra page codes in this condition to show only to registered users
2022-11-25, 06:39 PM
I didn't understand very well, but what I did was place the code that you gave me, in the .php of my extra page. Can you tell me what else I need to do?
<?php
define('IN_MYBB', 1); require "./global.php";
add_breadcrumb("Improvements", "improvements.php");
eval("\$html = \"".$templates->get("template_name")."\";");
output_page($html);
if($mybb->user['uid'] > 0)
{
//your page code
}
else
{
error("only registered users can access this page");
}
?>
Hello, I already did everything, but if you go to my extra page *https://eliteforums.cf/mejoras.php* you will see that the code of my main page is mixed with that of my extra page, so everything looks very ugly, you know What I can do?
<?php
define('IN_MYBB', 1); require "./global.php";
add_breadcrumb("Improvements", "improvements.php");
eval("\$html = \"".$templates->get("template_name")."\";");
output_page($html);
if($mybb->user['uid'] > 0)
{
//your page code
}
else
{
error("only registered users can access this page");
}
?>
(2022-11-25, 06:35 PM)Mostafa.Shiraali Wrote: [ -> ]you said you have a extra page so you can put your php extra page codes in this condition to show only to registered users
Hello, I already did everything, but if you go to my extra page *https://eliteforums.cf/mejoras.php* you will see that the code of my main page is mixed with that of my extra page, so everything looks very ugly, you know What I can do?