Welcome Guest, Not a member yet? Register   Sign In
  Using my application in another application
Posted by: El Forum - 10-07-2008, 06:04 AM - No Replies

[eluser]Unknown[/eluser]
Hi Guys

I have a site which runs codeigniter

Now I will like to make a subsite with the almost the same things, but with some new views, models and controllers, but how can i make it as easy as possible , so I just create a new folder in the application folder, and only copy the needed files to the new folder, and the codeigniter will first try to look in the subfolder, and if the file is there use, or else look in the application folder.

Just like codeigniter are doing now, when you extend a library class.

I have tried to set the APPPATH to nothing, and then use include_path, to do it, but CI is using file_exists, which doesn't look in the include_path.

Right now I am using Symbolic links, from one site to another, but every time I add a new language file, etc. I have to make a symbolic link to the subsite.

Is there anyone who has an idea


Kind Regards

Tue Topholm


  Not showing 404s
Posted by: El Forum - 10-07-2008, 05:30 AM - Replies (4)

[eluser]tsisson[/eluser]
I'm directing all the requests to my front controller through mod_rewrite. But if I call a method, that the controller doesn't contain, the 404 isn't shown. Even if I turn off error_reporting.

Any clue what could be wrong?


  Mystery Post Values appearing
Posted by: El Forum - 10-07-2008, 05:00 AM - Replies (6)

[eluser]johnwbaxter[/eluser]
I turned on the profiler today to check something and i've noticed an odd couple of post values that should not exist;

Code:
$_POST['x']       11
$_POST['y']       14

With every page submit (it's a form that allows you to calculate something over and over) the values change.

What is mildly worrying is that in my view and of course the source code of the rendered page there are no form elements with the name x or y. Not hidden not nothing.

Where on earth could this be coming from?!

I have no analytics running or anything like that, no hooks either. I can't work out for the life of me where this is coming from!

Can anyone give me some suggestions on where to look to find what's generating this being as it's not in the view?


  Top level XML-RPC element is missing
Posted by: El Forum - 10-07-2008, 04:56 AM - No Replies

[eluser]Tobz[/eluser]
Hi ya,
Im playing around with xml-rpc for the first time and I'm getting this error:
Top level XML-RPC element is missing

I now pretty much just copy/pasted the example code from the user guide, all I've changed is the server's controller and method names.

server:

Code:
class Update extends Controller {

  function Update() {
    parent::Controller();
  }


  function index() {
    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs');

    $config['functions']['check'] = array ('function'=>'Update.check');

    $this->xmlrpcs->initialize($config);
    $this->xmlrpcs->serve();
  }


  function check($request) {
    
    $parameters = $request->output_parameters();

    $response = array (
    array (
    'you_said'=>$parameters['0'],
    'i_respond'=>'Not bad at all.'),
    'struct');

    return $this->xmlrpc->send_response($response);
  }


}


and the client function:

Code:
function checkVersion() {
    $this->load->library('xmlrpc');
    
    $server_url = site_url('update');
    $request = array('How is it going?');
        
    $this->xmlrpc->server($server_url, 80);
    $this->xmlrpc->method('check');
    $this->xmlrpc->timeout(6);
    $this->xmlrpc->request($request);    
        
    if (!$this->xmlrpc->send_request()) {
       $output = $this->xmlrpc->display_error();
    }
    else {
      $output = '<pre>';
      $output .= print_r($this->xmlrpc->display_response(), true);
      $output .= '</pre>';
    }
    return $output;
  }

anyone see whats wrong here?

Thanks


  Search from 3 tables
Posted by: El Forum - 10-07-2008, 03:50 AM - No Replies

[eluser]Yash[/eluser]
I need to search in 3 tables and then show result as a single one here is code for i.e. used to search one table at a time depending user option

Help to remove switches and show result from all 3 tables onto single page.

Thank you ..

Code goes here

Code:
function Search($keyword)
    {
    
        

        if(empty($keyword))
        {
            return "No keyword to search";
        }
        
            
            
            
            switch($place)
            {
                case 'post':    
                                $this->db->like('Content', $keyword);
                                $this->db->from('posts');                                
                                break;
                
                case 'page':    $this->db->like('Content', $keyword);
                                $this->db->from('pages');
                                break;
                                
                case 'tag':        $this->db->like('TagClouds', $keyword);
                                $this->db->from('posts');
                                break;                

                default:        return "NO such area found";
                                
            }
            
            $cnt=$this->db->count_all_results();
            
            if($cnt==0)
            {    
            
                $data['title']="Information Page";
                $data['header']="Information";
                $data['url']="/blog/";
                $data['time']="20";
                $data['message']="<h3>Your search did not return any results.<h3><p><a href='[removed]history.go(-1)'>Return to Previous Page</a></p>
";
                $this->load->view('info',$data);
            }

            $config['base_url'] = site_url().'blog/search/'.$place.'/'.$keyword;
            $config['total_rows'] =$cnt;
            $config['per_page'] = '10';
            $config['num_links'] = '3';
            $config['uri_segment'] = '5';
            
            $this->pagination->initialize($config);
            $strr='<div id="post">
                        <div class="top">&nbsp;</div>
                        <div class="middle">&nbsp;<h3>Search Result for : <em>'.$keyword.'</em></h3>';
            //$this->db->order_by("PostID", "desc");        
            switch($place)
            {
                case 'post':    $this->db->order_by("PostID", "desc");
                                $this->db->like('Content', $keyword);    //$this->db->or_like('desc', $keyword);
                                $query = $this->db->get('posts',$config['per_page'],$this->uri->segment(5));                                
                                
                                foreach ($query->result() as $row)
                                {
                                    //echo  $row->Title."    By : ".$row->Author."<br>";
                                    $strr.= "<p>".anchor('blog/post/'.$row->URLTitle,$row->Title)."</p>";
                                    
                                }
                                break;

                
                case 'page':    $this->db->order_by("PageID", "desc");
                                $this->db->like('Content', $keyword);
                                $query = $this->db->get('pages',$config['per_page'],$this->uri->segment(5));

                                
                                foreach ($query->result() as $row)
                                {
                                    //echo  $row->Title."    By : ".$row->Author."<br>";
                                    $strr.= "<p>".anchor('blog/page/'.$row->URLTitle,$row->Title)."</p>";
                                    
                                }
                                break;
                                
                case 'tag':        $this->db->order_by("PostID", "desc");
                                $this->db->like('TagClouds', $keyword);
                                $query = $this->db->get('posts',$config['per_page'],$this->uri->segment(5));
                                foreach ($query->result() as $row)
                                {
                                    //echo  $row->Title."    By : ".$row->Author."<br>";
                                    $strr.= "<p>".anchor('blog/post/'.$row->URLTitle,$row->Title)."</p>";
                                    
                                }
                                break;                

                default:        return "N0 such area found";
                                
            }
    
          
        
        $strr.= '&nbsp;</div><div class="bottom"></div>
                 </div>
                
                 <div id="post">
                        <div class="top">&nbsp;</div>
                        <div class="middle"><span class="nav-link">'.$this->pagination->create_links().'</span></div>
                        <div class="bottom"></div>
                 </div>';
        return $strr;
        
        
        
            
             //return $output;

        }
        
        
      
    }


  CodeIgniter App getting data from the wrong mySQL table?
Posted by: El Forum - 10-07-2008, 02:13 AM - Replies (23)

[eluser]Dave Blencowe[/eluser]
Hey,

Recently I have been coding the Blog section to my personal site which is based on Codeigniter and have run across a problem.
I have made a model for getting things like posts etc from the database and then have the controller use the model to get the appropriate results yet when I ask for data from one table for comments it returns another table altogether and I just can't see why.

The section of the model

Code:
function get_blog($id, $limit = NULL)
    {
        
        $this->db->order_by("id", "desc");
        if($limit !== NULL)
        {
            $this->db->limit($limit);
        }
        
        if($id)
        {
            $this->db->where('id', $id);
        }
        $blog = $this->db->get('content_blog');
        return $blog->row_array();
    }
    
    function get_comments($id)
    {
        $this->db->order_by('id', 'desc');
        $this->db->where('post_id', $id);
        $comments = $this->db->get('content_test');
        return $comments->row_array();
    }

The section of the controller
Code:
function comments()
    {
        $this->load->view('template/default/header');
        
        $id = $this->uri->segment(3);    
        $get_blog = $this->mdl_blog->get_blog($id, '1');        

        $get_comments = $this->mdl_blog->get_comments($id, NULL);

        $this->load->view('blog/comments/main_view', $get_blog);
        $this->load->view('blog/comments/comments_view', $get_comments);
        $this->load->view('blog/comments/comments_add');
        $this->load->view('template/default/footer');
    }

These two views seem to have the the $get_blogs variable passed to them each time...
Code:
$this->load->view('blog/comments/main_view', $get_blog);
        $this->load->view('blog/comments/comments_view', $get_comments);


I've attached the files in case they are any use and I thank you for any help you might be able to provide.

Thanks,
Dave


  content management system
Posted by: El Forum - 10-07-2008, 01:14 AM - Replies (4)

[eluser]nandish[/eluser]
Hi guys

Where can i get best cms(content management system) tutorial

Thanks in advance


  how can i integrate layout and modular extensions??
Posted by: El Forum - 10-07-2008, 12:12 AM - Replies (2)

[eluser]Unknown[/eluser]
i have integrate modular extensions in my application. now i need to add a layout system in my application.
i m working on it..
bt can anyone provide me any solution regarding this....
can i have any library ?
wht will be the best soultion?
plz help me


  pointing multiple domains to same instance of CI
Posted by: El Forum - 10-06-2008, 09:23 PM - Replies (5)

[eluser]niyogi[/eluser]
we need to point multiple domains to the same instance of codeigniter. As the user browses from page to page, they should remain on the same domain. Does anything special need to be done to achieve this?

To make things a little bit more complicated we need each domain to point to a specific controller. How would we do this?

You're help is greatly appreciated!


  Beginner Date Helper Question
Posted by: El Forum - 10-06-2008, 04:40 PM - Replies (7)

[eluser]seth.aldridge[/eluser]
Hi,

This is my first time in CI and I had an issue with the Date helper.

This is how my time is printing out:

Code:
2008-11-06 00:00:00

This is what I'm using for the Date Helper:

Code:
&lt;?=mdate("%F %j",$row->Date)?&gt;

This is what I get:

Code:
December 31

Does anyone know what I'm doing wrong?

I don't know much about the Date function so I'm not sure how to fix this issue. A little guidance would be much appreciated.

UPDATE: This is across the board no matter what the time is? Could this be something with my date helper php file or a global setting?

Example URL: http://www.boosthabitatcabarrus.org/

Update 2: This seems to be a global issue because even the PHP date() function returns the same date. The only time this happens is if I try to have it format the date with %F %j. If I remove that it displays the correct date...just not formatted.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Cache best practice?
by BhambriRohunu
44 minutes ago
CI 4.5.1 CSRF - The actio...
by BhambriRohunu
53 minutes ago
Bug with sessions CI 4.5....
by InsiteFX
1 hour ago
Codeigniter Shield Bannin...
by kenjis
5 hours ago
SQL server connection not...
by kenjis
6 hours ago
Best way to create micros...
by kenjis
8 hours ago
How to use Codeigniter wi...
by kenjis
8 hours ago
Getting supportedLocales ...
by kcs
Today, 09:30 AM
Component help
by FlashMaster
Today, 01:41 AM
Show logo in email inbox
by WiParson
Today, 12:48 AM

Forum Statistics
» Members: 85,269
» Latest member: Az888cc
» Forum threads: 77,577
» Forum posts: 375,980

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB