Welcome Guest, Not a member yet? Register   Sign In
  problem with _POST array validation and repopulation, am i missing something or...?
Posted by: El Forum - 10-13-2007, 06:26 AM - No Replies

[eluser]smith[/eluser]
here is an example of my problem. it is attached, together with mysql test tables dumps.

http://rapidshare.com/files/62239050/test.rar.html

$this->validation->test_array is not visible to view when editing Sad
updated set_select is inside MY_Validation.php (updated set_select can work with _POST arrays)

form is populated when using insert (your_host/test_post/test_insert)
but form is NOT correctly populated when editing, even though all the variables exist inside a model

i am using print_r at the end of model script so that you can see that variables exist but inside view they are not visible. Please, if anyone wants to test, i will be very grateful...

Thank you

P.S. I was editing files from my existing project, so please excuse me for using too many view files...

and i am sorry for duplicating this post Sad


  mod_rewrite problem...
Posted by: El Forum - 10-13-2007, 06:22 AM - No Replies

[eluser]Lockzi[/eluser]
Hello,

I have the wierdest problem with mod_rewrite ever! I run the latest version of WAMP, I've been developing on this install for about a month, no problem at all. Now I started a new project it all seemed fine.

The index page works fine, but as soon as I link to a different function in the same controller, I get this error message (I'm autoloading the database library, by the way):

Code:
Fatal Error: Connection to database failed.

Even though I have

Code:
function viewforum()
    {
        die(var_dump("test"));
        ...
    }

It all works fine if I have

Code:
$config['index_page'] = "index.php";
in the config.php file.

Here's my .htaccess file as well

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>


  Resize and crop - strange
Posted by: El Forum - 10-13-2007, 06:02 AM - No Replies

[eluser]K-C[/eluser]
I have these lines in my code.

Code:
$this->load->library('image_lib');
$uploadDir = $basepath.'/imgs/library/thumb_small/';
$oriDir = $basepath.'/imgs/library/';

// let's create a thumbnail while we're here.
$config2['image_library'] = 'GD2';
$config2['source_image'] = $oriDir.$img['file_name'];            
$config2['create_thumb'] = true;
$config2['maintain_ratio'] = true;
$config2['width'] = 66;
$config2['height'] = 66;

$config2['new_image'] = $uploadDir.$img['file_name'];
                
$this->image_lib->initialize($config2);
$this->image_lib->resize();


But strange thing is I found out the Image_lib called resize function follow up by crop
function. Anyone know why?

Following are what I see when I try to echo the parameter in
$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);

Resource id #49,Resource id #48,0,0,0,0,66,21,480,147
Resource id #54,Resource id #53,0,0,0,0,66,21,66,21


  Extracting Data
Posted by: El Forum - 10-13-2007, 05:09 AM - No Replies

[eluser]leonglass[/eluser]
Ok I have a problem with extracting data from my db. Probably more of a problem with my understanding of MySql than anything else but here goes. I have a game site that I am re-writing (to use CI) and I want to extract the categories and the first four games from each category for the index page. I can't seem to get the queries right for this.

Code:
function index()
{
   $data['cats'] = $this->db->get('GA_cats');
        
   foreach($data['cats']->result() as $row)
   {
        $data['games'] += $this->db->get('GA_games', 4);
   }
        
   $this->load->view('game_view', $data);
}
Now I could just get the cats info and pass that into the view and then do a get limiting to 4 from within the view but that sort of defeats the point in having CI nicely split up the controllers and views. Is there a way to extract this data in one hit with a join clause or something like that. By the way the error that code causes is:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined index: games

Filename: controllers/game.php

Line Number: 12
I have also tried
Code:
$data[$row->id] = $this->db->get('GA_games', 4);
which gave me problems when trying to extract the data in the view.


  headers already sent problem
Posted by: El Forum - 10-13-2007, 03:37 AM - No Replies

[eluser]maks80[/eluser]
Hi,

I've just started to use CodeIgniter and I have big problem on the begining with sessions or sending cookies.
Here is page with error.
error page
This page is CodeIgniter 1.5.4, after downloading I just added session library to autoload.php and I didn't change anything more.
Could you advice me how I can solve the problem?


  Building Forum using CI, mocking ExpressionEngine forum
Posted by: El Forum - 10-13-2007, 02:34 AM - No Replies

[eluser]Jon L[/eluser]
I think the ExpressionEngine forum module appears to be effective, light enough, speedy enough, etc, and I also like the default theme used here, so in my spare time I've been working on building up a forum of my own, but completely copying the forum appearance and functionality that you find here in the codeigniter forums. i'm not a designer, which is why I copied the theme appearance, but I'll have a designer redesign the application once I'm finished.

progress
I'd say I'm about 60% complete on the frontend (haven't worked on administrative portion yet), and I haven't built user management yet, though that's next on my to-do.

basic functionality
adding/removing categories and unlimited-recursion subcategories is functioning, as are threads, posts, and replies. i made an enhancement as well, so that when subcategories exist within a given category, they display above the thread list.

posts have properly functioning smileys and bbcode usage.

features
regarding bbcode, I found a user-contributed bbcode helper that I've used as a base, and then I extended it to support quote tags, code tags, and even advanced code tags for special geshi-syntax highlighting (so you can specify code="php", and you'll have php syntax highlighting).

another thing about my bbcode implementation, is that if you try to nest code tags here or in most other forum software, you'll find that nested code tags tend to break. i.e. - {code} stuff {code} nested bbcode example {/code} here {/code}

the proper intended functionality for a nested code tag, is for you to be able to reference the bbcode code tag itself as-is.

my implementation of the code tag parsing preserves nested code blocks without parsing :-)

to-do
I've still got a ways to go. Forum validation, error handling, administration; User component & administration for standalone forum operation; support for integrating the forum software into external applications and using external user tables (i.e. - attach the forum to a CMS or ecommerce software), alternate theme support, etc, but I'm happy with how far I've gotten

underlying code
btw, I've built my forum models in a way that the forum model itself calls upon 2 models, the first is for forum category access, the second is for post access. i've abstracted my models in this fashion so that the category model and post model can possibly be used for other purposes (I'm a huge fan of code re-use). additionally, both category and post models use the Nested Set library by Thunder (heavily modified - it was initially a Model, so I turned it into a Library. also, it didn't use native CI query generation, and there were a few other enhancements it needed, which I implemented).

performance
I'm happy with the # queries used to generate the forum display currently (single-digit queries atm), but I'm also aware that the finished product will obviously cause more queries to be generated, so I won't report on that yet, as it's nowhere near indicative of the final product's performance.

this is my first time building a forum, so scaling will be something interesting to measure as well, when complete.


  Using the validation class with itihe form helper
Posted by: El Forum - 10-13-2007, 12:12 AM - No Replies

[eluser]phester[/eluser]
Hello All,
I am trying to figure out how to use the validation class to repopulate a select menu generated with the form helper.

Using the validation class with the form class for most input fields is simple:

Code:
form_input(array('name' => 'email', 'value' => $this->validation->email));

However, it's not so simple for a select menu.

This is what the user guide for the validation class has for pre-setting the select menu:
Code:
//From the validation class
<select name="myselect">
<option value="one" &lt;?= $this->validation->set_select('myselect', 'one'); ?&gt; >One</option>
<option value="two" &lt;?= $this->validation->set_select('myselect', 'two'); ?&gt; >Three</option>
<option value="three" &lt;?= $this->validation->set_select('myselect', 'three'); ?&gt; >Three</option>
</select>

And here is what the user guide for the form helper has for pre-setting the select menu:
Code:
//From the form helper
$options = array(
                  'small'  => 'Small Shirt',
                  'med'    => 'Medium Shirt',
                  'large'   => 'Large Shirt',
                  'xlarge' => 'Extra Large Shirt',
                );

echo form_dropdown('shirts', $options, 'large');  //This would select "large"

I will need to know which "value" to select to pass it to the form helper. Any ideas on how to work around that? I hope I described this situation clearly. Any help is greatly appreciated;


  blank page when autoloading database
Posted by: El Forum - 10-12-2007, 10:23 PM - No Replies

[eluser]chic[/eluser]
Good day to all,

i have an issue using code igniter on windows
In WAMP or Vertrigo when i autoload database i get a blank page instead of the usual index page.

without autoload database, index page works fine
when autoloading database, index page went blank

this problem does not happen on linux machine. even the default
codeigniter page which displays the welcome messsage went blank too

please help.

thanks a lot


  Adding data to $_POST
Posted by: El Forum - 10-12-2007, 06:09 PM - No Replies

[eluser]Majd Taby[/eluser]
Hey, I have a checkbox, I want the checkbox to pass 0 in the POST array if it's not checked, and 1 if it is.

The problem is, checkbox's don't pass anything if they're not selected, as if they're not even in the form. So what i need to do is add it. AFAIK, accessing POST directly is bad practice, so i tried this:

$this->input->post('confidential') = intval($this->input->post('confidential'));

But that gives me an error:

Fatal error: Can't use method return value in write context in /Users/majd/Sites/cap1_wc/trunk/system/application/backend/controllers/BusinessListings.php


What do you guys think?


  Visual app for building web apps?
Posted by: El Forum - 10-12-2007, 05:15 PM - No Replies

[eluser]bosco500[/eluser]
DBase has a great visual app that is used for building desktop applications. Drag and drop form elements, set variables, etc... Is there anything like this out there that will work with PHP? I'm starting nice size app, and was thinking it sure would save a lot of time. Building forms and designing good looking pages takes TONS of time away from developing, and I suck ass at designing anyway!!


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by PaulC
Today, 05:09 AM
CodeIgniter.com - Report ...
by Harry Lyre
Today, 04:26 AM
Setting baseURL in Regist...
by michalsn
Today, 12:09 AM
Update from 4.6.0 to 4.6....
by FlavioSuar
Yesterday, 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
CodeIgniter Shield 1.0.0 ...
by timesprayer
05-10-2025, 05:22 AM
Website Traffic Drop Afte...
by InsiteFX
05-10-2025, 04:23 AM

Forum Statistics
» Members: 146,002
» Latest member: georgemanilo
» Forum threads: 78,389
» Forum posts: 379,450

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB