MyBB Community Forums

Full Version: Display Latest Threads Respecting Permissions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm trying to display the latest 10 threads on the home page of my site which is running on a CMS. I have tried using MyBBIntegrator but for some reason it does not work that well. I signed up to phpdave but like many, he appears to not bother activating people's accounts.

I have several boards that I do not wish to be public but at the same time I would like threads in these boards to be visible to a user who has permissions to view them. I already am using the latest posts plugin on the forum which works well but how to either use this plugin or MyBBIntegrator to display permission based posts?

I have already integrated the forum/cms login system using MyBBIntegrator and it works well but I can't seem to get permission based threads to appear.

Has anyone got some experience with this at all? I did try getLatestActiveThreads but it doesn't seem to work how it should and without being able to post on phpdave then I'm kinda stuck.

Is it possible to run plugins out with the forum using the global.php?

If anyone can give me an idea that would be great.
OFF TOPIC :
may be you have to hire a coder unless an expert comes forward to volunteer to help with the code ...
I can code this myself as I'm a developer... I just wondered if there's a quick solution that is already available to overcome the same issues I have with the permissions.

Thanks
What I do in my webpage, plain php, is include_once a copy of the portal.php, edited to use only the necessary code to show the latests threads box without trowing errors.
^ oh ! that appears to be a smart method Smile no need of hard coding ..
(2011-12-15, 02:36 PM)Omar G. Wrote: [ -> ]What I do in my webpage, plain php, is include_once a copy of the portal.php, edited to use only the necessary code to show the latests threads box without trowing errors.

Hi Omar,

thanks for the reply. I have had a look at the portal.php file and tried to find how this is actually included on my site.

My forum is in /bb directory and I changed the $forumdir to "./bb"; and the $change_dir to "./bb"; but I get $forumdir is invalid!.

Any idea?

Thanks!
Then forumdir is invalid.

I use this at the beggining of my file:
$forumdir = './foros';
define("IN_MYBB", 1);

$filename = substr($_SERVER['SCRIPT_NAME'], -strpos(strrev($_SERVER['SCRIPT_NAME']), "/"));
define('THIS_SCRIPT', $filename);

$current_dir = getcwd();

//change working directory to allow board includes to work
$forumdirslash = $forumdir."/";
$change_dir = "./";

if(!@chdir($forumdir) && !empty($forumdir))
{
    if(@is_dir($forumdir))
    {
        $change_dir = $forumdir;
    }
    else
    {
        die("\$forumdir is invalid!");
    }
}

//setup templates
//$templatelist = "pc_header,pc_footer";

//get MyBB stuff
require_once $change_dir."/global.php";

//change directory back to current where script is
@chdir($current_dir);

//adjust theme settings in case this file is outside mybb_root
global $theme, $templates;
$theme['imgdir'] = $mybb->settings['bburl']."/".$theme['imgdir'];
$theme['imglangdir'] = $mybb->settings['bburl']."/".$theme['imglangdir'];

define("IN_PORTAL", 1);

// set the path to your forums directory here (without trailing slash)

// end editing

$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal_pms,portal";

My forum is located here:
htdocs+
-file.php
--foros
@ Omar G.

Do you speak Arabic ?

if you speak arabic , please view this topic ( http://community.mybb.com/thread-109973.html ) & help me