Xtremer360 Posted October 19, 2012 Share Posted October 19, 2012 If you notice the second paramter of the today function says 'H:s:i a'. When it gets sent to the inbox function it shows the variable correctly when I echo it inside the inbox function however right before this call: $personal_messages = $this->messages_model->get_personal_messages($user_data->user_id,'', $geo_data['zipz']['timezone'], 'inbox', $datetime_format, $display); it then echos like this: 'd F Y g:i a' Any ideas as to why that is? <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Personalmessages extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { redirect('kowmanager/personalmessages/inbox/'); } public function inbox($display = NULL, $datetime_format) { $message_box_messages = array(); $css_page_addons = ''; $js_page_addons = ''; $meta_tag_addons = ''; $site_title = 'KOW Manager Personal Messages'; $user_data = $this->users_model->is_logged_in($this->session->userdata('xtr')); if ($user_data === FALSE) { redirect('login', 'refresh'); } else { $body_content = $this->config->item('themes_path').'/'.$this->config->item('default_theme').'/cpanel/view_messages'; $body_type = 'full'; $geo_data = $this->functions_model->geo_matching(); $last_5_personal_messages = $this->messages_model->get_personal_messages($user_data->user_id, 5, $geo_data['zipz']['timezone'], 'inbox', 'd F Y g:i a'); $personal_messages = $this->messages_model->get_personal_messages($user_data->user_id,'', $geo_data['zipz']['timezone'], 'inbox', $datetime_format, $display); } if (count($message_box_messages) !== 0) { $message_boxes = $this->functions_model->build_message_boxes_output(array('display' => 'show', 'message' => $message_box_messages)); } else { $message_boxes = array('display' => 'none'); } $meta_tags = $this->functions_model->meta_tags(); if (isset($site_title) && (empty($site_title))) { $site_title = $this->functions_model->site_title(); } $this->data['user_data'] = $user_data; $this->data['last_5_personal_messages'] = $last_5_personal_messages; $this->data['personal_messages'] = $personal_messages; $this->data['notifications'] = $this->site_model->get_notifications(); $this->data['server_data'] = $this->server_model->get_server_data(); $this->data['site_data'] = $this->site_model->get_site_data(); $this->data['message_boxes'] = $message_boxes; $this->data['css_page_addons'] = $css_page_addons; $this->data['js_page_addons'] = $js_page_addons; $this->data['site_title'] = $site_title; $this->data['body_content'] = $body_content; $this->data['body_type'] = $body_type; $this->data['meta_tags'] = $meta_tags; $this->data['site_url'] = $this->functions_model->site_url(); $this->load->view($this->config->item('themes_path').'/'.$this->config->item('default_theme').'/cpanel/template/index', $this->data); } public function today() { $today = date('Y-m-d', time()); $start_range = $today.' 00:00:00'; $end_range = $today. ' 23:59:59'; $this->inbox(array('type' => 'today', 'values' => array('start_time' => $start_range, 'end_time' => $end_range)), 'H:s:i a'); } public function thisweek() { } public function lastweek() { } public function important() { } } /* End of file personalmessages.php */ /* Location: ./application/controllers/personalmessages.php */ Quote Link to comment https://forums.phpfreaks.com/topic/269701-variable-changing-values/ Share on other sites More sharing options...
Xtremer360 Posted October 19, 2012 Author Share Posted October 19, 2012 If need be here's a commented out a few of the function calls from the code above. /* * Gets the last 5 messages that were recieved. * @param integer $user_data->user_id User ID of the logged in user. @param integer or empty Represents the number of messages to retrieve. Empty represents getting all messages. @param integer $geo_data['zipz']['timezone'] The time offset of the user logged in based on his timezone. @param string inbox or outbox Tells the function which type of messages to retrieve. @param string d F Y g:i a Tells how to format the datetime_sent in the get_personal_messages functions. @param empty. */ $last_5_personal_messages = $this->messages_model->get_personal_messages($user_data->user_id, 5, $geo_data['zipz']['timezone'], 'inbox', 'd F Y g:i a', ''); /* * Gets the last 5 messages that were recieved. * @param integer $user_data->user_id User ID of the logged in user. @param integer or empty Represents the number of messages to retrieve. Empty represents getting all messages. @param integer $geo_data['zipz']['timezone'] The time offset of the user logged in based on his timezone. @param string inbox or outbox Tells the function which type of messages to retrieve. @param string $datetime_format Tells how to format the datetime_sent in the get_personal_messages functions. Specified from the type function. @param array Sends a type of message(today, last_week, this_week, important) and a values to look for. */ $personal_messages = $this->messages_model->get_personal_messages($user_data->user_id,'', $geo_data['zipz']['timezone'], 'inbox', $datetime_format, $display); Quote Link to comment https://forums.phpfreaks.com/topic/269701-variable-changing-values/#findComment-1386490 Share on other sites More sharing options...
Xtremer360 Posted October 20, 2012 Author Share Posted October 20, 2012 Any ideas as I've been trying to rack my brain on this one. Quote Link to comment https://forums.phpfreaks.com/topic/269701-variable-changing-values/#findComment-1386530 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.