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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,764
» Latest member: baovesamurai
» Forum threads: 68,096
» Forum posts: 424,954

Full Statistics

Latest Threads
Do I need to separate aja...
Forum: Best Practices
9 minutes ago
» Replies: 2   » Views: 44
Foreign key and model rel...
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 14
Building a website value ...
Forum: Jobs
1 hour ago
» Replies: 2   » Views: 98
domain alias with base_ur...
Forum: Lounge
4 hours ago
» Replies: 2   » Views: 30
CI4 Db
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 5   » Views: 89
Create a Full Featured Re...
Forum: Model-View-Controller
5 hours ago
» Replies: 4   » Views: 293
Load method location
Forum: Model-View-Controller
5 hours ago
» Replies: 2   » Views: 24
Hide item price if user i...
Forum: Lounge
Yesterday, 03:14 PM
» Replies: 1   » Views: 44
CodeIgniter 3.1.9 release...
Forum: News & Discussion
Yesterday, 02:41 PM
» Replies: 34   » Views: 14,673
CodeIgniter HMVC error
Forum: Addins
Yesterday, 01:36 PM
» Replies: 2   » Views: 212

 
  Where to store table coding frames
Posted by: El Forum - 09-24-2007, 03:18 AM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]
In two tables of my database, I use the same coding frame for a common variable. This maps a relatively small number of values (around 10) to longer strings and doesn't seem worth creating a new table to perform joins on to.

What is the best way of decoding the values pulled out of these tables?

If they were only used in one table then I would simply create the mapping as an associative array defining a model property and use that in the model functions. However, when two different tables use it - this is trickier unless I perhaps create a parent class with the decoding function. Alternatively, I could create a static decoding function in one model that both models can use. Or a decoding plugin. Or a static function in a new library class.

Someone please tell me what the best approach is.


  Caching without views?
Posted by: El Forum - 09-24-2007, 01:43 AM - Forum: Archived Development & Programming - Replies (9)

[eluser]Sarfaraz Momin[/eluser]
I have a set of controllers where the output is directly echoed from instead of sending it to the views. The templates are dynamic pulled from database so there is no need of any views. The issue is when i enable caching I am able to see a file generated in the cache folder but the next time I refresh the page it comes up blank. In short it does not work. I have to disable caching and delete the cache file to make the page work again. Am I missing something or is caching available only if we have view files. Please help since today is the deadline for the application to be completed and this is my last module to be implemented.


  URI routing
Posted by: El Forum - 09-23-2007, 09:47 PM - Forum: Archived Development & Programming - Replies (7)

[eluser]K-C[/eluser]
Currently, the URL displayed as http://localhost/index.php/member/mainprofile/5. How can I display it as http://localhost/member/5?

I tried using the routing but did not managed to find a way.


  Best way to handle user auth?
Posted by: El Forum - 09-23-2007, 05:58 PM - Forum: Archived Development & Programming - Replies (5)

[eluser]ballen[/eluser]
Hi all,

I was wondering, and not necessarily just in CI, what people regard as the best way to handle sessions and user authentication. Is it best to store the email and hashed password and recheck every time, or to set a "is_logged_in" type variable, and check this is true.
Or any other options? I was mainly wondering about database hits and security.

Thanks


  Modular Page
Posted by: El Forum - 09-23-2007, 04:40 PM - Forum: Archived Development & Programming - Replies (5)

[eluser]Kemik[/eluser]
Hello all,

Firstly, I want to say that by modular in this case I don't mean the file structure, I mean the page structure.

I'm building a iGoogle (Google Homepage) style interface for my friend's business. It will have 3 or 4 sections.

1. Calendar with icons for different tasks.
2. Today's tasks with icons for mark done, edit and delete.
3. Shoutbox style system with the top half of the section the messages, the bottom half the input box.

The page is split in to 1/4's. One for each section.

How would be best to code this? Especially the view file. Keeping it separate from each other (file system) would be most wanted as it makes maintaining easier.


  HTML Table Class, $this->table->generate($query)
Posted by: El Forum - 09-23-2007, 01:28 PM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]

Code:
if ($cell == "")
{
  $out .= $this->empty_cells;
}
else
{
  $out .= $cell;
}
If data from database is 0 ($cell = 0), then this expression
Code:
($cell == "")
= TRUE


  Dynamic image generation script - where to put?
Posted by: El Forum - 09-23-2007, 01:25 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]IanMcQ[/eluser]
Hi,

I'm new to CodeIgniter and so far I'm very impressed with the simiplicity and overall architecture of the program. It's great! I'm lovin' it so far.

Like I said, I'm new to CI and right now I have a dynamic image generation script. What this script does is it generates a "header" image for each and every one of my pages based on a query string. This make page headings look a bit cooler than a generic font that everybody has on their computer. I'd like to put this script into the "CodeIgniter" system (e.g., not have it be outside of my /system/ folder). Where should I put a script like this in CI and how will I initialize it from my controllers? Should I just put it in the /plugin/ directory?

One last thing, where do you guys put your images for your sites? Just /views/images/ or what?

Thanks!
Ian


  Database
Posted by: El Forum - 09-23-2007, 12:23 PM - Forum: Archived Development & Programming - No Replies

[eluser]imzyos[/eluser]
mmm... code

Code:
$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
echo $this->db->querystring();


The echo $this->db->querystring(); must show something like this "select title from my table where id = $id limit 10,20" needed to debug our querys, some function with this behaviour?

may be...

Code:
function getquerystring($table = '', $limit = null, $offset = null)
    {
        if ($table != '')
        {
            $this->from($table);
        }
        
        if ( ! is_null($limit))
        {
            $this->limit($limit, $offset);
        }
            
        $sql = $this->_compile_select();

        return $sql;
    }


  MySQL question: select 2 id's before and 2 id's after current id
Posted by: El Forum - 09-23-2007, 12:05 PM - Forum: Archived Development & Programming - Replies (24)

[eluser]codex[/eluser]
Well, that's basically what I need to do.

I'm working on a small image gallery and I want to select (for instance) the 2 photo id's before and the 2 photo id's after the current photo id, making it show 4 thumbnails. But not the thumb of the current photo.

How do I do this in mysql?


  dynamic menu highlighting
Posted by: El Forum - 09-23-2007, 10:49 AM - Forum: Archived Development & Programming - Replies (6)

[eluser]artificialkid[/eluser]
Hi guys,

just to ask if is any thing in CI like wordpress function is_page(), is for a dynamic menu highlighting with css.

Smile



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