Jump to content

Variable Changing Values


Xtremer360

Recommended Posts

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 */

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.