Welcome Guest, Not a member yet? Register   Sign In
  User Inputted Date Query
Posted by: El Forum - 08-23-2007, 04:36 PM - No Replies

[eluser]LifeSteala[/eluser]
Hi, I have a form which has a field -> "Due Date". I have a javascript widget which let's user's select a date, and whatever they select goes into it's input field like so: "28/8/2007". I have a MySQL table with a DATETIME field. How do I insert this?? I've searched forums, and have had no luck.

Thanks


  Auth (from wiki) db_session (from wiki) is it just because i'm local ?
Posted by: El Forum - 08-23-2007, 04:33 PM - No Replies

[eluser]sikkle[/eluser]
Hi there,

i'm trying to figure out if i'm crazy or not Smile

i run a little windowsxp wamp5 server at this time.

I install two fresh version of Ci, installed FreackAuth and Auth, with both of them, when i reload page after some time i'll get something like this, this code is from Auth, not freakauth for the moment.

Code:
QUERIES  

SELECT * FROM ci_sessions WHERE session_id = '37417e4d5b0f40942a9495664d8a4b5a' AND last_activity > 1187900811 AND ip_address = '127.0.0.1' AND user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;'

UPDATE ci_sessions SET last_activity = 1187908011, user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;', ip_address = '127.0.0.1', session_data = 'a:6:{s:7:\"user_id\";s:1:\"1\";s:9:\"user_name\";s:6:\"system\";s:5:\"users\";a:1:{i:1;s:6:\"system\";}s:8:\"security\";a:2:{s:4:\"role\";a:2:{s:7:\"role_id\";s:1:\"1\";s:4:\"role\";s:5:\"Admin\";}s:11:\"permissions\";a:1:{i:1;s:1:\"*\";}}s:23:\"flash:new:sentry_status\";b:0;s:23:\"flash:old:sentry_status\";b:0;}' WHERE session_id = '37417e4d5b0f40942a9495664d8a4b5a'

UPDATE ci_sessions SET last_activity = 1187908011, user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;', ip_address = '127.0.0.1', session_data = 'a:5:{s:7:\"user_id\";s:1:\"1\";s:9:\"user_name\";s:6:\"system\";s:5:\"users\";a:1:{i:1;s:6:\"system\";}s:8:\"security\";a:2:{s:4:\"role\";a:2:{s:7:\"role_id\";s:1:\"1\";s:4:\"role\";s:5:\"Admin\";}s:11:\"permissions\";a:1:{i:1;s:1:\"*\";}}s:23:\"flash:old:sentry_status\";b:0;}' WHERE session_id = '37417e4d5b0f40942a9495664d8a4b5a'

SELECT * FROM user WHERE id = '1'

UPDATE ci_sessions SET last_activity = 1187908011, user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;', ip_address = '127.0.0.1', session_data = 'a:5:{s:7:\"user_id\";s:1:\"1\";s:9:\"user_name\";s:6:\"system\";s:5:\"users\";a:1:{i:1;s:6:\"system\";}s:8:\"security\";a:2:{s:4:\"role\";a:2:{s:7:\"role_id\";s:1:\"1\";s:4:\"role\";s:5:\"Admin\";}s:11:\"permissions\";a:1:{i:1;s:1:\"*\";}}s:23:\"flash:old:sentry_status\";b:0;}' WHERE session_id = '37417e4d5b0f40942a9495664d8a4b5a'

UPDATE ci_sessions SET last_activity = 1187908011, user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;', ip_address = '127.0.0.1', session_data = 'a:5:{s:7:\"user_id\";s:1:\"1\";s:9:\"user_name\";s:6:\"system\";s:5:\"users\";a:1:{i:1;s:6:\"system\";}s:8:\"security\";a:2:{s:4:\"role\";a:2:{s:7:\"role_id\";s:1:\"1\";s:4:\"role\";s:5:\"Admin\";}s:11:\"permissions\";a:1:{i:1;s:1:\"*\";}}s:23:\"flash:old:sentry_status\";b:0;}' WHERE session_id = '37417e4d5b0f40942a9495664d8a4b5a'

For this part, maybe it's just like how Auth is build, or maybe this is because i'm local ? i'll try to get the code from FreakAuth too. next post.

thanks for your comments.


  which one is the best: using HTML Table Class or pure html tag
Posted by: El Forum - 08-23-2007, 02:38 PM - No Replies

[eluser]Zulkhaery B[/eluser]
hi,

i'am new comer in mvc logic.
should i using html table class or pure html tag to my views ?

thanks before.

Zul


  Implementing a modular file structure within the CI applications folder
Posted by: El Forum - 08-23-2007, 11:43 AM - No Replies

[eluser]tinawina[/eluser]
I watched all of the excellent CI screencasts by Elliot Haughin. (You can find them with example files on his site - http://www.filepanda.com - browse "codeigniter"; or find all of the podcasts in working order here: http://www.bambooinvoice.org/img/screencasts/)

In Elliot's third podcast he reorganizes CI a bit. He moves the application folder out of the system folder so that it resides at the same level of system. And then he creates a modules folder in the application folder where he creates individual folders for each module that he's going to have in his web site. Each of the module sub-folders includes it's own view, controller, and model folders - like this:

Code:
/application
   /modules
      /blog  <-- one module with its own MVC
         /controllers
         /models
         /views
      /news  <-- another module with its own MVC
         /controllers
         /models
         /views

I would LOVE to set up my site this way! But I can't get this to work. Elliot changed three files: Loader.php, Router.php in the libraries folder, and Codeigniter.php. He also had done some changes to the routes.php file in an earlier podcast which needs to get set up before you can make this all work. I grabbed his example files which included all of the revised files needed and copied them over to my server. No go.

Has anyone been able to get this or something like it working? Thanks for any insight!


  How to intergrate a Shopping Cart application to Code Igniter Framework
Posted by: El Forum - 08-23-2007, 11:22 AM - No Replies

[eluser]Joy_kk[/eluser]
Hi

This is my first travel through Code Igniter Forums.
I am trying to integrate shopping cart application(OS Commerce) to Code Igniter Framework, I tried hard but couldn't be able to integrate.


plz guide me if anyone aware of the process or steps to do that

Any help would be appericiated

Thanks in Advance
Joy


  Session, cookie with IE6 in x64 system (strange problem)
Posted by: El Forum - 08-23-2007, 11:02 AM - No Replies

[eluser]BDT[/eluser]
Hi all CI guru!

This is my first post in CI forum. First of all, sorry my bad english, but i have little english.

Previously, i make login system with authlib (from wiki), and works very well in Firefox, IE6, IE7.
But now, i installed WinXp x64 and when i want to continue my coding, i can't login.
I start FF and try to login: login successful.

On my laptop (windows xp 32 bit with ie6, ff) the login system works correctly.

After several debugging i found that in x64 IE6 cookie data not contain my variable none the less CI successfuly authenticating user and set my session cookie data with $this->CI->session->set_userdata()

I use this to set variable:

$UserParameterek = $this->CI->User_Model->GetLoggedInUserdata($user_id);
$UserParameterek['usr_logged_in'] = TRUE;
$this->CI->session->set_userdata($UserParameterek);
log_message('info', "Setting session parameters from authlib!");

Anyone have any idea for this problem?

supplement:
I load session library with CI autoload and i set the x64 IE6 Tools-Internet options->Privacy to "Accept All Cookies".


  UserAuth Mini-App Error
Posted by: El Forum - 08-23-2007, 10:07 AM - No Replies

[eluser]Unknown[/eluser]
Hi everyone,

I just installed the UserAuth Mini-app Auth tool from the CI wiki. I followed the installation instruction, but when I go to login as the admin user, I get the following error:

"The requested URL /ci/user/login was not found on this server."

I installed CI in my Apache htdocs area.

Any feed back will be greatly appreciated.

Thanks in advance.


  Libraries
Posted by: El Forum - 08-23-2007, 09:47 AM - No Replies

[eluser]codelearn[/eluser]
Quick question about Libraries.

Is there a way to pass variables to the Library other than through the constructor? I have vars in the class itself that I want to set dynamically from the controller. I am just getting started building my own libraries and thus am a little confused.

Thanks all!


  Eventually CRACKED IT - Menu driven multiple CodeIgniter applications
Posted by: El Forum - 08-23-2007, 09:40 AM - No Replies

[eluser]John_Betong[/eluser]
Hi All,

Preamble

Delphi has a wonderful technique that allows the programmer to easily switch
between applications by using a menu system.

CodeIgniter's rigidity and hard-coding has been bothering me for quite some time
as to the easist way to achieve:
&nbsp;&nbsp; 1. easily switch CodeIgniter applications
&nbsp;&nbsp; 2. use a common codeIgniter System folder.

I used to manually edit my "index.php" file but now with a slight modification
to the file I can now select the application from "_menu.php".
&nbsp;
&nbsp;
Usage
I have the following application directories setup: each directory is copied
from CodeIgniter's system/application folder.

My Localhost directory structure

Code:
...
    ci_bandwidthmeter
    ci_betsprint
    ci_fred
    ci_jokes
    ci_plaroma
    ci_rentaroofbox
    ci_system // renamed CodeIgniter's "system" folder for consistency
    ...
    index.php // modified
    _menu.php //

&nbsp;

The index.php was slightly modified so that instead of having
"$application_folder" hard-coded it now reads from an "_application.php" file.
I wrote a "_menu.php" file that generates the "_application.php" file.

index.php
Code:
...
  ...
  // old code that had to be manually edited  to select different applications
  // the required application was copied and pasted to be the last declaration
    $application_folder = 'ci_bandwidthmeter';
    $application_folder = 'ci_betsprint';
    $application_folder = 'ci_fred';
    $application_folder = 'ci_jokes';
    $application_folder = 'ci_plaroma';
    $application_folder = 'ci_rentaroofbox';
    
  // new _menu.php driven setting  
  include('_application.php'); // contents generated from "_menu.php"
  $application_folder = APPLICATION_FOLDER; // included contents from  "_application.php" file
  ...
  ...
&nbsp;
_menu.php
Code:
&lt;?php

  // file name to save CodeIgniter's $application_folder variable
  $filename = getcwd() .'/_application.php';  

  // delete file that holds the $application_folder variable if and only if it exists
  if (file_exists($filename)) {
    unlink($filename);
  }

  // check to see if a $application has been passed at the command line
  $application   = isset($_GET['application']) ? $_GET['application'] : ''; // '$application is NOT set' ;
  
  // write the $application variable to the $filename file
  if ($application) {
    $application   =  "&lt;?php define('APPLICATION_FOLDER', $application) ?&gt;";
    
    $saved  = file_put_contents($filename, $application);
    if ($saved) {
      header("Location: index.php"); /* Redirect browser */
      exit;
    }else{
      // echo 'Message goes here ==> '. $filename;
    }
  }//endif $application
    
  
  // optional to eliminate html errors
  if (file_exists('_head.php')) {
    include('_head.php');
  }else{
    echo '&lt;html&gt;&lt;title&gt;My CodeIgiter menu&lt;/title&gt;&lt;/head&gt;';
  }
    
  // fall through to menu selections using radio buttons
?&gt;

&lt;body style='background:#f00 none; color:#00f'&gt;

  <div style='width:40%; margin:4em auto; background:#fff none; color:#000; border:outset 6px; padding:1em'>

    &lt;form action='_menu.php' style='font-size:1.4em'&gt;
      <dl>
        <dt style='color:#f00'>My CodeIgniter Applications<br /><br /></dt>
           &lt;?php
              $b = array(
                          /* 'system/application', */
                          /* 'plaroma-web-vhost/40c074f1c862da07d2a392dfdd89dd23',*/
                          'ci_bandwidthmeter',
                          'ci_betsprint',
                          'ci_fred',
                          'ci_jokes',      
                          'ci_plaroma',
                          'ci_rentaroofbox'
                        );  
      
              $ddstart = "<dd>&lt;input type='radio' name='application' value='" ; // ."'  /&gt;" ;
              foreach($b as $row):
                echo $ddstart . $row ."'  />$row</dd>";
              endforeach;  
           ?&gt;  
         <dt>
            <br />
            &lt;input type="submit" value="&nbsp;&nbsp;Continue&nbsp;&nbsp;" class='button' /&gt;
            <br />
         </dt>
        
        </dl>
    &lt;/form&gt;
  </div>
&lt;/body&gt;
&lt;/html&gt;
&nbsp;
I am curious to know if anyone else has done something similar?
&nbsp;
Cheers,
&nbsp;
John_Betong
&nbsp;
&nbsp;


  Installing / Integrate FCKEditor as form_helper extension.
Posted by: El Forum - 08-23-2007, 09:13 AM - No Replies

[eluser]flyer[/eluser]
Hi,

Thought someone might find this useful. Some of the other FCKEditor/CodeIgniter integrations seem to want to add it as a library or otherwise. The way I see it, its basically a fancy text area, and should be treated as such. Hence integration into the form helper.

It has 3 basic steps:

Step 1.

Download and unzip the FCKEditor application into a directory of your choice.
I prefer either the /system/plugins/fckeditor/ or /system/application/plugins/fckeditor/ or my choice - external/fckeditor/


Step 2.

Add following FCKEditor settings to the system/application/config/config.php file:

Code:
/*
|--------------------------------------------------------------------------
| FCKEditor Basepath
|--------------------------------------------------------------------------
|
| The path from your site's root in which the fckeditor folder is. Note
| this is from the site's root, not the file system root. Also note the
| required slashes at start and finish.
|
|    e.g. /fckeditor/ or /system/plugins/fckeditor/  etc...
|
*/
$config['fckeditor_basepath']    = "/system/plugins/fckeditor/";

/*
|--------------------------------------------------------------------------
| FCKEditor Toolbar Set Default
|--------------------------------------------------------------------------
|
| The default Toolbar set to be used for FCKEditor across your site. Leave
| as empty string or comment out if your happy enough with the standard
| default.
|
*/
$config['fckeditor_toolbarset_default'] = 'Default';

Step 3.

Finally the new helper class. The following code should be placed in a file named:
/system/application/helpers/form_helper.php
Note this will override /system/helpers/form_helper.php but all functions are imported from here anyway, so no clash or reduced functionality should occur.

Code:
&lt;!--****** FILE /system/application/helpers/form_helper.php code ********--&gt;

&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

include_once( BASEPATH . '/helpers/form_helper'.EXT);

function form_fckeditor($data = '', $value = '', $extra = '')
{
    $CI =& get_instance();

    $fckeditor_basepath = $CI->config->item('fckeditor_basepath');
    
    require_once( $_SERVER["DOCUMENT_ROOT"] . $fckeditor_basepath. 'fckeditor.php' );
    
    $instanceName = ( is_array($data) && isset($data['name'])  ) ? $data['name'] : $data;
    $fckeditor = new FCKeditor($instanceName);
    
    if( $fckeditor->IsCompatible() )
    {
        $fckeditor->Value = html_entity_decode($value);
        $fckeditor->BasePath = $fckeditor_basepath;
        if( $fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default'))
                $fckeditor->ToolbarSet = $fckeditor_toolbarset;
        
        if( is_array($data) )
        {
            if( isset($data['value']) )
                $fckeditor->Value = html_entity_decode($data['value']);
            if( isset($data['basepath']) )
                $fckeditor->BasePath = $data['basepath'];
            if( isset($data['toolbarset']) )
                $fckeditor->ToolbarSet = $data['toolbarset'];
            if( isset($data['width']) )
                $fckeditor->Width = $data['width'];
            if( isset($data['height']) )
                $fckeditor->Height = $data['height'];
        }
        
        
        return $fckeditor->CreateHtml();
    }
    else
    {
        return form_textarea( $data, $value, $extra );
    }
}

?&gt;

form_fckeditor() Usage

This function is identical in nearly all respects to the form_textarea() function above except that it generates a FCKEditor editor instead of a textarea and it takes some additional $data fields. So please read the Form Helper section of the Code Igniter User Guide!

However, the FCKEditor takes $data fields- 'name' 'basepath', 'toolbarset', 'width', 'height' which are passed on to the FCKEditor.php class from the FCKEditor application download. These $data fields control the settings for the editor, rather than any that you would normally pass to form_textarea() e.g. 'rows' or 'cols'.

Code:
***** USAGE ******

// e.g. 1
echo form_fckeditor('textareaName', $value );


// e.g. 2
$data = array(
              'name'        => 'textareaName2',
              'id'          => 'textareaName2',
              'toolbarset'  => 'Advanced',
              'basepath'    => '/fckeditor/',
              'width'       => '100%',
              'height'      => '200'
    );

echo form_fckeditor( $data );

It is important to know the regular $data fields that you would normal supply to the form_textarea() should also be provided if you wish to alter the defaults. This is because if the user's browser is not compatible with FCKEditor e.g. no javascript, the form_fckeditor() falls back to form_textarea().

Also, the 3rd parameter of the function, $extra, is discarded unless the function falls back to form_textarea().

Note that this helper technique requires zero modification of the FCKEditor source files, so when it comes to updates to FCKEditor, then your not going to have to remember where you've changed. Personally, I highly value keeping plugin code as independent as possible.

Any other changes to customize FCKEditor can be done exactly as per the FCKEditor documentation on its website.

Let me know what u think. Hopefully fairly easy to see what I've done!


Eddie

PS. Please don't ask about customizing FCKEditor. All customisation other than that above occurs within the FCKEditor source directory and better left for the FCKEditor support site Smile


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

Username
  

Password
  





Latest Threads
Changing Session cookie -...
by paulbalandan
30 minutes ago
hot-reload side effects s...
by PaulC
5 hours ago
using app/Config/App.php ...
by sam547
Yesterday, 03:04 PM
Setting baseURL in Regist...
by grimpirate
05-15-2025, 02:20 PM
CRUD Code Generator
by DeanE10
05-15-2025, 05:31 AM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM
Update from 4.6.0 to 4.6....
by FlavioSuar
05-13-2025, 04:17 AM
Sessions old files are de...
by InsiteFX
05-12-2025, 10:30 PM
Ajax post failing with Ty...
by PaulC
05-12-2025, 12:23 AM

Forum Statistics
» Members: 146,541
» Latest member: pavestepcom9
» Forum threads: 78,392
» Forum posts: 379,464

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB