Welcome Guest, Not a member yet? Register   Sign In
  Need help with an annoying FCKeditor problem
Posted by: El Forum - 10-11-2007, 03:08 PM - No Replies

[eluser]Matthew Pennell[/eluser]
I'm using FCKeditor to handle text entry in the backend of a site, and the client has uncovered a particular bug when creating email links. Basically, any spaces in the subject and body of the email are replaced by ' ;' (space semi-colon), so:

Code:
<a href="mailto:[email protected]?subject=this%20is%20a%20test&body=Hello%20World">email me</a>

becomes

Code:
<a href="mailto:[email protected]?subject=this ;is ;a ;test&body=Hello ;World">email me</a>

Obviously not very useful. When I spit out the $_POST array in index.php, the %20 space characters are present and correct, so it's something that CodeIgniter is doing between the data being submitted and it arriving in the controller - anyone know where I need to look to address this (presumably trying to be helpful) cleaning of POST data?


  Calendar: Linked Date
Posted by: El Forum - 10-11-2007, 12:11 PM - No Replies

[eluser]Kemik[/eluser]
Hello all,

I want to create a link on every date of the month. Is there any way of doing this without making an array entry for each day of the month? (So 31 dates).

Here's my current code:

Code:
if ($this->uri->segment(4) === FALSE) {
            $y = date('Y');
            $m = date('n');
        } else {
            $y = $this->uri->segment(3);
            $m = $this->uri->segment(4);
        }
        
        $data['dates'] = array(
               1  => base_url() . "index.php/home/index/" . $y . "/" . $m . "/1/");

Thanks.


  Generating Dates & Times in Forms
Posted by: El Forum - 10-11-2007, 11:23 AM - No Replies

[eluser]RobbieL[/eluser]
This isn't really a CI specific question, but I'm doing the project in CI so I thought I'd give here a shot.

I've got a simple form that the user needs to fill out. In it, the user has to select a time and a date. I was planning on having them both done with drop down boxes. Two drop down boxes for the time (one with the hour, one with the minutes) and three for the date (one for the day, month and year).

So what's the easiest way of getting this done? For the times, I thought a FOR loop going from 00 to 23 for the hours, and 00 to 59 for the minutes. But I'm pretty stumped for the date. Is manually entering them into the drop down box selection the best way?


  CodeIgniter Helper/Plugin Directories
Posted by: El Forum - 10-11-2007, 11:11 AM - No Replies

[eluser]Unknown[/eluser]
Does CodeIgniter have a directory of Helper and Plugin applications users have submitted? A quick Google/forum search didn't turn anything up.

Cheers,
Todd


  The Next CodeIgniter Open Source Project...
Posted by: El Forum - 10-11-2007, 10:41 AM - No Replies

[eluser]danoph[/eluser]
What open source application do you think the community needs next? There are a few authentication, scaffolding, CRUD systems, etc.

What would be the most valuable to you as open source?


  Two base_url possible?
Posted by: El Forum - 10-11-2007, 08:13 AM - No Replies

[eluser]bjora857[/eluser]
When I code I use a local webserver. And when Im happy with my code I upload it to my web host. Nothing strange with that...

But every time I upload I have to change the commenting in my config file.

$config['base_url'] = "http://localhost:8888/";
//$config['base_url'] = "http://www.mydomain.com/";

Is there a better way?

something like this

psuedo code

if (isValid(http://localhost:8888/))
{$config['base_url'] = "http://localhost:8888/";}
else
{$config['base_url'] = "http://www.mydomain.com/;}


  Multiple database connection problem
Posted by: El Forum - 10-11-2007, 07:53 AM - No Replies

[eluser]Unknown[/eluser]
I am not able to open the multiple database connection using hooks.Here is the method I am using for this.

function loadDatabaseInfo()
{
// set the XML file name as a PHP string
$databaseConfList = getcwd()."/conf/database.xml" ;
// load the XML file
$xml = @simplexml_load_file($databaseConfList) or die ("no file loaded") ;
// assign the listName element to a string

// $xml->databaseGroup[1]->StudioName = "hello1";
// $filedata = $xml->asXML();
//
// file_put_contents($databaseConfList,$filedata);
$i = 0;
foreach ($xml->databaseGroup as $studioList)
{
$config = null;
$config['name'] = $studioList->Name;
$config['hostname'] = $studioList->configuration->Server;
$config['username'] = $studioList->configuration->DBUser;
$config['password'] = $studioList->configuration->DBUser;
$config['database'] = $studioList->configuration->DBPassword;
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['active_r'] = TRUE;
$DB[i] = $this->load->database($config);
echo $i++;
}

return null;


Can anybody please suggest how to get this done.


  [help]problem with ci sessions
Posted by: El Forum - 10-11-2007, 07:45 AM - No Replies

[eluser]cesarius[/eluser]
Hello!
Ive got a problem here:
I want to have acsess to the site wich is located at a computer in internal network/
the name of it is netcomp
on an internet site (www.xxx.ru) it all works fine but with this name i can not store session it says tha loggedin is rfalse however it must be true/// maybe you could help me how to configure config.php? here is mine:

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

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/
$config['base_url']    = "http://netcomp/";
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'session_cookie_name' = the name you want for the cookie
| 'encrypt_sess_cookie' = TRUE/FALSE (boolean).  Whether to encrypt the cookie
| 'session_expiration'  = the number of SECONDS you want the session to last.
|  by default sessions last 7200 seconds (two hours).  Set to zero for no expiration.
|
*/
$config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;

/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path'   =  Typically will be a forward slash
|
*/
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "kontsevoisb";
$config['cookie_path']        = "/";
thanks for your help


  Ideas for database structure / Dictionary
Posted by: El Forum - 10-11-2007, 07:22 AM - No Replies

[eluser]trice22[/eluser]
Hello and sorry, if this a bit of a vague topic, but I'm in the early stages of a new project and not really experienced with the development of database structures—so every input would be very welcome.

Here's what I want to do:
I'm planning on a small app. that will work a little like a dictionary. That means I've at least two languages (let's say English and German) and vocabulary for both of them.
That would call for two tables:

Code:
English with ID and word and
German with ID and word

And since one word (like "to put") can have more than one meaning ("setzen", "stellen", legen") I'll need a third table for the relations between table "English" and "German".

Something like
Code:
ID, ID_eng, ID_ger
.
Am I correct so far? Is there a better way to handle something like this?

Now here's my bigger problem:
The amount of languages is dynamic. Let's say, somebody could add French or Chinese.
How would I handle the relations then? If I'd have an extra table for each relation I'll very soon reach a gigantic amount of tables. There gotta be a better way.
Any ideas, links or general input to the dictionary-in-a-database topic?

I'm in the planning stage and very grateful for every idea.
Thanks a lot,
-trice

P.S.: I know this is not necessarily CI related, but since the app. is going to be developed with CI and everyone in here always very helpful, I'm still going to give it a shot.


  callback from model
Posted by: El Forum - 10-11-2007, 07:16 AM - No Replies

[eluser]smith[/eluser]
For those interested in keeping validation inside model. As you all know you can't use callback method from model, or you can but callback function has to be inside controller. I have tried something else, so you can use my method if you want:

make new validation.php that extends CI validation and put it in application/libraries:

MY_Validation.php

Code:
class MY_Validation extends CI_Validation {

    function MY_Validation()
    {
        parent::CI_Validation();
    }
    
    
    function additional_check($array)
    {
        // do something with your data, set error message, return false or true
    $this->set_message('additional_check', 'error');
    return false;
    }
}

in your controller construct load library and forms model:
controller:
Code:
$this->load->library('validation');
$this->load->model('forms');

in your model use callback as you would from controller, but without "callback_" prefix:

model:
Code:
$rules['some_field']   = "required|additional_check";

callback will work without any problem, and you get to keep validation inside model, forms in one model, callbacks in one library. I like it that way, it keeps my controllers pretty clean, so if anyone wants to use this too, be my guest Smile


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by PaulC
8 hours ago
CodeIgniter.com - Report ...
by Harry Lyre
9 hours ago
Setting baseURL in Regist...
by michalsn
Today, 12:09 AM
Update from 4.6.0 to 4.6....
by FlavioSuar
Yesterday, 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
intermittent smtp failure...
by InsiteFX
05-11-2025, 11:30 PM
MVC vs MVCS vs CodeIgnite...
by FlavioSuar
05-10-2025, 10:33 AM
CodeIgniter Shield 1.0.0 ...
by timesprayer
05-10-2025, 05:22 AM
Website Traffic Drop Afte...
by InsiteFX
05-10-2025, 04:23 AM

Forum Statistics
» Members: 145,988
» Latest member: yuristbfl
» Forum threads: 78,389
» Forum posts: 379,450

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB