Welcome Guest, Not a member yet? Register   Sign In
  Exists a CI User-Friends Library?
Posted by: El Forum - 07-23-2008, 01:50 PM - No Replies

[eluser]spherop[/eluser]
I am on first CI app. The tool will have a social network friends aspect. Currently am using the Facebook API and drawing login/friends from there. However, I have decided that FB is adding too much overhead and server inconsistency.

I am wondering if there's been any development of a friends library/plugin? Or do any of the currently popular CI auth libraries provide this? Another curiosity is whether any auth libs for CI have incorporated OpenID?


  Code Ignitor - Slow Rollout
Posted by: El Forum - 07-23-2008, 01:26 PM - Replies (7)

[eluser]ssharp[/eluser]
I'm interested in hearing this communities opinion on this.

I already have a large and established website. It currently does not use any MVC framework and is getting very bulky to maintain and each new feature just straps on another layer of duct tape. I'm getting ready to roll out a social network on the site that is coded entirely in CodeIgnitor. However, I don't just want to dump this into a subfolder, say "http:/wwww.mysite.com/social/". That would be easy but it seems like a terrible implementation. I'd like CI to sit in the root at "http://www.mysite.com". That way, I can continue to code new features off the same CI install as well as possibly begin converting the current code base into CI.

What are the best methods to go about doing this? I have probably 30 directories directly off the root, so whatever happens there, CI HAS to be able to ignore certain paths. Make sense? Thanks!


  controllers in Sub-folders + enable_query_strings
Posted by: El Forum - 07-23-2008, 01:07 PM - No Replies

[eluser]EugeneS[/eluser]
Hello,

mod rewrite is disabled so i have to use enable_query_strings = TRUE.
how to call controllers which are inside subfolders ?

controllers which are located in main Controllers folders i can call like

index.php?c=welcome&m=search

but how to be with controllers which are inside for example admin folder ?
how to call controller:
Controllers/admin/company.php

index.php?c=admin/company&m=add doesnt work ... any ideas ?


  Insert array into database
Posted by: El Forum - 07-23-2008, 12:38 PM - Replies (14)

[eluser]bohara[/eluser]
Hi,
I am trying to insert a array into my database. I had this working and I am not sure why it broke.

In my model I have this:

Code:
$reminder_id = $row['id'];
        
        for ($i = 0; $i <= count($_POST['bulb_type_id'])-1; $i++) {
            
                $sql = array(
                $this->reminder_id = $reminder_id,
                $this->quantity = $_POST['quantity'][$i][1],
                $this->bulb_type_id = $_POST['bulb_type_id'][$i][2],
                $this->shatterproof = $_POST['shatterproof'][$i][3],
                );
        
        }

$this->db->insert('line_items', $sql);

The array part of my form look like this: on the interface you can add more rows through AJAX that increment the the form values like [1][1], [1][2], [1][3], and so on.
Code:
<tbody id="container">
            <tr id="row0">
                <td>    
                    &lt;input type="text" name="quantity[0][1]" value="" maxlength="2" size="2"  /&gt;
                </td>
                <td>    
                    &lt;? echo form_dropdown('bulb_type_id[0][2]', $bulb_types); ?&gt;
                </td>
                <td>    
                    &lt;? echo form_checkbox('shatterproof[0][3]', 1, false); ?&gt;
                </td>
            </tr>
        </tbody>

I recieve the following errors:

----------------------------------------
A PHP Error was encountered

Severity: Notice

Message: Undefined index: shatterproof

Filename: models/reminder_model.php

Line Number: 67

----------------------------------------

An Error Was Encountered
Error Number: 1054

Unknown column '0' in 'field list'

INSERT INTO `line_items` (`0`, `1`, `2`, `3`) VALUES ('50', '1', '2', NULL)

-----------------------------------------

I hope this is enough information. Thanks in advance


  Trying to extend the Validation class issues
Posted by: El Forum - 07-23-2008, 12:30 PM - Replies (2)

[eluser]Unknown[/eluser]
I tried to extend the Validation class by putting this code in /application/libraries and called it MY_Validation.php. When I try to include the validation class the method in this class comes back with an error that it does not exist. Please be patient with me I am very new to CI and need some help!

This is the extension: in /application/libraries
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Validation extends CI_Validation {

function My_Validation()
{
parent::CI_Validation();
}

function set_default_values($data, $value=NULL)
{
if (is_array($data) == TRUE)
{
foreach($data as $field => $value)
{
$this->$field = $value;
$_POST[$field] = $value;
}
}
else
{
$this->$data = $value;
$_POST[$data] = $value;
}
}
}
?&gt;

This is the controller:
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Formtest extends Controller {

function Formtest()
{
parent::__construct();
}

function index()
{
$this->load->library('validation');
$this->load->helper('form');
$rules['text'] = 'required';
$rules['option'] = 'required';
$rules['select'] = 'required';
$rules['radio'] = 'required';
$this->validation->set_rules($rules);

$fields['text'] = 'text field';
$fields['select'] = 'select field';
$fields['check'] = 'check box field';
$fields['radio'] = 'radio field';
$this->validation->set_fields($fields);

if (count($_POST) == 0)
{ // For initial load set defualt values
$this->validation->set_default_values('text','hello world');
$this->validation->set_default_values('select', 'select2');
$this->validation->set_default_values('check', 'check2');
$this->validation->set_default_values('radio', '3');
}

if ($this->validation->run() == FALSE)
{
$this->load->view('formtest_view');
}
else
{
$this->load->view('formtest_view');
}
}

}
?&gt;

When trying to access $this->validation->set_default_values('text','hello World') I get the following error:
Fatal error: Call to undefined method CI_Validation:Confusedet_default_values() in /home/hector/www/test/ce/system/application/controllers/formtest.php on line 28

Note: I followed the user guide to follow this and don't understand why the method or my extension is not being loaded by CI ver. 1.6.3

Thanks in advance!


  how can I return all users with names that DON'T begin with a letter?
Posted by: El Forum - 07-23-2008, 12:04 PM - Replies (5)

[eluser]got 2 doodle[/eluser]
The title says it all, I want to return all users that have chosen to have a user name that does not start with a letter.

This is used for a series of anchor's to allow selection of all users with names that start with A,B,C... etc.. Each anchor also has a count of the users within that letter group.

So in the controller I have A-Z working.

Code:
for ($i='65'; $i<='90'; $i++)
                    {
                    $letter = chr($i);
                    $temp = $this->band_data->count_where_bandname_starts_with($letter);
                    $data ['count_'] ["$letter"] = $temp;
                    }

in my model
Code:
function count_where_bandname_starts_with($letter = NULL){
      $query = $this->db->where('active = 1');
      $query = $this->db->where('group = 4');
     if($letter <> NULL){
     $query = $this->db->like('username', $letter,'after');
        }
    $query = $this->db->get($this->config->item('backendpro_table_prefix').'users');
    if ($query->num_rows() < 0){return '0'; } else { return $query->num_rows();} ;
}

So what can I do to get all the folks who use wierd names (these are names of musical groups)
like
1of_four or 2cool4words or whatever!

any help would be much appreciated

doodle


  Is any JSON library or Helper available for CI
Posted by: El Forum - 07-23-2008, 11:51 AM - Replies (1)

[eluser]Blue Sapphire[/eluser]
Hi!
Is any JSON library or Helper available for CI?

Thanks in advance


  Codeigniter in PHP5
Posted by: El Forum - 07-23-2008, 11:30 AM - Replies (11)

[eluser]johnmiller[/eluser]
Hey..

Can I use codeigniter in PHP5?

Can I use all the PHP5 features if I use codeigniter in PHP5?


  best practices? db call for every page
Posted by: El Forum - 07-23-2008, 11:10 AM - Replies (3)

[eluser]chrisco23[/eluser]
Hi,

I need to make one db query to populate part of a navigation menu used on every page.

I'd like to not put this in the view file, so currently I have the same 3 lines of code stuck into every controller. I'd like to not have to do this (and not have to remember to do this).

What's a better way?


Thanks,
Chris


  build big complex project with CI? (honest views from experienced devs)
Posted by: El Forum - 07-23-2008, 11:03 AM - Replies (25)

[eluser]johndoe123[/eluser]
i need advices from experienced devs... do u honestly think I can build a big complex project with CI?

the project has lots of things
- multilanguage
- extensive contents (of many different kinds)
- very in-depth search
- the contents should be classified with many attributes(for searching)(e.g. by location,regions,type,etc...)
- and many other small but quite in-depth features....(e.g. an advanced image gallery with all images of the site(e.g. images found in articles etc...))
- frontend and admin(be able to administrate almost everything)

- i wanna know if CI will honestly increase my speed of production?
- how to manage multilanguage?
- i was thinking about doing something like the framework of joomla but don't know
- do u know any good simple way to do a single template to use for every page? (like joomla again)..

I haven't used CI for any projects... actually i used it very little, i just read the docu which seems nice...

and another question, read in many articles complaining that u can't use query string.... is there a way to use it actually? (necessary(or preferable) for search right?)

Edit:
found this fix for querystring (modify config.php)
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;


anyone tried it? are there drawbacks using that method? it looks i can use $_GET normally with these configs...(yet many people say that u need to use tricks to use querystrings) but this method is not a trick but just a configuration...


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

Username
  

Password
  





Latest Threads
Limiting Stack Trace Erro...
by byrallier
2 hours ago
Bug with sessions CI 4.5....
by ALTITUDE_DEV
2 hours ago
codeigniter 3.0.1 equiped...
by JustJohnQ
6 hours ago
Display a custom error if...
by b126
10 hours ago
Type error in SYSTEMPATH\...
by DXArc
10 hours ago
v4.5.1 Bug Fix Released
by LP_bnss
11 hours ago
Retaining search variable...
by Bosborne
Today, 03:20 AM
Getting supportedLocales ...
by InsiteFX
Today, 12:24 AM
composer didn't update to...
by Sarog
Yesterday, 03:56 PM
Pipe on url modified in %
by kenjis
Yesterday, 02:52 PM

Forum Statistics
» Members: 85,077
» Latest member: gxknight
» Forum threads: 77,572
» Forum posts: 375,955

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB