Part of the EllisLab Network
   
 
someone please take a look at my setup
Posted: 14 February 2008 09:55 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  113
Joined  12-07-2007

Hello,

can someone please take a look at my code and tell me what’s wrong with it? thanks

master.php

<?php

class Master extends Controller {

    
//===============================================
    
function Master()
    
//===============================================
    
{
        parent
::Controller();

     
}
    
}
?>

tracking.php

<?php
include(APPPATH . 'controllers/access/master.php');

class
Tracking extends Master {


    
function Tracking()
    
{
        parent
::Master();

    
}


}
?>

neutral.php

<?php
include(APPPATH . 'controllers/access/tracking.php');

class
Neutral extends Tracking {
       
    
function Neutral()
    
{
        parent
::Tracking();

    
}
    
}
?>

searchmaster.php

<?php
include(APPPATH . 'controllers/access/neutral.php');

class
SearchMaster extends Neutral {

    
//===============================================
    
function SearchMaster()
    
//===============================================
    
{
        parent
::Neutral();
        
$this->load->model('Search_Model');        
        if (
$this->_SearchIntervalOk() == false)    //do IP check here and limit subsequent searches to >30 secs
        
{
                
echo 'check';
        
Admin(39, SefUrl('src-adv', 'url'));
        exit;
        
}
    }

    
    
//===============================================
    
function _SearchIntervalOk()
    
//===============================================
    
{
    $interval
= $this->GLOBAL_UTC - $this->config->item('SearchWaitTime');
    return (
$this->Search_Model->CheckSearchInterval($this->GLOBAL_IP, $interval) > 0)    ?    false    :    true;
    
}    
    
    
}
?>

main.php

<?php
include(APPPATH . 'controllers/search/searchmaster.php');

class
Main extends SearchMaster {

    
//===============================================
    
function Main()
    
//===============================================
    
{
        parent
::SearchMaster();
        
$this->perPage = $this->config->item('DefaultUserListPerPage');        
    
}

    
//===============================================
    
function index()
    
//===============================================
    
{
    $this
->Advanced();
    
}

    
//===============================================
    
function Advanced()
    
//===============================================
    
{
        
    }

    
//===============================================
    
function HandleSearch()
    
//===============================================
    
{
        
echo 'search';
        
}
}
?>

Ok, first of all, I’m using this setup successfully in other parts of my application. Then, when main->handlesearch() is called, whatever is in searchmaster constructor should be run first. this happens all the time in other parts of the application. However, in this particular situation, when main->handlesearch is called, it first executes whatever is in that function. THEN, it does whatever is in searchmaster constructor.

someone please help. thanks

 Signature 

Atlantix Media Networks

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120486 Total Logged-in Users: 24
Total Topics: 126559 Total Anonymous Users: 2
Total Replies: 665411 Total Guests: 290
Total Posts: 791970    
Members ( View Memberlist )