Welcome Guest, Not a member yet? Register   Sign In
  How easy is it to share data between apps?
Posted by: El Forum - 07-03-2008, 05:52 PM - Replies (6)

[eluser]ThomasOwens[/eluser]
I haven't tried this yet, but I hope to experiment more with this framework over this long weekend. Anyway, let's say I have this structure:

-home
--index.html
--system
---cross application code (login support, user profiles, etc)
--blog
---index.php
---system
----a blog application and it's stuff
--forums
---index.php
---system
----a forum application and its stuff

Can the blog and forum applications call views and such from the "home" system? Each is a stand alone application, but shares things like user profiles and whatnot. I want to put the shared code into home application and then application specific code into the other categories.

A related question is can I have multiple copies of index.php, each with a different name? For example, a forum.php and a blog.php in the same directory, each with it's own models, views, and controllers (most likely in differently named "system" directories).

Thanks to anyone that helps! Smile


  mysql date filter
Posted by: El Forum - 07-03-2008, 05:12 PM - Replies (4)

[eluser]dbashyal[/eluser]
i have a date in the format of YYYY-MM-DD in the table and i want to select all rows that belongs to month = 01, is there any easy method to do this.

i have made a separate field for month and pulling data checking the month field, as the project was due soon.

But, I am wondering if i can do above query without creating separate field month coz sometime i may have to query for year or even day and then i have to store date in separate fields day, month and year.


  Clean URL question
Posted by: El Forum - 07-03-2008, 04:06 PM - Replies (3)

[eluser]Unknown[/eluser]
Hi I am new to the PHP/CodeIgniter scene.

My problem lies with an efficient way to retrieve data out a database, without sending the id in the URL and after using url_title(); I convert my article title to 'this-is-my-article'

so my URLs currently are http://localhost/mysite/index.php/view/t...my-article.

Is there away to retrieve the data using the id without sending it in the URL. I ultimately want to be able to click on an article's title and then using a clear URL with no ID number be able to display more fields from the database. The only other way that I can see to do this is to take each article title out the data convert using url_title(); and compare it to the url using the URI segment function. I worried that this can cause long delays.

Help would be appreciated.
Regards,
Andrew


  What's wrong with my pagination?
Posted by: El Forum - 07-03-2008, 03:20 PM - Replies (6)

[eluser]EEssam[/eluser]
Hi,

Here is my code:

Code:
function show()
    {
        // Paginate
        $this->load->library('pagination');

        $page = $this->uri->segment(4, 1);

        $config['base_url'] = site_url('mailinglist/show/');
        $config['total_rows'] = $this->mailinglist_model->get_subscriber_total();
        $config['per_page'] = '2';
        $config['uri_segment'] = '4';

        $this->pagination->initialize($config);

        $data['pagenav'] = $this->pagination->create_links();

        // Counting the offset
        $offset = $page * $config['per_page'];

        // Get subscribers
        $data['mailinglist'] = $this->mailinglist_model->get_subscriber_list($offset, $config['per_page']);

        $this->load->view('mailinglist_show', $data);
    }

Any my model looks like this:

Code:
function get_subscriber_total()
    {
        return $this->db->count_all('mailinglist');;
    }

    function get_subscriber_list($offset, $row_count)
    {
        echo "[$row_count], $offset";
        $this->db->limit($row_count, $offset);
        $query = $this->db->get('mailinglist');

        return $query;
    }

The pagination is showing more pages than what it should show.

Please help.


  adding object to a db query result
Posted by: El Forum - 07-03-2008, 02:12 PM - Replies (3)

[eluser]kidego32[/eluser]
Hello,


I have a $data['result'] in my controller that was generated from a $query->result() in my model. I have a date field inside my result set that I'd like to split into the month, day, and year before passing it to the view.

I am able to access the field and split it, but I'm at a loss as to how to add the newly split fields back to the $data['result'] in order to pass it to the view.

Code:
$data['result'] = $this->Customers_model->get();
            
// Split up the date into the month, day, and year
$arr=split("-",$data['result']->dob); // split the array

$year=$arr[0]; // first element of the array is year
$month=$arr[1]; // second element is month
$day=$arr[2]; // third element is day
            
            
// Add these new values to the $data['result'] array
            
            
$this->load->view('customers/update_view',$data);

Does anyone know how I can add the $year, $month, and $day variables to the $data['result'] set?


  help in building a blogging site
Posted by: El Forum - 07-03-2008, 01:17 PM - Replies (2)

[eluser]ebot[/eluser]
Hello to all. i am an undergraduate mathematics and minor computer sciences student at the university of buea and i am working building a blog site using code igniter. well the problem the model use in retrieving infos from the database in wanna display it on the following pages: the home by side as recent blog, on the blog view page in such a way that one can click on it then it takes him to a post page where in can drop a comment on that post. i wiil be grateful to have help on this.
Thanks to all for your understanding.
Ebot Tabi.


  htaccess exclude sub-directory in the url rewriting.
Posted by: El Forum - 07-03-2008, 12:56 PM - Replies (9)

[eluser]Atas[/eluser]
Hello, I have the following .htaccess:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|cgi-bin|assets|blog|sitemap\.xml|export)
RewriteRule ^(.*)$ index.php/$1? [L]

I want to know how to exclude a sub-directory (e.g. "blog/images") in the url rewriting (RewriteCond line). In the .htaccess I can only exclude a directory, if I want to exclude a subdirectory (a directory within a directory) I can't do it.

Any help would be appreciated.
Thanks,


  xss_clean adds semicolon to anything with an &
Posted by: El Forum - 07-03-2008, 11:29 AM - Replies (18)

[eluser]dmorin[/eluser]
I've noticed that the xss_clean function seems to add a semi-colon to any string that contains an ampersand. For example, if someone writes "AT&T;Park" in a textarea and I run it through the xss_clean function, it will return "AT&T;Park".

Has anyone else seen this? Any recommendations? Thanks.

Edit: This is pretty funny.....they must use xss_clean for this forum, so both of the things above say AT&T;Park. What it should say is:

ATampersandT Park


  PLEASE DELETE POST
Posted by: El Forum - 07-03-2008, 09:55 AM - Replies (1)

[eluser]Mitja B.[/eluser]
PLEASE DELETE POST

regards


  Data Form Efficiency
Posted by: El Forum - 07-03-2008, 09:23 AM - Replies (8)

[eluser]Sondlen[/eluser]
I am using jQuery to build dynamic data entry forms or spreadsheets. Currently, it looks like the max is about 80 or so separate fields.

Since the amount of fields can be resized, I can have as little as about 10 fields. I have JavaScript checking the data as it is being input, but I am reserving actual data submission to a single post. Since I am using the validation class to valid and clean the fields, do I need to set up rules for every single potential field?

I currently have this

Code:
$rules = array(
            
            '10' => 'trim|numeric', '11' => 'trim|numeric', '12' => 'trim|numeric',
            '13' => 'trim|numeric', '14' => 'trim|numeric', '15' => 'trim|numeric',
            '16' => 'trim|numeric', '17' => 'trim|numeric'
        );

should I do this 80 times? Is there a more efficient way to achieve this because this seems quite inefficient.


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

Username
  

Password
  





Latest Threads
Version number stays un-u...
by trunky
1 hour ago
codeigniter4/queue Not lo...
by mywebmanavgat
5 hours ago
Array to HTML "Table"
by HarmW94
6 hours ago
shortcodes for ci4
by xsPurX
8 hours ago
TypeError when trying to ...
by b126
Today, 12:04 AM
Webhooks and WebSockets
by InsiteFX
Yesterday, 10:39 AM
Retaining search variable...
by pchriley
Yesterday, 05:46 AM
Reading a session variabl...
by xanabobana
Yesterday, 05:05 AM
Update to v4.5.1, same us...
by kenjis
04-17-2024, 07:47 PM
Codeigniter 4 extend core...
by Semsion
04-17-2024, 05:08 AM

Forum Statistics
» Members: 84,584
» Latest member: kalyt72
» Forum threads: 77,560
» Forum posts: 375,900

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB