Jump to content

Joomla - Docman - Category Loop Array


fuzje

Recommended Posts

Hi all

 

I am setting up a corporate intranet site using joomla and docman to hold files. I have been given a category structure that will have over 8000 categories. I have loaded this into the docman table in the joomla database, and due to the large number of categories, the front end in the web interface has suddenly become very slow and unusable. I have looked into the code and believe the problem is caused by holding all the category IDs in an array.

 

function fetchCategory($id)
{
    global $_DMUSER;
$cat = new DOCMAN_Category($id);

    // if the user is not authorized to access this category, redirect
    if(!$_DMUSER->canAccessCategory($cat->getDBObject())) {
    	_returnTo('' , _DML_NOT_AUTHORIZED);
    }

    // process content mambots
    DOCMAN_Utils::processContentBots(  $cat, 'description' );

    return HTML_DMCategories::displayCategory($cat->getLinkObject(),
        $cat->getPathObject(),
        $cat->getDataObject());
}

function fetchCategoryList($id)
{
    global $_DOCMAN, $_DMUSER;

    $children = DOCMAN_Cats::getChildsByUserAccess($id);

    $items = array();
    foreach($children as $child)
    {
        $cat = new DOCMAN_Category($child->id);

        // process content mambots
        DOCMAN_Utils::processContentBots(  $cat, 'description' );

     	$item = new StdClass();
       	$item->links = &$cat->getLinkObject();
       	$item->paths = &$cat->getPathObject();
        $item->data = &$cat->getDataObject();

       	$items[] = $item;
    }
    // display the entries
    return HTML_DMCategories::displayCategoryList($items);
}

 

I believe the issue lies under the function_fetchCategoryList ($id).

 

Each page loads from the ID of the parent category in the front end. (for example http://myserver/index.php?option=com_docman&task=cat_view&gid=4 loads all the categories that have a parent ID of 4) What I want is something that loads only the categories needed for that page and not loop looking for child IDs for the next 8000 categories, only the ones directly below. Apologies if I don't make much sense. My php knowledge is very limited and I don't even know if what I am proposing is possible.

 

The developer is looking into this but this is something I need to get working urgently as the developer has other issues to sort.

 

I have been told that the company do not mind paying someone to try and solve the issue. I can provide front and backend access if needed.

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.