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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,099
» Latest member: dilipkaushik
» Forum threads: 67,027
» Forum posts: 419,722

Full Statistics

Latest Threads
PHP EXCEL CODIGNITER
Forum: Addins
19 minutes ago
» Replies: 2   » Views: 208
Fatal error:Default value...
Forum: General Help
1 hour ago
» Replies: 2   » Views: 45
CodeIgniter4-standard
Forum: News & Discussion
1 hour ago
» Replies: 3   » Views: 241
Team Error
Forum: General Help
2 hours ago
» Replies: 1   » Views: 31
Will CI4 include JQuery?
Forum: CodeIgniter 4 Discussion
5 hours ago
» Replies: 8   » Views: 392
file size and duration
Forum: Libraries & Helpers
7 hours ago
» Replies: 2   » Views: 800
[sysadmin] requirements t...
Forum: General Help
Yesterday, 03:08 PM
» Replies: 1   » Views: 98
PHP / jQuery Developer Ne...
Forum: Jobs
Yesterday, 11:15 AM
» Replies: 10   » Views: 4,118
Codeigniter Join query
Forum: General Help
Yesterday, 10:45 AM
» Replies: 3   » Views: 126
Query Builder Class
Forum: Libraries & Helpers
Yesterday, 08:00 AM
» Replies: 1   » Views: 117

 
  thumb quality sucks
Posted by: El Forum - 09-06-2007, 10:10 AM - Forum: Archived General Discussion - Replies (2)

[eluser]iniweb[/eluser]
My config:

Code:
$config['image_library'] = 'GD';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = FALSE;
$config['width'] = '100';
$config['height'] = '100';
$config['quality'] = '100%';
$config['thumb_marker'] = '_thumb';

Source pic: iniweb.ru/my_pc_2_original.jpg
Thumb pic: http://iniweb.ru/my_pc_2_original_thumb.jpg

How up quality?

P.S. English bad, sorry Smile


  Routes Questions
Posted by: El Forum - 09-06-2007, 09:40 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]Unknown[/eluser]
I setup a route for our admin views:
$route['admin/([a-z]+)/([a-z]+)'] = "$1/admin_$2";

Basically this would route something like admin/blog/edit to blog/admin_edit in our blog controller.

However, is there a way that I can do this so that I don't have to pass the index function name in the url? So that admin/blog/ would auto go to blog/admin_index ?

- Andy


  Page views counter + caching?
Posted by: El Forum - 09-06-2007, 08:23 AM - Forum: Archived Development & Programming - Replies (10)

[eluser]#1313[/eluser]
I want to count how many times each of my pages are loaded and also want to use caching. I didn't dig deeply into CI caching mechanisms and i don't know exactly how they are working, so i need an advice. Where is the best place in the code for my counter incrementing routines? I want to avoid situations when a page is loaded from cache and counter isn't triggered.

And second question in this topic: what should i do if i want to additionally display the number of page views on the page (i.e. "This page was viewed 123 times")? I read in the guide that some info such as benchmarking does not cache — how can i mimic this behavior?

Thanks in advance.


  htmldoc is corrupty! why?
Posted by: El Forum - 09-06-2007, 08:06 AM - Forum: Archived Development & Programming - Replies (6)

[eluser]andregufc[/eluser]
i use htmldoc to generate my pdf files. i installed the package, but the pdf docs is corrupts. why?


  Automatic Requirements Gatherer
Posted by: El Forum - 09-06-2007, 08:05 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]Unknown[/eluser]
Hi all,

Just discovered CodeIgniter and started to redo one of my sites using it, and I am already mighty impressed. I think within a month I will be nothing short of fanatical =)

While this post isn't actually about codeigniter, I noticed this community seems to be pretty active and friendly, so I was hoping I would share my ideas for a project I just started, and see if anyone has any feedback.

The project is for my undergraduate thesis in software engineering and I have decided to make an interview program.

The point of it would be to ask a client questions, and the output of which is both a formal requirements document (can subsequently be used to generate templates, quotes, estimate project length, etc.) and a transcript that includes their justifications and such - that the developer (ie. you) can read to get an understanding of their technical knowledge, expectations, etc.

Technically, I will deliver it using: HTML for the interface, AJAX for the communications, PHP for all the logic and XML for storing requirements, questions, etc.

I only started a few weeks ago, so it is obviously still in it's infant stages, but I am interested to hear what some other developers think of the idea. If it worked well, would you have your clients use it before your first meetings to discuss the scope of the project?

You can find a lot more detailed research and general fluff (along with a very basic prototype that has a whopping 4 questions in it's knowledgebase) at the following site for anyone who is interested:

http://www.designconcepts.com.au/thesis/

Thanks in advance to anyone who has feedback. I have spoken with some academics and some management types about it, but very few actual programmers.

Cheers,

Simon


  Using query strings normally
Posted by: El Forum - 09-06-2007, 07:46 AM - Forum: Archived General Discussion - Replies (4)

[eluser]Paul Scott[/eluser]
I found myself wanting to be able to specify a variable through GET as-well as through CI's ability to parse the / into parameters of the called function. I was wanting to do this because I was passing a site-wide parameter (it was checked for no matter what page you were on) and I didn't want to have to add the parameter to every function - especially not when some functions had optional parameters.

I found, to my dismay, that trying to go to a url like /admin/main/index?msg=Something returned a 404. A little inspection found that CI was trying to find the controller and function specified by 'msg'.

To fix this, I opened ./system/libraries/Router.php and in the function `_get_uri_string` there is a section that checks if there is only 1 GET variable and uses the name of it to find the controller.

Code:
// If the URL has a question mark then it's simplest to just
// build the URI string from the zero index of the $_GET array.
// This avoids having to deal with $_SERVER variables, which
// can be unreliable in some environments
if (is_array($_GET) AND count($_GET) == 1)
{
    // Note: Due to a bug in current() that affects some versions
    // of PHP we can not pass function call directly into it
    $keys = array_keys($_GET);
    return current($keys);
}
This is the code block that did it within the `_get_uri_string` function. To counter-act this, I simply changed the if-statement to read
Code:
if (FALSE AND is_array($_GET) AND count($_GET) == 1)
Then I needed to stop the GET variable from being destroyed by CI and stop CI trying to take the controller and function from the `c` and `m` $_GET variables by default:
Code:
$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = '';
$config['function_trigger'] = '';

Now I can use URIs like /admin/clients/view/613?msg=updated with my header-template checking for $_GET['msg'] and out-puting it on any page that it's found on.

I thought I would post this because somebody else might have this problem and was wondering why this is the default behaviour? Also, is there a reason why this might have been a bad idea?

Thanks


  Upload class problem
Posted by: El Forum - 09-06-2007, 02:40 AM - Forum: Archived General Discussion - Replies (4)

[eluser]emperius[/eluser]
I need to upload few files at the same time.

I made an arrray of input elements

Code:
<table width="700" border="0" cellpadding="5">
    &lt;?
        for($i=0;$i<5;$i++)
        {
            echo "<tr>";
                echo "<td width=\"200\">Фото ".($i+1)."</td>";
                echo "<td width=\"500\">&lt;input type=\"file\" size=\"50%\" name=\"f[$i]\"&gt;</td>";
            echo "</tr>";
        }
    ?&gt;
    <tr>
      <td>&lt;input type="submit"&gt;</td>
      <td>&nbsp;</td>
    </tr>    
  </table>

and in the controller I check if field is not empty and try to upload file.

Code:
if(!empty($_FILES['f']))
{
    $farr = $_FILES['f'];
    for($i=0;$i<count($farr['name']);$i++)
    {
        if($farr['name'][$i] != "")
        {
            $field = "f[$i]";
                
            $config['upload_path'] = realpath('public/object');
            $config['allowed_types'] = 'jpg';
            $this->load->library('upload', $config);
                    
            $this->upload->do_upload($field);
            $resarr = $this->upload->data();
            
            $file = $resarr['file_name'];
                    
            $this->upload->display_errors('<p>', '</p>');
            $this->upload->data();
              }
    }
}

the permission for folder is set 777

and i don't get errors and data about successfull file upload Sad

What I'm doing wrong?


  How to remove GET parameters to avoid a 404?
Posted by: El Forum - 09-06-2007, 01:41 AM - Forum: Archived Development & Programming - Replies (5)

[eluser]mipa[/eluser]
Hi,

We're migrating our old site to CodeIgniter and are using the Redirect directive in Apache to handle the redirects to our new pages. Our QA just discovered that the Redirect directive will add all the old links' GET parameters to the new CI urls and cause the new CI links to die a nasty 404 death.

So, the question is: what's the best way to chop the GET parameters before CI chokes? Should I use a hook? Are there any suggested or tested / proven solutions to this problem?

Any help is appreciated!


  Coffee Levels critical!!! Cannot function anymore...
Posted by: El Forum - 09-05-2007, 09:47 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]CI Lee[/eluser]
Hey all,

Simple problem, tired eyes....


function

Code:
//$filedata = $this->upload->data();
$data['file_name'] = $data['file_name'];
$file_name = $data['file_name'];
$user_id = $this->session->userdata('id');
                    
// update profile
$sql = "UPDATE profile SET file_name = $file_name WHERE user_id = $user_id LIMIT 1";
$query  = $this->db->query($sql);

Error
Code:
Error Number: 1109

Unknown table '67bfa84ce291b67e0c85322e4b2ee20f' in field list

UPDATE profile SET file_name = 67bfa84ce291b67e0c85322e4b2ee20f.jpg WHERE user_id = 5 LIMIT 1


Someone with fresh eyes wanna point out what is wrong? It is not updating at all however "file_name" exists in the db and the user id is correct...


  Disallawed characters in a form
Posted by: El Forum - 09-05-2007, 06:32 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]miguelp[/eluser]
hi, i've build a form using the from Helper, it displays ok and it works fine until a submit that form.
i've changes the input library and added a $str to the exit function so i can see what are the characters ( exit('Disallowed Key Characters: '. $str); ).
every time i submit the form it says: Disallowed Key Characters: Array
and i cant figure out why, it all seems to be ok.
here's the form code:

Code:
<div id="arch">
    <div id="holder">
&lt;?php
// constroi array de anos
$actual = date('Y');
$anos = array();
for($i=0;$i<10;$i++){
    
    $anos[$i] = $actual +$i;    
}

//constroi array cidades
$towns=array();
for($e=0;$e<count($cidades);$e++){
    $towns[$cidades[$e]['id']] = $cidades[$e]['nome'];
}

//constroi array tipo de cliente
$ctipo=array();
for($i=0;$i<count($tipocliente);$i++){
    $ctipo[$tipocliente[$i]['id']] = $tipocliente[$i]['tipo'];
}
//constroi array categorias
$categorias=array();

for($i=0;$i<count($cats);$i++){
    $categorias[$cats[$i]['id']] = $cats[$i]['Catnome'];
}

$data = Array(
                1 => array(
                              'name'        => 'codigo_cliente',
                              'id'          => 'codigo_cliente',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'
                              ),
                 2 => array('name'        => 'nome',
                              'id'          => 'nome',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 3 => array('name'        => 'idade',
                              'id'          => 'idade',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 4 => array('name'        => 'email',
                              'id'          => 'email',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 5 => array('name'        => 'telefone',
                              'id'          => 'telefone',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 6 => array('name'        => 'description',
                              'id'          => 'description',
                              'rows'        => '15',
                              'cols'        => '100',
                              'style'       => 'width:100%'),
                              
                 7 => array('name'        => 'dia',
                              'id'          => 'dia',
                              'maxlength'   => '2',
                              'size'        => '3'),
                              
                 8 => array(
                              'name'        => 'active',
                              'id'          => 'active',
                              'value'       => '1',
                              'checked'     => TRUE,
                              'style'       => 'margin:10px')
);
                              
$meses = array('01'=>'Janeiro',
                '02'=>'Fevereiro',
                '03'=>'Mar&ccedil;o',
                '04'=>'Abril',
                '05'=>'Maio',
                '06'=>'Junho',
                '07'=>'Julho',
                '08'=>'Agosto',
                '09'=>'Setembro',
                '10'=>'Outubro',
                '11'=>'Novembro',
                '12'=>'Dezembro');
                
    echo form_open('admin/insert_client');
        echo "c&oacute;digo cliente: <br />".form_input($data[1]."<br />");
        echo "nome: <br />".form_input($data[2]."<br />");
        echo "idade: <br />".form_input($data[3]."<br />");
        echo "email: <br />".form_input($data[4]."<br />");
        echo "telefone: <br />".form_input($data[5]."<br />");
        echo "descri&ccedil;&atilde;o: <br />". form_textarea($data[6])."<br />";
        echo "validade: <br />". form_input($data[7]) ." ". form_dropdown('mes', $meses, '01') ." ". form_dropdown('ano', $anos, $actual) ."<br />";
        echo "tpo de cliente: <br />". form_dropdown('ctipo', $ctipo, '01') ."<br />";
        echo "categoria: <br />". form_dropdown('cat_id', $categorias, '01') ."<br />";
        echo "cidade: <br />". form_dropdown('cid_id', $towns, '01') ."<br />";
        echo "activo: ". form_checkbox('active','active',TRUE) ."<br />";
        echo form_submit('submit', 'Submit Post');
        echo "&lt;/form&gt;"; //form_close();

?&gt;
</div></div>

can you tell me whats wrong?
thanks in advance



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