codeigniter

Orkut Library and CodeIgniter

I am trying to incorporate the Orkut OS PHP Client into CodeIgniter as a Library, but am having no luck. When I test the Orkut Client out on my localhost as a standalone (not inside CodeIgniter), it works fine, but when I try it as a CodeIgniter lib, I am stuck in some kind of redirect with Google (it keeps asking the user if they grant...

Getting CodeIgniter to add load->view->header for error fields

How do you get CodeIgniter to load views before it loads the files in application/errors? I have custom error pages but I want them to be displayed beneath the header and menu_bar views. ...

CodeIgniter unable to send email using PHP mail()

Hello. I'm trying to send an e-mail with Codeigniter like this: $this->load->library('email'); $this->email->from("[email protected]"); $this->email->reply_to("[email protected]"); $this->email->to("[email protected]"); $this->email->subject("Test mail"); $this->email->message("Email body"); $this->email->set_alt_message("Email body tx...

Codeigniter Count / If problem

Hello, this is taking me too long to figure out. I am using Codeigniter to query a database. The model does this function currentfunction($id) { $query = $this->db->get_where('mytable', array("id =" => $id)); if($query->num_rows() > 0){ return $query->result_array(); }else { return false; } } The con...

PHP function curl_exec() slows down my script

I use the following function in CodeIgniter, to get my latest tweet: function tweet($id) { $c = curl_init(); curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/".$id.".xml?count=1"); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); //Benchmark starts here $src = curl_exec($c); ...

Using the singleton method to create a global object

I am trying to use the singleton method to access a global object (in this example its "username"). My question is how can I modify this so that in the DB->connect() function I could do echo $this->username; without declaring $username or changing the last 2 lines? class CI_Base { private static $instance; public function CI_B...

Creating a body ID in CodeIgniter

Is there a way to create a dynamic body id in codeigniter for different pages that converts spaces to dashes? I have been around forums and search engines but I have no luck. Here is my code: <body id="{$template.title}"> Here is the output: <body id="About us"> I want it to be: <body id="about-us"> let me know Thank you ...

Moved CodeIgniter Application to a different folder, I can't access any of the controllers

Hey, I have an application that was in a folder named "project", I moved all the files from "project" into "project/admin", because I decided it was a better structure, to access the application via the www.example.com/project/admin URL. The problem I am facing now is that I cannot access any of the controllers. The index page, which i...

How do I show a specific tweet? (with PHP/jQuery)

Hi, I want to embed a specific tweet on my page e.g http://twitter.com/myusername/status/123465678 I would also like to be able to show the latest of my tweets which have a specific tag. I tried to do this with Twitter API CodeIgniter Library myself but I need to register my application with Oauth. This seems like overkill for embeding...

How to make subdomains on codeigniter

Is there an easy way to create subdomains on codeigniter like api.site.com.? Thanks in advance. ...

set_value() default in Code Igniter

Hello I've used formigniter to generate a form for CI. http://formigniter.org/ That bit works great. However I want to set a default value for the name field. The input code looks like this: <label for="forename">Forename</label> <?php echo form_error('forename'); ?> <br /><input id="forename" type="text" name="forename" maxlength="2...

Htaccess ModRewrite for CodeIgniter with a parked/redirected domain.

I have this situation: hosting is located at maindomain.com othersite.com is parked to maindomain.com htaccess is used to redirect all requests for othersite.com to a subfolder: /site-othersite/ I want to use CodeIgniter on othersite.com but there are some directories and files in othersite.com that I don't want to have the CodeIgniter...

Loading custom config file into a Codeigniter library

I know this is probably simple, but I'm not getting. I've created a library, and I want to load the parameters from a config file. So here's an example of what I have: // libraries/Mylib.php class Mylib { var $ci; var $key; public function _construct { $this->ci =& get_instance(); $this->ci->config->load('mylib'); ...

Email date in header (CodeIgniter) is 7 hours off

When we receive mail from our website, through CodeIgniter first then Google Apps (mailer) - the date in the header is 7 hours behind the real time. We've checked the server time, and it is correctly set. Has anyone experienced this problem? Thanks! ...

Timezone offsets (and st/dst changes) in MySQL / PHP

Basically I have a site that allows stores to store their open/close times. Now, I'm trying to add the feature of giving their visitors the ability to see if the store is closed. I understand I can run a query like: SELECT * FROM `store_hours` WHERE TIME(NOW()) BETWEEN `opens` AND `closes` ... and the query works and retrieves the s...

Code Igniter - Get Hash Value With window.location.hash and Use in set_value()???

Hello, I need to get the hash # value from the current window url with javascript (can't get it with PHP), and then use that to set the value attibute of a form input with CI's set_value() function. Any ideas how I can grab the value in javascript then put it into the PHP function? :-S Thanks in advance! ...

Should I name my actual controller files the same as my view files in Codeigniter?

I'm writing my first Codeigniter site using the MVC pattern. I'm building some controllers that load views now (haven't gotten to Models yet) but I'm noticing that my View and Controller files have the same filename (like products.php). They are in their respective folders of course. For example I have an About controller, that loads ...

Using memcache as a session store?

I currently have a huge problem. Two days ago my site running on one server was too much, so I purchased two more and had them clustered (rsync and load balanced). I then start noticing that a user would hit server-1 and then on the next request hit server3 but that their session was still on server1 instead of server3 and they were no ...

Codeigniter, how to make a template

Hello all, im trying to ding into codeigniter MVC but i dont know how i make my template so i have 2 files (header and footer) and then i can make my controllers and then ONLY put information in the "content" div, so i include the top and the header a good way like this <?php include("header.php"); ?> <div id="content">My content here<...

Codeigniter: Compare a MySql Datetime with Current Date

I need to compare a MySQL datetime with the current time, to get the dateDiff to show a messange if the MySQL datetime, is less than 30 days from today. I'm using codeigniter, and I tried a lot of helpers, and lots of thing, I just can't get to work. Some people says that is better to save in database a timespan, I just don't know wich...