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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,605
» Latest member: DanielCao
» Forum threads: 66,750
» Forum posts: 418,423

Full Statistics

Latest Threads
Css screen output
Forum: General Help
2 hours ago
» Replies: 0   » Views: 21
HELP NEEDED: recreating t...
Forum: CodeIgniter 4 Development
4 hours ago
» Replies: 0   » Views: 19
Tutorial (Class 'App\Mode...
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 3   » Views: 81
Import CSV/Excel data int...
Forum: General Help
5 hours ago
» Replies: 0   » Views: 86
The output from json to P...
Forum: Libraries & Helpers
8 hours ago
» Replies: 0   » Views: 66
Form Validation validatin...
Forum: General Help
Yesterday, 01:34 PM
» Replies: 10   » Views: 146
Codeigniter4 needs more a...
Forum: CodeIgniter 4 Discussion
Yesterday, 01:04 PM
» Replies: 0   » Views: 65
Calling img src and alt f...
Forum: General Help
Yesterday, 11:34 AM
» Replies: 3   » Views: 69
Ignition Go updated, work...
Forum: Addins
Yesterday, 10:06 AM
» Replies: 2   » Views: 172
Call to a member function...
Forum: Issues
Yesterday, 09:38 AM
» Replies: 7   » Views: 6,353

 
  Server Side Debugging
Posted by: El Forum - 08-24-2007, 12:25 PM - Forum: Archived Development & Programming - Replies (11)

[eluser]jgberg[/eluser]
I am trying to successfully do server side debugging with a full-blown debugger; that is, with breakpoints etc. What I want is to be able to do is debug my code whenever it is exercised on the server. At this point, I've installed a number of remote debugging packages, and so far I've not been able to do what I want. Hopefully, on this thread I can find out if anyone is successfully doing this with CI, and just how it's done.

I have a development machine with apache 2.2.x and CI installed. I have tried these debugger/IDEs: dev-php, eclipse with PDT+plugins, and Zend. I've gotten farthest with Zend as far as enabling remote debugging. Installing this stuff has been hell, just to say it, but eventually I've installed ZendCore, Zend Studio, Zend Debugger, and Zend Platform.

What I would expect, technically speaking is to setup my apache/php environment so that I can connect to it remotely with my debugger, then breakpoint PHP code on the server side such that whenever that code is excercised by some browser hitting the server, when that server runs the breakpointed code it will halt and notify my debugger and allow me to control the code flow from my debugger. There might be an issue with timing out the server response to the browser, but that would be patched.

What I've found is that I cannot make this happen. To be precise, I can run code from the debugger directly, which works fine, but isn't what I need. And I can run from the debugger a URL, which causes CI to choke with "The URI you submitted has disallowed characters." because the debugger is throwing extra crap on the URL and I can't stop it from doing so. And I cannot get it to breakpoint if I hit the proper URL from an external browsers.

So has anyone got this working right? How?

thanks!,
jeffrey


  Modular separation - how to now call a helper?
Posted by: El Forum - 08-24-2007, 11:16 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]tinawina[/eluser]
I can't find an answer for this in other posts re: modular separation. I just implemented modular separation which is great but now my application can't find a helper file I created. Where do I put helper files? I tried saving it to these folders -- no luck:

system/helpers

system/application/helpers

system/applications/modules/module-name/helpers

I get this error: "Unable to load the requested file: myfile.php". One thing about this is I labeled the helper I created as "myfile_helper.php" per CI's instructions but the error message only shows myfile.php. As though it doesn't know that this is a helper file. I call it into my controller's constructor like so:

$this->load->helper('myfile');

This worked pre-modular separation implementation. Any help is appreciated!

I also have a config file I created for this app. I didn't move that file at all -- just kept it in it's original place which was in a sub-folder in the config folder: system/application/config/myfolder/myconfig.php. That still works but wondering if this is the best way to go about calling this file. I call it in the constructor like this:

$this->load->config('myfolder/myconfig');

Thanks for your help!


  include main app controller only once
Posted by: El Forum - 08-24-2007, 10:15 AM - Forum: Archived Development & Programming - Replies (12)

[eluser]gerben[/eluser]
Coming from the Cake framework, I find it convenient to create an app-controller for system-wide settings that extends the main CI controller. All my other controllers extend the app controller, rather than the CI controller.

Right now I include my app-controller in every controller that extends it, like so:

Code:
<?php
include("application/app_controller.php");

class SomeController extends AppController {

// etc.

?>

But isn't there an easier way to include this controller in every controller that extends it?


  Looping through error_string with JS
Posted by: El Forum - 08-24-2007, 10:06 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]BrandonDurham[/eluser]
I know it sounds crazy, but hear me out.

I'm building a site for a client in CI that used to exist in HTML with JS form validation. They're very happy with the way it's working except they prefer the old-school javascript alert boxes letting the user know they've done something wrong in the form. I want to be able to tie it in directly with CI's validation class. I'm currently doing this in my view:

Code:
<?if ($this->validation->error_string) { ?>
    
        msg = '<?=$this->validation->first_name_error; ?>';
        ShowErrors(msg);
    
<? } ?>

... and this JS function is in the head:
Code:
function ShowErrors(str)
{
    msg  = "______________________________________________________\n\n";
    msg += "The form was not submitted because of the following error(s).\n";
    msg += "Please correct these error(s) and re-submit.\n";
    msg += "______________________________________________________\n\n";
    msg += str;
    alert(msg);
}

This works fine, however the form is approximately 20 fields long and I don't really want to add each field's error individually. Is there a way I can pass the "ShowErrors" JS function the $this->validation->error_string and have it cycle through all errors?

I appreciate any help.

Thanks!


  Shopping Cart, eCommerce Code Igniter Site???
Posted by: El Forum - 08-24-2007, 09:10 AM - Forum: Archived General Discussion - Replies (3)

[eluser]CI_[/eluser]
can you give me some site that was develop using CI framework... thanks


  UTF-8 Latin 1 etc... I moved to linux and nothing seems to work properly
Posted by: El Forum - 08-24-2007, 05:34 AM - Forum: Archived Development & Programming - Replies (7)

[eluser]snaggy[/eluser]
This is a problem I hadn't encountered in windows, in my pages written in italian with italian special characters such as òàùèì that show up as question marks...

I don't know if I should use UTF-8 or Latin 1, can you suggest me which one should I use (easiest one)?

I have a database in MySQL in which I can choose the collation... what to pick?

In codeigniter my php files are encoded as UTF-8 I think, this is what Zend creates when I make a new file.

In my view files charset can be set to either UTF-8 or ISO-8859-1

The point is that with every possible combination it doesn't seem to work. If I use Latin 1 as I did on windows firefox reads it as utf all the same, dunno why:

Code:
<html>

<head>
<title>My Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Language" content="it">
</head>

<body>

<p>questa � la home page</p>

&lt;/body&gt;

&lt;/html&gt;


even if the php files is encoded in latin 1 (does this matter?)

I'm really confused, can anyone help or at least tell me what he/she does so that I can copy?

thanks!
Bye


  Image resizing patch for image_lib
Posted by: El Forum - 08-24-2007, 05:33 AM - Forum: Archived Development & Programming - No Replies

[eluser]#1313[/eluser]
If you want your image_lib only resize your image if it is bigger than your 'width' and 'height' parameters and do not resize if image is smaller then you may find this piece of code useful:

Code:
if ($this->orig_width >= $this->orig_height && $this->orig_width > $this->width) {
            $quotient = $this->orig_width / $this->width;
            $this->height = ceil($this->orig_height / $quotient);
        } else if ($this->orig_height > $this->orig_width && $this->orig_height > $this->height) {
            $quotient = $this->orig_height / $this->height;
            $this->width = ceil($this->orig_width / $quotient);
        } else {
            $this->width = $this->orig_width;
            $this->height = $this->orig_height;
        }

Insert it into your libraries/Image_lib.php in image_reproportion() function at line 1266 after these lines:
Code:
if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0)
            return;
And delete or comment everything below inserted code in this function. Now it will behave as expected.

PS. Disclaimer: use at your own risk. This is a 'quick and dirty' patch which worked fine with my app (CI 1.5.4) but can possibly kill something in yours. Don't forget to backup your library if you're not sure what are you doing.
PPS. I personally think that this behavior must be the default behavior of any image resizing functuon. I was deeply shocked when i discovered that such great framework lacks this important (and very often used) functionality.


  drag and drop and one query
Posted by: El Forum - 08-24-2007, 05:29 AM - Forum: Archived Development & Programming - No Replies

[eluser]wojtekk[/eluser]
hi
im using script.aculo.us to sort list with drag and drop
In my controller i got method

Code:
function sort()
{
        $ranking = 1;
        foreach ($_POST['tasks_list'] as $id) {    
        $dane = array('ranking' => $ranking);
        $this->Task->update($id,$dane);
            $ranking++;
        }
}
It works but i dont like it because it make a lot of queres(with 100 items in list - 100 updatesSad )
so i made this to made only one

Code:
function sort()
{
        $ranking = 1;
     $querry='';
        foreach ($_POST['tasks_list'] as $id) {
        $querry.=" UPDATE tasks SET ranking = '".$ranking."' WHERE tasks.id ='".$id."';";
            
            $ranking++;
        }
    $this->Task->updateranking($querry);
}


but its dont work
Any suggesttions?


  text helper
Posted by: El Forum - 08-24-2007, 02:43 AM - Forum: Archived General Discussion - Replies (1)

[eluser]abbe01[/eluser]
Hi,
I am using text helper of CI. I have load the helper in my controllers.
But, once I use it for word wrap the row data form my database, it will come to this error message.

Quote:
Fatal error: Using $this when not in object context in C:\Inetpub\wwwroot\voxcms\system\helpers\text_helper.php on line 395
How to use the text_helper instead? I found that i m not able to use the text_helper while loading my db row data set.
below is my code, which I would like to word_wrap my $row->postcontent:
Code:
$post_count = $query->num_rows();
            $i = 0;
            if ($post_count > 0){
                foreach($query->result() as $row){
                    $postcontent = $row->postcontent;
                    //extract($posts[$i]);
                    $postcontent = word_wrap($postcontent, 6);
                    echo "<tr>\n";
                    echo "    <td>&lt;input type=\"checkbox\" name=\"tick$i\" value=\"$row-&gt;postid\" /></td>\n";
                    echo "    <td>$row->posttitle</td>\n";
                    echo "    <td>$postcontent</td>\n";
                    echo "    <td>&nbsp;</td>\n";
                    echo "    <td>$row->createdate</td>\n";
                    echo "    <td>$row->createdby</td>\n";
                    echo "    <td><a href=\"post.php?id=$row->postid\" id=\"imghref\"><img src=\"images/edit.gif\" title=\"edit\" /></a></td>";
                    echo "</tr>\n";
                    $i++;
                }
Hope anyone can point it out, how I am going to implete this.
Thanks.


  Resizing image problem
Posted by: El Forum - 08-24-2007, 02:36 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]K-C[/eluser]
I have been trying to resize an uploaded image to create thumbnail and never managed to create the thumbnail file in the folder, however I am able to upload the original file. PLease enlighten me on what's wrong in my code. My code is as follow.


$img = $this->upload->data();
$uploadDir = $basepath.'/imgs/test/';
// let's create a thumbnail while we're here.
$config['image_library'] = 'GD2';
$config['source_image'] = $img['file_name'];
$config['new_image'] = $basepath.'/imgs/thumb_'.$img['file_name'];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 5;
$config['height'] = 5;

$this->load->library('image_lib');
$this->image_lib->initialize($config);
$this->image_lib->resize();



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