Welcome Guest, Not a member yet? Register   Sign In
  Weird Image_lib GD Problem
Posted by: El Forum - 08-03-2008, 07:00 AM - Replies (6)

[eluser]matthewr[/eluser]
I get the weirdest errors! Whenever I upload JPGs saved in photoshop everything's fine, but when i upload images saved using iPhoto i get this

Quote:An Error Was Encountered

The path to the image is not correct.

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

Here's my code:
Code:
$config['image_library'] = 'GD2';
                        $config['source_image']    = $source_file;
                        $config['new_image']    = $this->thumbnail_path.$uploaded_file_name;
                        $config['create_thumb'] = TRUE;
                        $config['maintain_ratio'] = TRUE;
                        $config['width']     = $this->width;
                        $config['height']    = $this->height;
                        $this->CI->load->library('image_lib');
                        $this->CI->image_lib->initialize($config);
                        
                        if ( ! $this->CI->image_lib->resize()){
                            show_error($this->CI->image_lib->display_errors());
                        }

Anyone has a clue? This is so weird!


  Noob confusion about html-tables and html-table-templates
Posted by: El Forum - 08-03-2008, 06:58 AM - Replies (1)

[eluser]jedd[/eluser]
Howdi,

Just starting to dip my toe into CI, MVC, and the OO(ish) aspects of PHP5. I've got a decent understanding of PHP and HTML.

I'm looking at the HTML table templates ( http://ellislab.com/codeigniter/user-gui...table.html ) and the templating feature looks like something I'd want to abstract out to another file to be shared in lots of different places.

My question is simply where should that file be?

I know some of this can (should?) be done in CSS, but I suspect bits of it would be easier if used as part of the $this->table class.

I'm thinking of a number of lines that look like this:

Code:
$table_template_organism = array (
    'table_open' => '<table border="2" cellpadding="2" cellspacing="1" class="table_organism">'
    );

Presumably I'm missing something obvious. Replicating this kind of stuff in lots of Controller preambles doesn't make sense (of course).


  How to reuse code in controllers ?
Posted by: El Forum - 08-03-2008, 03:46 AM - Replies (4)

[eluser]tfliam[/eluser]
Hi, I'm building a large website and there's a lot of similar coding in many controllers, how could I put them in a separate file for code reusing?

For eg in my system/application/controllers/home.php, I have

Code:
&lt;?php

class Home extends Controller {

    function Home()    {parent::Controller();}
    
    function index()
    {    
        $array_controller = $this->web_controller->get_web_controller_by_controller('home');
        
//CODE << CONTAINS OVER 20 LINES OF SIMILAR CODING
    }
}
?&gt;

and then in many other files, I'll have similar coding for eg. in my system/application/controllers/article/article_submit.php, I have

Quote:&lt;?php

class Article_Submit extends Controller {

function Article_submit() {parent::Controller();}

function index()
{
$array_controller = $this->web_controller->get_web_controller_by_controller('article_submit');

//CODE << CONTAINS OVER 20 LINES OF SIMILAR CODING
}
}
?&gt;


  Template Library Version 1.2
Posted by: El Forum - 08-03-2008, 03:20 AM - Replies (14)

[eluser]Colin Williams[/eluser]
Template Library Version 1.2 has been released. Version 1.2 is an update to the Template class API and includes no bug fixes or new features.

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

Visit the Template Library Homepage

View the Change Log

Still using Template 1.1? See the Ignited Code thread covering Template 1.1

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

The Template library, written for the CodeIgniter PHP-framework, is a wrapper for CI’s View implementation. Template is a reaction to the numerous questions from the CI community regarding how one would display multiple views for one controller, and how to embed “views within views” in a standardized fashion. In addition, Template provides extra Views loading capabilities and shortcuts for including CSS, JavaScript, and other common elements in your final rendered HTML.

Using Template looks like this:

Code:
$this->template->write('title', 'Introduction to Template');
$this->template->write_view('content', 'blog/posts', $this->blog->get_posts());
$this->template->render();

Look interesting? Head over to the Template Library Homepage to begin using Template in your next CodeIgniter application.


  General Load->Library Question
Posted by: El Forum - 08-03-2008, 01:54 AM - Replies (4)

[eluser]The Wizard[/eluser]
Hello Friends Smile


ive a question about the general workflow of load->library function.
In the XAJAX and CodeIgniter webpage and in the Wiki for it,
here http://codeigniter.com/wiki/XAJAX/ to be exact, ive seen that
the XAJAX files are just downloaded, renamed and then put into
CodeIgniter libraries folder and then are loaded with a line like:

$this->load->library('xajax');

and then should be avaible for using it.

My question is:
is any other library accessible like this?
are there any special changes made to a lib that
we want to use like this?

is there anything special we dont know about?

thanks in advance Smile


  is this a crazy view for a contact form
Posted by: El Forum - 08-03-2008, 12:17 AM - Replies (2)

[eluser]dsims[/eluser]

Code:
&lt;?php
echo $this->validation->error_string;
$attributes = array(
    'class'       => 'contact'
    );
echo form_open('contact',$attributes);
$this->table->set_heading('','Contact Form');
$data = array(
    'name'        => 'fname',
    'id'          => 'fname',
    'value'       => '',
    'maxlength'   => '20'
     );
$this->table->add_row('<label for="fname">First Name:</label>', form_input($data), '* required');
$data1 = array(
    'name'        => 'lname',
    'id'          => 'lname',
    'value'       => '',
    'maxlength'   => '30'
     );
     $this->table->add_row('<label for="lname">Last Name:</label>', form_input($data1), '* required');
$data2 = array(
    'name'        => 'email',
    'id'          => 'email',
    'value'       => '',
    'maxlength'   => '40'
     );
$this->table->add_row('<label for="email">Email address:</label>', form_input($data2), '* required');
$data3 = array(
    'name'        => 'webad',
    'id'          => 'webad',
    'value'       => '',
    'maxlength'   => '40'
     );
$this->table->add_row('<label for="webad">WebSite:</label>', form_input($data3), '( optional )');
$data4 = array(
    'pse'         => 'howdy',
    'sug'         => 'Site Suggestion',
    'reg'         => 'Regular Advertising',
     );
$this->table->add_row('<label>What do you want to tell us about?</label>', form_dropdown('topic',$data4), '* required');
$data5 = array(
    'name'        => 'comments',
    'id'          => 'comments',
    'value'       => '',
    'rows'        => '7',
    'cols'        => '39'
    );
$this->table->add_row('<label for="comments">
            Your comments:<br/>
            Limit of 250 characters<br/>
     </label>', form_textarea($data5), '* required');
$this->table->add_row('',form_button('submit','Submit'),'');
echo $this->table->generate();
echo form_close();
?&gt;
It looks nice, is this the norm? I think I could have made a dynamic array for the data, values are empty for future dynamics, just following the examples or should I write a function or class for this. Any guidance would help. Thanks Dave


  upload a file
Posted by: El Forum - 08-02-2008, 11:33 PM - Replies (4)

[eluser]PHP Programmer[/eluser]
hi

I am trying to upload a file (any type) in userauth application. But I am unable to do so.

How can I do it? Please help.

Thanks
Anuj


  'Remember Me' doesn't work
Posted by: El Forum - 08-02-2008, 11:20 PM - Replies (3)

[eluser]PHP Programmer[/eluser]
Hi

I am trying to 'remember me' feature of userauth application but it is not working. I am unable to keep remember my username/password for future use. Also, I have enabled cookies in my system.

Is there something I need to do in the function to correct this feature??

Please help

Thanks
Anuj


  Default values and the validation library
Posted by: El Forum - 08-02-2008, 06:16 PM - Replies (8)

[eluser]Vang[/eluser]
Unfortunately the validation library 'assumes' that all forms by default are empty. However most of the time you need default values mostly for checkboxes and radio buttons. It would be great to be able to define an array with default values.

Any plans of implementing that into the next CI ?


  Only absolute links?
Posted by: El Forum - 08-02-2008, 01:21 PM - Replies (15)

[eluser]Unknown[/eluser]
Is it worth the trouble trying to reverse the a/b/c/d/e type of paths with ../../../../, or is it better to just use the absolute links?


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

Username
  

Password
  





Latest Threads
Codeigniter4 version 4.5....
by kenjis
3 hours ago
SQL server connection not...
by kenjis
3 hours ago
Problem with session hand...
by kenjis
3 hours ago
Is it possible to go back...
by kenjis
3 hours ago
Cannot access protected p...
by xsPurX
5 hours ago
Update to v4.5.1, same us...
by xsPurX
10 hours ago
How to use Codeigniter wi...
by kenjis
Today, 05:06 AM
CVE-2022-40834 SQL Inject...
by kenjis
Today, 03:44 AM
Retaining search variable...
by pchriley
Today, 03:15 AM
Disable debug output in v...
by groovebird
Today, 02:26 AM

Forum Statistics
» Members: 85,380
» Latest member: dangnhapw88linkvao1
» Forum threads: 77,581
» Forum posts: 376,007

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB