Welcome Guest, Not a member yet? Register   Sign In
  Moved Site to New Computer. DB not connecting
Posted by: El Forum - 06-05-2008, 08:11 PM - Replies (2)

[eluser]bennyhill[/eluser]
Hello,
My laptop which had apache and mysql loaded and configured has crashed. I moved my codeigniter site to a new pc with wamp server installed and copied my database files over to the MySQL data folder. When I try to view my site i get the error,

"Unable to connect to your database server using the provided settings."

Anything you suggest I look at to get my site connecting to my database again?


  Backticks not added when using custom operator (v1.6.2)
Posted by: El Forum - 06-05-2008, 07:56 PM - Replies (2)

[eluser]Unknown[/eluser]
in my code (where CI is a codeigniter instance)

$this->CI->db->where("left >", (int)$record[$this->left_column]);

produces: ...WHERE left > 11...

$this->CI->db->where("left", (int)$record[$this->left_column]);

produces: ...WHERE `left` = 11...

In the former case, where I am using a custom operator the backticks are not produced and I have to insert them myself. This seems to be fairly inconsistent and inconvenient. Please consider fixing this.

Suggested fix:
change line 444 in DB_active_rec.php from
$k = preg_replace("/([A-Za-z_0-9]+)/", $this->_protect_identifiers('$1'), $k);
to
$k = preg_replace("/([A-Za-z_0-9]+)/e", '$this->_protect_identifiers("\\1")', $k);


  Google Analytics & Codeigniter
Posted by: El Forum - 06-05-2008, 07:50 PM - Replies (29)

[eluser]Unknown[/eluser]
Hello,

I'm having a problem with tracking email newsletters that point at my site because the URL's are re-written to include Google Analytics campaign tracking segments.

For example, this doesn't work....

The '?' character is causing the page to register as a 404.

However, If I add a '/' after the last word, it then works, but this seems unnecessary.

Do I need to force a '/' at the end of all my URL's? Or is there (hopefully) another way around this?

Thanks in advance.


  Why can't I limit this Array
Posted by: El Forum - 06-05-2008, 06:41 PM - Replies (1)

[eluser]RaZoR LeGaCy[/eluser]
I am having problems limiting this array. I tried array_slice and it didn't work.

Code:
$channel = Array ( [items] => Array ( [0] => Array ( [title] => 'Horror frog' breaks own bones to produce claws [link] => http://digg.com/general_sciences/Horror_frog_breaks_own_bones_to_produce_claws_3 [description] => Actively breaks its own bones to produce claws that puncture their way out of the frog's toe pads, probably when it is threatened. [pubDate] => Thu, 29 May 2008 10:57:24 +0000 ) [1] => Array ( [title] => The 7 Most Annoying People On Digg [link] => http://digg.com/comedy/The_7_Most_Annoying_People_On_Digg [description] => Despite being arguably the most mainstream site of its kind, digg.com still is not free of the countless horrors that spawn in the seedy underbelly of the net. Today, we take you on a virtual safari to show you some of the worst species in the digg community. [pubDate] => Fri, 23 May 2008 00:53:50 +0000 ) )

I want to limit that and my current code is
Code:
if(is_array($channel)) {
    foreach ($channel as $item) {
    
        foreach ($item as $row) {
        
            echo $row['title'] ."<br />\n";
        }
    }
}
else {
    break;
}

Thanks everyone.


  Restrict direct image viewing
Posted by: El Forum - 06-05-2008, 06:11 PM - Replies (13)

[eluser]Chris Williams[/eluser]
I'm not sure how to approach this. Maybe I can get some pointers/resources to help me with this.

Okay, I don't want images viewable from where they get uploaded to the site.

Code:
<img src="/upload/2008/06/05/10.png" />

because this photo was marked private and associated to a db record, I'd LOVE to be able to refer to it as this

Code:
<img src="/user/a.png" />

"user" is a field value and "a" is another field value.


  Multiple MY_Controller's
Posted by: El Forum - 06-05-2008, 03:19 PM - Replies (5)

[eluser]jasonjohnson[/eluser]
Is it possible to extend "Controller" in two (or more) different ways? The public side of the system I'm building needs distinctly different default controller functionality than the back-end does.

Currently, I have "MY_Controller" setup to handle the back-end default controller functionality. More or less looking for "My_Controller_Public" -- not sure if that's possible.

Anyone have an elegant solution to this?

Thanks.


  sorting question
Posted by: El Forum - 06-05-2008, 03:00 PM - No Replies

[eluser]Unknown[/eluser]
Hi Paulo,

Awesome tool you have here with Flexigrid... I just had a question. Is there a way to have a default sorting order on the columns?

That is, when the page loads to automatically have the column 'date' to be sorted in descending order?

Also, is there a way for me to instruct Flexigrid how to sort a 'date' or a 'grade point average' or any other data format?

Again, your tool really rocks and I am certain many other developers will begin using once they realize how awesome it is.

Thanks a bunch,
Omid Sadeghpour


  403 files in controllers, libraries, models, views folders
Posted by: El Forum - 06-05-2008, 02:13 PM - Replies (1)

[eluser]AtlantixMedia[/eluser]
Hello,

is it necessary to have 403 html files in those folders and any subfolders to prevent directory access? I have a custom setup where a 404 splash page is served when a page is not found which seems to be a lot better and more anonymous than a 403 error. which one is considered best practice?

thanks


  Any large(-ish) scale open source projects using CI?
Posted by: El Forum - 06-05-2008, 01:45 PM - Replies (6)

[eluser]Unknown[/eluser]
I am considering using CI for a large project at my company. Before we get started however, I'd really like to see an example of a large(-ish) app running the framework so that I can get a better feel for how it would all layout.

Is there anything open source I can look at to see how it all works together on a larger scale (I'm pretty new to MVC-style programming)?

Basically any type of app would be fine (full-featured blog, CMS, forum, etc.). I've seen references to several projects in development, but no full/complete applications.

Thanks.


  Problem with pagination lib
Posted by: El Forum - 06-05-2008, 01:12 PM - Replies (1)

[eluser]louis w[/eluser]
I am having a problem with the pagination lib, everything works fine except the "1" and Prev links aren't working correctly.

My config is:

Code:
Nav Config = Array
(
    [base_url] => /blah/blah/blah/results/141/
    [total_rows] => 17
    [per_page] => 10
    [uri_segment] => 5
)

It shows 2 items in the nav list. When I click on 2, it redirects to /blah/blah/blah/results/141/10 and everything is fine. But when I click on 1 it also has an href of /blah/blah/blah/results/141/10...

There is no way to get back to the first page.

Any idea?


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

Username
  

Password
  





Latest Threads
CI NEEDS A PROPER DOCUMEN...
by kenjis
42 minutes ago
Optimize.php make a probl...
by kenjis
52 minutes ago
Get date from datetime fi...
by Bosborne
4 hours ago
Protect certain pages in ...
by frocco
8 hours ago
Gateway time out CI 4.4.1
by adleon73
8 hours ago
Reading a session variabl...
by Bosborne
11 hours ago
Trying to remove index.ph...
by kabeza
Today, 04:13 AM
CodeIgniter 3 to 4 migrat...
by kenjis
Today, 02:15 AM
Background image does not...
by ozornick
Today, 12:49 AM
Implement DDD in Codeigni...
by InsiteFX
Yesterday, 09:56 PM

Forum Statistics
» Members: 86,887
» Latest member: katrinaarrellh
» Forum threads: 77,627
» Forum posts: 376,236

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB