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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,441
» Latest member: sushant
» Forum threads: 65,877
» Forum posts: 413,880

Full Statistics

Latest Threads
Where to store static arr...
Forum: General Help
4 minutes ago
» Replies: 3   » Views: 21
Unsetting Session In Arra...
Forum: General Help
1 hour ago
» Replies: 1   » Views: 55
XML error: Invalid docume...
Forum: CodeIgniter 2.x
3 hours ago
» Replies: 4   » Views: 80
CSV Importing Advice
Forum: General Help
9 hours ago
» Replies: 6   » Views: 192
Are there any CodeIgniter...
Forum: Jobs
Yesterday, 11:24 PM
» Replies: 4   » Views: 190
Redirect doesn't work wit...
Forum: General Help
Yesterday, 10:40 PM
» Replies: 7   » Views: 355
How to format template?
Forum: Model-View-Controller
Yesterday, 03:59 PM
» Replies: 6   » Views: 360
MongoCollection::update()...
Forum: General Help
Yesterday, 02:38 PM
» Replies: 0   » Views: 45
How to Get Banned
Forum: News & Discussion
Yesterday, 12:08 PM
» Replies: 12   » Views: 7,351
Create custom link url fo...
Forum: General Help
Yesterday, 11:47 AM
» Replies: 5   » Views: 219

 
  FreakAuth_light error: Unable to load the requested file: content/turned_off.php
Posted by: El Forum - 07-03-2007, 08:51 PM - Forum: Archived General Discussion - Replies (2)

[eluser]Unknown[/eluser]
Hey everyone,

I've tried installing CI and FreakAuth_light three times now and I keep getting an error such as: Unable to load the requested file: content/turned_off.php when I try to run http://localhost:8888/auth

Anyone run into this problem before?

Thanks,
Kevin


  email->attach() attaching file twice
Posted by: El Forum - 07-03-2007, 06:00 PM - Forum: Archived Development & Programming - Replies (5)

[eluser]ImageSmith[/eluser]
Well this is a bit of a doozie. I'm sure it is a simple fix but I'm not seeing it right now :ohh:
I am generating 2 emails as a result of a form submission (validated, etc). One email to the client, one to the site owner / organisation. I have a function for each email type (client, org).
The form result has been written into a PDF using FPDF.
The pdf is attached to both emails. However (this is the odd thing), the pdf is attaching to the org email twice :-S .
I have called the clear method in each function, but the issue persists.
Here are the mail functions:

Code:
function _generate_client_email($message_view,$subject,$attachment = '')
{
  if (!$this->allow_email_send) { // set in config file
    return;
  }
  $ci =& get_instance();
  $ci->load->library('email');
  
  $config['mailtype'] = 'html';
  $ci->email->clear();
  $ci->email->initialize($config);
  
  $ci->email->to($ci->validation->email);
  $ci->email->from($ci->config->item('enquiry_form_recipient'));
  $ci->email->subject($subject);
  $ci->email->message($ci->load->view($message_view,'',true));
  $ci->email->set_alt_message($ci->load->view($message_view.'_plain','',true));
  if ($attachment) {
    $ci->email->attach($attachment);
  }
  $ci->email->send();
}

function _generate_org_email($message_view,$subject = 'Website Email',$params = '',$attachment = '')
{
  if (!$this->allow_email_send) { // set in config file
    return;
  }
  $ci =& get_instance();
  $ci->load->library('email');
  
  $params['from_name'] = $params['from_name'] ? $params['from_name'] : $ci->validation->first_name.' '.$ci->validation->last_name;
  
  $config['mailtype'] = 'html';
  $ci->email->clear();
  $ci->email->initialize($config);
  
  $ci->email->from($ci->validation->email,$params['from_name']);
  $ci->email->to($ci->config->item('enquiry_form_recipient'));
  $ci->email->subject($subject);
  $ci->email->message($ci->load->view($message_view,$params,true));
  $ci->email->set_alt_message($ci->load->view($message_view.'_plain','',true));

  if ($attachment) {
    $ci->email->attach($attachment);
  }
  $ci->email->send();
}
The client function is called first.

EDIT - if I call the org function first then I get 2 attachments in the client email.
Is there something that I should be clearing further here?


  Two conceptual questions (about models and controllers)
Posted by: El Forum - 07-03-2007, 05:16 PM - Forum: Archived General Discussion - Replies (15)

[eluser]Marcus Cavalcanti[/eluser]
CI People,

I have two questions and i think they can help me.

First question:

I have a site with frontend (users view) and backend (admin view), probably i need to use the models in this two cases (backend and frontend). My question is: How to use the same models in this two cases?

Second question:

In my fronted, my site have’s a header, menu, content and footer, it is a classic model site, and the unique container has change is the content. Mu question: The best way to make this is create a “My_Controller” that extends the CI Controller, and the pages Controlllers (blog, forum, contact) extends “My_Controller”?

Thanks!

ps: sorry for my poor english Smile


  Database query with multiple tables
Posted by: El Forum - 07-03-2007, 04:40 PM - Forum: Archived Libraries & Helpers - Replies (1)

[eluser]cayasso[/eluser]
Is there a way to convert this query that are using two tables by using the Active Record Class

Code:
$query = $this->db->query('SELECT * FROM lkx_text, lkx_page WHERE lkx_page.pg_id = '.$pdid.' AND lkx_text.pg_id = lkx_page.pg_id');


for example this code

Code:
$query = $this->db->query('SELECT * FROM table1 WHERE table1_id = '.$var_id);

can be replaced with this

Code:
$this->db->where('table1_id', $var_id);
$query = $this->db->get('table1');

where you don't need to add the SELECT because it does it automatically. but how to do this with 2 tables.

I am newbie so have patient.

Thanks in advance for your help.


  [FIXED] Routes Help
Posted by: El Forum - 07-03-2007, 04:26 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]Phil Sturgeon[/eluser]
Ok so it turns out routes are my damn foe. I have used them many times but now and then the damn things just wont work!!

What the hell is wrong with:

Quote:$routes['games/list/:any'] = 'games/index';
$routes['games/list/:any/:any'] = 'games/index';
$routes['games/list/:any'] = 'games';
$routes['games/list/:any/:any'] = 'games';
$routes['games/list'] = 'games';
$routes['games/list'] = 'games/index';
$routes['games/list/'] = 'games';
$routes['games/list/'] = 'games/index/';


None of those bloody rules work!! Surely one of them is right? I just have a url like:

Quote:games/list/ps3/all

and I want it to use

Quote:controller: games; method:index; param1:ps3; param2:all;

Anyone?


  validation Custom MSG
Posted by: El Forum - 07-03-2007, 02:35 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]MMCCQQ[/eluser]
hi!

i got some doubts. about validation Library.


this is my login function

Code:
function Login()
    {
    
$rules['username'] = "required";
$rules['password'] = "required";
    
        $this->validation->set_rules($rules);
    
     $fields['username'] = 'Username';
    $fields['password'] = 'Password';
    
    $this->validation->set_fields($fields);
        
    if ($this->validation->run() == FALSE)
    {
        $this->_run('account/login_view');
    }
    else
    {
        
         $this->db->where('username', $_POST['username']);
         $this->db->where('password', $_POST['password']);
     $query =$this->db->get('member');
     if ($query->num_rows() > 0){
        $row = $query->row();
        $data = array(
        'username' => $_POST['username'],
        'id'       => $row->id,
        'logged_in' => TRUE
        );
         $this->session->set_userdata($data);
         redirect('../home/');
    }else{
        
        $this->_run('account/login_view');
        
        
    
    }
    
     }
    }

i wanna send a Custom Msg when Username and Password dont match. how can i do this?

i added this
Code:
$this->validation->set_message('macth', 'Username and password don macth');

but dont work!

how?


  Two trivial questions (about models and controllers)
Posted by: El Forum - 07-03-2007, 01:23 PM - Forum: Archived Development & Programming - Replies (8)

[eluser]Marcus Cavalcanti[/eluser]
CI People,

I have two questions and i think they can help me.

First question:

I have a site with frontend (users view) and backend (admin view), probably i need to use the models in this two cases (backend and frontend). My question is: How to use the same models in this two cases?

Second question:

In my fronted, my site have's a header, menu, content and footer, it is a classic model site, and the unique container has change is the content. Mu question: The best way to make this is create a "My_Controller" that extends the CI Controller, and the pages Controlllers (blog, forum, contact) extends "My_Controller"?

Thanks!


  Help! GD Support enabled, CI tells me its not
Posted by: El Forum - 07-03-2007, 09:58 AM - Forum: Archived Development & Programming - Replies (12)

[eluser]herbageonion[/eluser]
Hi, I have GD Support enabled on my server but CI tells me:

Quote:Your server does not support the GD function required to process this type of image.

Code From Controller:
Code:
$img_config['image_library']  = 'GD2';
$img_config['source_image']   = $file_data['full_path'];
$img_config['create_thumb']   = TRUE;
$img_config['maintain_ratio'] = TRUE;
$img_config['width']          = 100;
$img_config['height']         = 100;
                    
$this->load->library('image_lib', $img_config);
if ( ! $this->image_lib->resize() )
{
    echo $this->image_lib->display_errors();
}
else
{
    // Save
}

From phpinfo():
Code:
GD Support: enabled
GD Version: bundled (2.0.28 compatible)
FreeType Support: enabled
FreeType Linkage: with freetype
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled
XBM Support: enabled

Can anyone tell me what the problem is?

Cheers
- E


  Model extending CI_DB_active_record (Please Help Rick, Derek)
Posted by: El Forum - 07-03-2007, 08:27 AM - Forum: Archived General Discussion - Replies (6)

[eluser]Maurice Calhoun[/eluser]
Active Record has a method $this->db->get();

Quote:Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table

But this does not make any sense to do this

Here is my Conroller
Code:
class Blog extends Controller{

    function Blog(){

        parent::Controller();
        $this->load->model('Post','post');

    }

    function index(){
      $all_posts = $this->post->get('posts'); // This do not make sense
      $last_ten_posts = $this->post->get_last_ten(); // This make sense
    }

}

Here is my Model
Code:
class Post extends Model{

    function Post(){

         parent::Model();
         $this->load->database();

    }

    // This do not make sense
    function get($table_name){
         return $this->db->get($table_name);
    }

    // This make sense
    function get_last_ten(){
         return $this->db->get('POSTS',10,10);
    }

}

This seem redundant to me

Is there a way to do just this my Controller
Code:
class Blog extends Controller{

    function Blog(){

        parent::Controller();
        $this->load->model('Post','post');

    }

    function index(){
      $posts = $this->post->get('posts');
    }

}

Without have to recreate the same method that Active Record already has in the Model


  Routing to specific Controller with FreakAuth
Posted by: El Forum - 07-03-2007, 08:26 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]Robert M.[/eluser]
Hi all together.

I use FreakAuth_Light and want to route to a specific controller for various users. For example i have 4 users -->

Code:
superadmin
admin
other_guy
user
When each of this users now want to log them in they get individual routed.

I want to route the superadmin to the normal admin interface from FreakAuth. The admin to an other controller and the other_guy to his specific controller. How can i achive this?



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.