2011-04-05, 06:07 PM
Disclaimer: I searched around quite a bit before posting this question. I found this thread which recommends using a mod (which I don't want to do for a few good reasons) and this one which is a more complex problem than mine and kind of over my head. /Disclaimer
I've just migrated my dating forum from SMF to MyBB and so far am very happy. However, there are two things I used to do with SMF which I know can be done in MyBB too but haven't figured out how to do yet.
1. Identifying a MyBB user role (e.g. admins) outside the forum.
I have some scripts that use my forum's user database to disallow anyone who isn't logged in as an admin. In SMF this was accomplished with this little piece of code:
What is the MyBB equivalent? I can't find anything about this in either this forum or the MyBB documentation.
2. Displaying posts outside the forum.
Like I said, I found a thread suggesting you do this with a mod, but since this is basically the same kind of problem as my first question (accessing MyBB data from outside the forum) I assume the answer is related, and that it can be achieved by including a MyBB core file (globals.php?) and a little php. All I want to do is display the last 10 forum posts on my main page (i.e. datesphere.com. My forum is located at datesphere.com/forum/). Again, in SMF there were some basic functions defined in SSI.php to do this. How do I do it in MyBB?
Thank you very much for any help you can provide. It's very appreciated.
Chris
I've just migrated my dating forum from SMF to MyBB and so far am very happy. However, there are two things I used to do with SMF which I know can be done in MyBB too but haven't figured out how to do yet.
1. Identifying a MyBB user role (e.g. admins) outside the forum.
I have some scripts that use my forum's user database to disallow anyone who isn't logged in as an admin. In SMF this was accomplished with this little piece of code:
<?php require_once('/path/forum/SSI.php');
if (!$context['user']['is_admin']) {
header( 'Location: http://www.datesphere.com' ) ;
}
?>
What is the MyBB equivalent? I can't find anything about this in either this forum or the MyBB documentation.
2. Displaying posts outside the forum.
Like I said, I found a thread suggesting you do this with a mod, but since this is basically the same kind of problem as my first question (accessing MyBB data from outside the forum) I assume the answer is related, and that it can be achieved by including a MyBB core file (globals.php?) and a little php. All I want to do is display the last 10 forum posts on my main page (i.e. datesphere.com. My forum is located at datesphere.com/forum/). Again, in SMF there were some basic functions defined in SSI.php to do this. How do I do it in MyBB?
Thank you very much for any help you can provide. It's very appreciated.
Chris