Welcome Guest, Not a member yet? Register   Sign In
  Image Manipulation
Posted by: El Forum - 10-17-2007, 04:04 PM - No Replies

[eluser]Replenish[/eluser]
I've searched high and low to figure out how to resize an image so the smallest side is resized to 75px.
I tried:

Code:
$config['image_library']  = 'GD2';
$config['source_image']   = '/WebServer/htdocs/pix/t/'.$data['raw_name'];
$config['maintain_ratio'] = TRUE;
$config['width']          = 75;
$config['height']         = 75;
$config['master_dim']     = 'auto';
$config['quality']        = 100;
$config['new_image']      = '/WebServer/htdocs/pix/sq/';
$this->image_lib->initialize($config);
$this->image_lib->resize();
I was thinking 'master_dim' would look for the smallest side and resize that side to 75px but it appears that isn't true. Any ideas on how to do this would be appreciated Smile


  different behaviour when "passing on libraries" in apache/php5 and iis/php4
Posted by: El Forum - 10-17-2007, 03:43 PM - No Replies

[eluser]bAum[/eluser]
Dear all,

I currently experiencing a strange problem. I'm developing a site on my pc, running apache with php5. The thing is deployed on a web server running IIS with php4. The problem is the following: I wrote a library that among other things tracks some general information such as the language that is being used. This information is set in the controller as this:

$this->reader->setLanguage($lang);

When I want to use this information later on in a view, i'll have a method

$this->reader->getLanguage($lang);

Here it comes: while things work fine on the php5 host, on the php4 host the getLanguage call returns an empty string (the default value). After investigating this problem it turns out that in the php5 case the libraries are correctly "passed-on" to the views, whereas in the php4 case the libraries are newly instantiated...

Has anyone come across this problem, any ideas how to fix it?

Best regards,

bAum


  multiple applications, mod_rewrite and .htaccess
Posted by: El Forum - 10-17-2007, 02:27 PM - No Replies

[eluser]Tom Vogt[/eluser]
After searching through the forums, experimenting and generally wasting at least an hour more than should be necessary, I've finally come up with a clean way to run multiple applications.

Directory structure:
- system
-- application
--- someapp
--- anotherapp
--- thirdapp


my .htaccess (in the top dir):

Code:
RewriteEngine on

RewriteCond $2 !^(index(|_[^\./]+)\.php|robots\.txt)
RewriteRule ^(someapp|anotherapp|thirdapp)(.*)$ /index_$1.php/$2 [L]

RewriteCond $1 !^(index(|_[^\./]+)\.php|images|common|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


and then make new index.php files with filenames of "index_someapp.php", "index_anotherapp.php", etc. and the only difference among them is the setting of $application_folder (which should point to "application/someapp" etc.



Possible Improvements:
You could probably replace the list with a wildcard, but that should be a bit carefully constructed to prevent security problems, so I simply put the list in there, it's not as if I'd be changing the deployed apps all the time.

Just copying the index.php isn't necessarily the best solution, since only one line of 133 changes, so a bit of require_once() would greatly improve that part.



Other comments?


  User Guide 1.5.3 in PDF Format
Posted by: El Forum - 10-17-2007, 02:00 PM - No Replies

[eluser]Unknown[/eluser]
Hello everyone,

I am new to Code Igniter and let me just say it looks fantastic. One thing I do like to do when I get started with a new technology is print out the user guide and go through it and highlight important sections, or take notes. I noticed that there was no PDF format for CodeIgnitor's User Guide so I began the daunting task of converting the web-based guide into PDF format. Please keep in mind this is actually the first PDF I have ever created. Anyway - It worked out well for me and I would like to post it here for anybody that needs a PDF copy of the CodeIgnitor's User Guide.

KEEP IN MIND:
1. The PDF format contains the same information that was in my CodeIgnitor Download (10/17/07) "user_guide" folder. (version 1.5.3)
2. I removed the javascript TOC menu and search box from all pages.
3. All navigation should be done through the Bookmark's section. If this is not the correct format someone with more knowledge of making PDF's could hopefully fix this easily.


To the Code Ignitor Team:
If there is any problem with my distributing this information just delete my post and let me know. My goal is to help anyone else who needed a PDF version of your user guide.


Without further ado - here is the download:

Download User Guide: user_guide.pdf (2.14 MB)

Hope this helps some people,

_[Zenith]_


  Using a .php5 extension
Posted by: El Forum - 10-17-2007, 11:22 AM - No Replies

[eluser]Unknown[/eluser]
On my host, in order to use PHP5, I have to have the extension php5 on the index.php file. When I rename it index.php5, it seems to think all the includes or whatever should be php5 also. For example, I get an error about not finding system/codeigniter/CodeIgniter.php5. If I rename that, it complains about another.

I expect I could simply rename everything with a php5 extension and it would work, but I hope there is a better (more expected) way of handling this that would upgrade more easily among other things.

Anybody know how to do this? Am I simply not finding a config option in the code or documentation?


  noob question
Posted by: El Forum - 10-17-2007, 11:03 AM - No Replies

[eluser]banjomacman[/eluser]
Can someone explain when to use

$variable

instead of

$this->varible

inside controller,models,libraries


  Getting Controller name in post_controller_constructor hook
Posted by: El Forum - 10-17-2007, 10:50 AM - No Replies

[eluser]Majd Taby[/eluser]
Hey, in hooks.php, is there a way to get the controller name? I have a hook that redirects to a login page, but i want to know the name of the controller it is redirecting from, such that when the user logs in successfully, he can be redirected there.


  Development test/sandbox site
Posted by: El Forum - 10-17-2007, 10:04 AM - No Replies

[eluser]BigErnMcCracken[/eluser]
I'm trying to figure out the easiest way to create a test 'sandbox' site so I can test functionality, display, etc on my site. I read through the 'Managing Applications' section of the user guide, but it requires that I use a different index.php (i.e. I would have a sandbox.php and a production.php for example) file.

The problem with this is that in the sandbox my URL's would be

Code:
<a href="sandbox.php/controller/method">
and in order to move everything over the production site I would need to change all of those to
Code:
<a href="production.php/controller/method">
which I would rather not do. It would be to have it set up so that when I am finished testing, I can just move the file to my production code base and be done. I also realize that I can use the php 'SELF' variable in place of the "production.php" but because other people developing on this site might not understand that, I would like to avoid using it.

So is there a way of creating a test server using the same index.php file?


  DB Cache Dir
Posted by: El Forum - 10-17-2007, 09:40 AM - No Replies

[eluser]uniacid[/eluser]
I've been searching the forums for any previous posts on this issue,

I'm trying to enable auto db cache in my config/database.php

$active_group = "default";


$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = TRUE;
$db['default']['cachedir'] = "cache";

my absolute path would be this:
/webserver/domain.com/htdocs/system/cache

I figure this is fine since thats is the location and the folder is chmod to 777, I've tried different variations of the path to get it working, when I try with any path so far it gives me this error:

Quote:An Error Was Encountered

The cache path you submitted is not valid or writable.


Any help is appreciated.


  Hooks won't work
Posted by: El Forum - 10-17-2007, 08:24 AM - No Replies

[eluser]Unknown[/eluser]
Hello and I would like to start off by saying that I love the CI Framework.. I've done some searching in the forums... and I can't find the answer to what I'm looking for..

I am using the module separation style of CI and I am trying to use hooks but for some reason it won't work.

I followed the user guide to set it up.. I also tried some examples in the forums.

Here is what I've got..

config.php file:

$config['enable_hooks'] = true; // enable hooks

$config['subclass_prefix'] = 'MY_'; // this is what my classes are set to.. for module separation

hooks.php file:

$hook['pre_controller'] = array(
'class' => 'MY_test',
'function' => 'checkit',
'filename' => 'MY_test.php',
'filepath' => 'hooks',
'params' => array('bob','tom')
};

so my file MY_test.php is in the application/hooks/ directory. and all I am trying to do is echo a message for now.. I also tried to return the message.. to see if it would display something.. but it doesn't..

My page shows blank :long:

I checked my log file because that is set to 4 to get all messages.. and it just says..

DEBUG - 2007-10-16 15:48:59 --&gt; Config Class Initiallized

that is it.. also I don't see any php errors or notices.. not sure why that is..

any help would be greatful..

John


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by PaulC
19 minutes ago
Setting baseURL in Regist...
by grimpirate
Yesterday, 02:20 PM
CRUD Code Generator
by DeanE10
Yesterday, 05:31 AM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM
Update from 4.6.0 to 4.6....
by FlavioSuar
05-13-2025, 04:17 AM
Sessions old files are de...
by InsiteFX
05-12-2025, 10:30 PM
Ajax post failing with Ty...
by PaulC
05-12-2025, 12:23 AM
intermittent smtp failure...
by InsiteFX
05-11-2025, 11:30 PM
MVC vs MVCS vs CodeIgnite...
by FlavioSuar
05-10-2025, 10:33 AM

Forum Statistics
» Members: 146,349
» Latest member: Superfast Removals
» Forum threads: 78,390
» Forum posts: 379,458

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB