Welcome Guest, Not a member yet? Register   Sign In
  changing index.php to index
Posted by: El Forum - 11-17-2008, 04:25 PM - Replies (6)

[eluser]spedax[/eluser]
I renamed my index.php to mynewindex

then I created a .htaccess file and placed it in the same folder

and I put this code in it.

Code:
<Files mynewindex>
AcceptPathInfo on
SetOutputFilter PHP
SetInputFilter PHP
</Files>

I found this is somewhere on the internet, but have no clue why it isen't working.

Any help is greatly appriciated.

edit : also tried nummerous other guides but nothing seems to work

i Set $config[‘index_page’] to an empty string

and my .htaccess looks like this

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #This last condition enables access to the images and css folders, and the robots.txt file
    #Submitted by Michael Radlmaier (mradlmaier)
    RewriteCond $1 !^(index\.php|images|robots\.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

My index.php is still called index.php.

anyone got any tips to get this to work ?

thanks


  Problem Exending A Controller
Posted by: El Forum - 11-17-2008, 04:20 PM - No Replies

[eluser]Unknown[/eluser]
This is a very strange problem that took me several hours to workaround. I am wondering what could be the root cause of the issue.

Right now I have two controllers, lets call them Car and Honda

Class Car extends Controller {...}

and

Class Honda extends Car {...}

on my local machine (Mac, Apache, PHP 5.2.5, MySQL) everything works fine. I can call MyTestSite.com/Honda/create and a form appears. However, when I uploaded this to my live server (Linux, Apache, PHP 5.2.6, MySQL), and I make the same request MyLiveSite.com/Honda/create I basically get shown junk. It shows parts of my site without css (the base_url() is not getting called) and displays a string that no longer exists in my code base (I have searched).

So my workaround was to duplicate the Car class (lets call it Car2) and let the Honda class extend Car2, so we now have three classes:

Class Car extends Controller {...}

Class Car2 extends Controller {...} <-- the code is cut and pasted from the Car class

Class Honda extends Car2 {...}

For some unknown reason to me, calling MyLiveSite.com/Honda/create now shows the correct form.

I honestly have no idea what is going on, and my logs are not showing me anything (I even added some log_message commands). Does anyone have an idea what could be causing this issue and what I can do about it?

To make this even more fun, when someone requests MyLiveSite.com/Honda/create, before the fix that is, it would send me around 7 blank emails. These emails are in someway related to the FreakAuth component.

Thanks in advance!!


  Extended Loader Class for Changing Model Object Name
Posted by: El Forum - 11-17-2008, 04:15 PM - No Replies

[eluser]Unknown[/eluser]
I wanted to be able to change the object name of a Model that was being loaded in an array. Specifically, I was autoloading multiple models. When loading models in an array I couldn't change the name of the object that the model was loaded as, so I extended the Loader class library. Hope this helps someone.
Usage:

Code:
$this->load->model(array('model1'=>'model1_name', 'model2'));

The only changes that needed to be made were:
Code:
if (is_array($model))
{
    foreach($model as $babe=>$name)
    {
        //  Does the babe have a name? If not just call her babe.
        if($babe == '') {
            $babe = $name;
        }
        $this->model($babe, $name);    
    }
    return;
}

To implement, create a file called MY_Loader.php in /system/application/libraries.
Code:
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_loader {
    function model($model, $name = '', $db_conn = FALSE)
    {        
        if (is_array($model))
        {
            foreach($model as $babe=>$name)
            {
                //  Does the babe have a name? If not just call her babe.
                if($babe == '') {
                    $babe = $name;
                }
                $this->model($babe, $name);    
            }
            return;
        }

        if ($model == '')
        {
            return;
        }
    
        // Is the model in a sub-folder? If so, parse out the filename and path.
        if (strpos($model, '/') === FALSE)
        {
            $path = '';
        }
        else
        {
            $x = explode('/', $model);
            $model = end($x);            
            unset($x[count($x)-1]);
            $path = implode('/', $x).'/';
        }
    
        if ($name == '')
        {
            $name = $model;
        }
        
        if (in_array($name, $this->_ci_models, TRUE))
        {
            return;
        }
        
        $CI =& get_instance();
        if (isset($CI->$name))
        {
            show_error('The model name you are loading is the name of a resource that is already being used: '.$name);
        }
    
        $model = strtolower($model);
        
        if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT))
        {
            show_error('Unable to locate the model you have specified: '.$model);
        }
                
        if ($db_conn !== FALSE AND ! class_exists('CI_DB'))
        {
            if ($db_conn === TRUE)
                $db_conn = '';
        
            $CI->load->database($db_conn, FALSE, TRUE);
        }
    
        if ( ! class_exists('Model'))
        {
            load_class('Model', FALSE);
        }

        require_once(APPPATH.'models/'.$path.$model.EXT);

        $model = ucfirst($model);
                
        $CI->$name = new $model();
        $CI->$name->_assign_libraries();
        
        $this->_ci_models[] = $name;    
    }

}
?&gt;


  code extinguisher (codex) login system
Posted by: El Forum - 11-17-2008, 04:13 PM - Replies (3)

[eluser]ocergyNohtna[/eluser]
is there an easy way to disable the login system in codex and simply use only a htpasswd protection method? anyone??


  Redux Auth: How do you redirect after login? [SOLVED]
Posted by: El Forum - 11-17-2008, 03:01 PM - Replies (1)

[eluser]dallen33[/eluser]
If a user logs in and they are in group 2, how do I send them to a particular page? I'm just confused about this. I thought I'd do it here:

Code:
switch ($redux)
            {
                case 'NOT_ACTIVATED':
                    # code...
                    break;
                case 'BANNED':
                    # code...
                    break;
                case false:
                    # code...
                    break;
                case true:
                    # code...
                    break;
            }
But everything I try doesn't seem to work. I'm obviously new. Tongue


  installation trouble
Posted by: El Forum - 11-17-2008, 01:50 PM - No Replies

[eluser]AlexC33[/eluser]
Hi,

I'm having quite some trouble with this fresh installation of CI. It's the 4th site I'm installing using CI, but the first that had me pulling my hairs from my head!!! The first three were on linux, and this one on windows xp pro.

I'm using apache 2.2, and php5.2.6 (both freshly installed).

I'm using a vhost configuration :

Code:
<VirtualHost *>
    DocumentRoot "D:/www/noel_2008/trunk/www"
    ServerName noel.prog.ca
    ServerAdmin [email protected]
    AddDefaultCharset "utf-8"
    ErrorLog "logs/noel.log"
   CustomLog "logs/noel.log" common
    <Directory "D:/www/noel_2008/trunk/www">
      Options All
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    DirectoryIndex index.php
</VirtualHost>

if I put a test.php file with a phpinfo inside, I can see that everything is correct. but when I use the index.php of CI, I get a http 500 error. I checked the paths, and when I do this :
Code:
echo BASEPATH.'codeigniter/CodeIgniter'.EXT;
I get
Code:
D:\www\noel_2008\trunk\www/system/codeigniter/CodeIgniter.php

there is a mix between "/" and "\". I've tried to replace both completly, but it's not working. When I have only "/" or only "\", I still get the http 500 page.

It's driving me crazy. if anyone can help me, it would be much appreciated.

Thanks,

AlexC.


  css framework/library recommendations?
Posted by: El Forum - 11-17-2008, 01:25 PM - Replies (14)

[eluser]edwardmolasses[/eluser]
hi everyone,

I was wondering if anyone had any recommendations for a css framework or library that they start projects with? I'd like something that does some decent css reset a few other useful things like columns and such, but that doesn't have too many bells and whistles and is easily manageable. I guess i'm looking for the code igniter of css frameworks!

I looked at blueprint and it seems really big and complex to me. I'd prefer something in one file. Though i could be wrong about blueprint, maybe i just haven't read enough yet. I found one called malo, which seems pretty small and useful, but it also looks pretty new so i don't know how popular it is.

Does anyone have a css framework that they really love?

thanks!


  Problems extending the Form_validation (CI 1.7)
Posted by: El Forum - 11-17-2008, 01:11 PM - Replies (7)

[eluser]Nonox[/eluser]
Hi.
I have some problems extending the new Form_validation, I followed the same process that I did with CI 1.6.3, below is the code example:

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

class MY_Form_validation extends CI_Form_validation {

    function MY_Form_validation()
    {
        parent::CI_Form_validation();
    }

    function test($str)
    {
        return FALSE;
    }
}
// END Validation Class
?&gt;

How you can see is simple, but nothing happen, someone knows if I'm doing something wrong?


  Some VERY basic Modules Extensions (ME) questions.
Posted by: El Forum - 11-17-2008, 12:12 PM - Replies (1)

[eluser]dpgtfc[/eluser]
Hello all. I like to consider myself a competent PHP programmer, but sometimes I feel like I don't get things at all. I have worked on several projects (school + SMALL scale projects at work) over the last 2-3 years, but I have worked up from a basic spaghetti code procedural style to writing my own templating system and moving towards an OOP approach. My newest endeavor is switching to MVC and now to HMVC with ME. So please try and bear with my simple questions as I try to get this concept down. Smile

After following the Wiki to install ME, I like it already. However, right now it is just a directory structure and I want to get into the core of writing and installing modules. So here are my questions.

1. What exactly is a module, a library class? That is my current understanding anyway (in respect to file types).
2. For each "module" directory structure, say Module1 and Module2 are my modules, do I put the Module in the respective Module library sub-directory?
3. Does each "module" have to have ONLY 1 module library class file?
4. What do I do to get started? I want a Home module and an Auth Module for instance. How do I convert my regular auth_model with all the respective controllers and views (login, registration, change password forms, etc) over into a "Module"

I will have more questions too if anybody is kind enough to answer these first. I really did do a search and found some topics (such as http://ellislab.com/forums/viewthread/73401/), but the examples are further along than where I am I think, and just confuse me. However, if somebody has links to posts or blogs or tutorials I will gladly read them.

I feel incredibly dense right now, and could certainly use some guidance.

Thanks in Advance,

Daniel


  Relationship Mapping between Users and Data, like OpenSourceFood.com
Posted by: El Forum - 11-17-2008, 12:08 PM - Replies (1)

[eluser]Unknown[/eluser]
I am working on my first test application using the CI framework, based in general concept on Yong Fook's opensourcefood.com, which is a CodeIgniter application. The relationship is one to many, like OSF's users submitting many recipes. I asked nicely of Yong Fook for examples, a link or book to where he learned from, or code samples so I could learn, but he declined to help.

My basic issue at this point is where to look for good guidance, tutorials and examples of mapping users to data using CI, at each end, MV&C. I have installed and customized FreakAuth as a starting point for getting user's registered and am currently looking to modify their profiles with the linkages to data they submit but don't know where to go...

Help, please!


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

Username
  

Password
  





Latest Threads
Integrating Bootstrap 5 i...
by tarcisiodev1
49 minutes ago
Asset Minification Packag...
by tarcisiodev1
55 minutes ago
Modify users data as an a...
by luckmoshy
1 hour ago
Is it possible to go back...
by ejimenezo
6 hours ago
Error / Shield 1.0.3 + Ci...
by kcs
10 hours ago
SQL server connection not...
by davis.lasis
10 hours ago
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,495
» Latest member: qh88lode
» Forum threads: 77,586
» Forum posts: 376,024

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB