Welcome Guest, Not a member yet? Register   Sign In
General PHP load question!
#1

[eluser]Lazos[/eluser]
I have this LOOP in my script. I was wondering if that will make the website really slow or PHP/Apache will handle them without a problem. Let's say for example this loop it will execute 30 times every time I visit the particular page.

What do you think?

Code:
function deleteContent ($array) {
        if (array_key_exists('Remove Pages', $this->groupperms) && (array_key_exists('Modify Any Page', $this->groupperms)) && (!$this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
            return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
        } else
        {
            if (!array_key_exists('Remove Pages', $this->groupperms) && (!array_key_exists('Modify Any Page', $this->groupperms)) && (!$this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
            return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
            } else
            {
                if (!array_key_exists('Remove Pages', $this->groupperms) && (!array_key_exists('Modify Any Page', $this->groupperms)) && ($this->CI->contentmodel->hasChild($array['content_id'])) && (!$this->CI->contentmodel->getOwnership($array['content_id'], $this->userid))) {
                return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
                } else
                {
                    if (array_key_exists('Remove Pages', $this->groupperms) && (array_key_exists('Modify Any Page', $this->groupperms)) && ($this->CI->contentmodel->hasChild($array['content_id']))) {
            return '<a href="deletecontent.php?content_id='.$array['content_id'].'">'.$this->CI->admin_theme->displayImage('images/admin/icons/system/delete.gif', $this->CI->lang->line('delete'), '', '','systemicon').'</a>';
                    }
                }
            }
        }
    }


Messages In This Thread
General PHP load question! - by El Forum - 11-07-2008, 06:00 PM
General PHP load question! - by El Forum - 11-08-2008, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB