Welcome Guest, Not a member yet? Register   Sign In
  Output image from controller to view
Posted by: El Forum - 05-07-2008, 08:44 AM - Replies (1)

[eluser]yusufdestina[/eluser]
In my view I have this:

Code:
<img src="'.base_url().'serve/thumb/'.$gallery->gallery_id.'/'.$pic->pic_id.'" alt="" title="" />
Then in controller Serve:
Code:
&lt;?php

class Serve extends Controller {
    
    var $img;
    
    function Serve()
    {
        parent::Controller();
        $this->load->model('Gallery_model');
    }
    function thumb(){
        $gid = $this->uri->segment(3);
        $pid = $this->uri->segment(4);
        $gallery = $this->Gallery_model->get_gallery($gid);
        $pic = $this->Gallery_model->getPic($pid,$this->session->userdata('id'));
        $this->img = 'gallery/'.$gallery->gallery_dir.'/thumb/'.$pic->pic_link;
        if(is_file($this->img)){
            Header("Content-Type: image/jpeg");
            print file_get_contents($this->img);
        }else{
            Header("Content-Type: image/jpeg");
            print file_get_contents('public/gfx/thumbnotset.jpg');
        }
    }
}
?&gt;
$this->img is defined and the path to the image is correct, can't figure out what I'm missing here. tnx for ur help.


  Oracle Error messages?
Posted by: El Forum - 05-07-2008, 08:40 AM - Replies (5)

[eluser]inari[/eluser]
When i'm using MySQL with CI I'm getting all errors if something gets wrong, but with Oracle, only message that I get is:

Quote:An Error Was Encountered

Error Number:

SELECT * FROM clients

No numbers, no messages.
Any ideas?


  embedding wordpress in CI
Posted by: El Forum - 05-07-2008, 08:36 AM - Replies (14)

[eluser]AtlantixMedia[/eluser]
Hello,

first of all, can anyone take a look at this?

http://www.welovelocal.com/blog/2008/05/

that is a wordpress blog embedded in their custom application or cms. can something similar be achieved with CI? I basically want wordpress functionality and CI at the same time, like showing a common header and footer.

thanks


  anchor() helper UTF8 bug
Posted by: El Forum - 05-07-2008, 06:59 AM - Replies (7)

[eluser]Référencement Google[/eluser]
There is an encoding bug in the latest SVN release using the anchor helper with French characters like é à ü è

The bug appear on the tooltip while hovering a link, this is in the title attribute of the link. I think this is due to the line #122 of the url_helper.php file:

Code:
$attributes = ' title="'.htmlentities($title).'"';

As in the PHP manual, it should use the third parameter of the function to work with UTF-8, see here: http://php.net/htmlentities

I propose this code to replace at line #120:
Code:
if ($attributes == '')
{
    $CI =& get_instance();
    $attributes = ' title="'.htmlentities($title, ENT_QUOTES, $CI->config->item('charset')).'"';
}
else
{
    $attributes = _parse_attributes($attributes);
}


  Database driven forms
Posted by: El Forum - 05-07-2008, 05:38 AM - Replies (1)

[eluser]webdude[/eluser]
I have been thinking about creating forms via a database to make things a bit more scalable in my CMS. Has anyone done this before? Would the following work? I guess the add and update of data is going to be a bit tricky.


[categories]
category_id = 1
category_parent_id = 0
category_name = News
category_url_title = Latest News
category_description = Latest company news
category_order = 1
category_image = NULL


[forms]
form_id = 1
category_id = 1
form_name = News
form_description = Used for company news


[fields]
field_id = 1
form_id = 1
field_name = news_title
field_label = Title
field_instructions = Your news title
field_type = text
field_max_length = 128
field_required = y


[data]
data_id = 1
form_id = 1
field_id = 1
data_value = New site launched


Thanks

WD


  The page you requested was not found.
Posted by: El Forum - 05-07-2008, 04:30 AM - No Replies

[eluser]Justin Patel[/eluser]
i just upload the index.php and system folder to the server and tried to access it ....

and got " The page you requested was not found. "


Please help me


  upgraded to 1.6.1 and Active Record is eating one of my quotes
Posted by: El Forum - 05-07-2008, 04:16 AM - Replies (10)

[eluser]a_z_[/eluser]
Hello all,

I just upgraded to 1.6.1 and an active record query
that was previously working is now failing in a strange
way:

$this->db->select("*,
DATE_FORMAT(endtime, '%b %d, %Y %l:%i %p') as prettyend,
DATE_FORMAT(starttime, '%b %d, %Y %l:%i %p') as prettystart");
$query = $this->db->get('assignments');

produces:

SELECT *, DATE_FORMAT(`endtime`, '%b %d, %Y %l:%i %p') as prettyend, DATE_FORMAT(`starttime`, %Y %l:%i %p') as prettystart FROM (`assignments`)

Note that the first DATE_FORMAT turned out fine, but the second one is
missing the quote before the format string. This causes mysql to choke.

Adding FALSE as the second parameter to the select function doesn't help.

If I remove the comma from the format string the problem goes away.
It also seems to go away if the two format strings are different. Even
if I just add a leading space to one of them!

Any ideas?

thanks,
az


  watermarking
Posted by: El Forum - 05-07-2008, 04:05 AM - Replies (1)

[eluser]ravikota[/eluser]

Code:
$config['image_library'] = 'GD2';
$config['source_image'] = './photo_uploads/ww.jpeg';
$config['wm_overlay_path'] = './photo_uploads/bird.jpeg';
$config['wm_type'] = 'overlay';
$config['dynamic_output'] = false;
$config['wm_opacity'] = 50;
$config['wm_x_transp'] = 4;
$config['wm_y_transp'] = 4;
$config['wm_vrt_alignment'] = 'middle';
$config['wm_hor_alignment'] = 'center';
$config['wm_padding'] = '20';

$this->image_lib->initialize($config);
if($this->image_lib->watermark())
echo "yes";
else
echo "No";

When i execute the above code i get the following warnings:
1) imagecolorat(): supplied argument is not a valid Image resource
2) imagecolortransparent(): supplied argument is not a valid Image resource
3) imagecopymerge(): supplied argument is not a valid Image resource

can any one help me to solve the above problem.


  Ajax Updater problem
Posted by: El Forum - 05-07-2008, 03:48 AM - Replies (2)

[eluser]Unknown[/eluser]
Hello,
i am new on CI and ajax but not in PHP.
To use CI it's ok and easy (very good framework).
I need some help to understand how use the ajax library.
I try to follow the tutorial of Derek Allard but the ajax updater function doesn't work.
The model list a table and output a form to allow updating and deleting for each result.
The controller by the index function put the output model in a variable and load a view
The view show the output in a div. The view include all the js files of ajax library and a js file with Ajax.Updater function.
In the controller a function update the modifies values submitted by the form in view page.
Without ajax all works fine.
But with ajax (like explain in the Derek Allard tutorial) the page is reload or only the form is showed in the view.
So i would like to undertand how use ajax.updater.
I'm sorry about my english. I do my best.
Thanks.


  howto cron with sesseion
Posted by: El Forum - 05-07-2008, 03:16 AM - Replies (1)

[eluser]vile[/eluser]
hi!
do you have any idea how to run cron job in CI?

im also wonderinf if i can user the controller. the default controller cannot be used without setting the session first. any other way to solve this problem thanks,


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

Username
  

Password
  





Latest Threads
Heads up for users using ...
by InsiteFX
3 hours ago
The Hidden Cost of “Innov...
by fcoder
3 hours ago
tool bar not showing
by InsiteFX
9 hours ago
Tool bar not showing
by InsiteFX
10 hours ago
Validation does not appea...
by grimpirate
Yesterday, 01:55 PM
Block IP addresses of bad...
by grimpirate
Yesterday, 01:47 PM
Override Router
by grimpirate
Yesterday, 01:30 PM
CodeIgniter.com - Report ...
by Vikas Mehta
06-30-2025, 10:30 AM
best way to store tokens ...
by ahallrod
06-30-2025, 10:03 AM
Hey Now it is a time for ...
by J0shflynn
06-29-2025, 06:44 AM

Forum Statistics
» Members: 154,326
» Latest member: no1jlorgph
» Forum threads: 78,435
» Forum posts: 379,706

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB