Welcome Guest, Not a member yet? Register   Sign In
  how do i build editor?
Posted by: El Forum - 08-26-2007, 01:43 AM - No Replies

[eluser]wildcard99[/eluser]
Hi guys, I was just wondering, how do I build an editor like the one were using when posting a new topic in this forum..

what helpers and libraries should I use and if you have an example, it will be a big help..

tnx!


  Embedding Wordpress in CI
Posted by: El Forum - 08-25-2007, 07:13 PM - No Replies

[eluser]Unknown[/eluser]
I'm currently in the process of rewriting my site using CI. In connection with that I decided to use an embedded instance of Wordpress for the site news. I have been following the instructions at http://www.shooflydesign.org/buzz/past/e...press.html on how to embed WP.

The above link explains how to include an internal WP file using require(), and then call the global functions of WP to render blog-entries and get data from the WP framework.

It works fine as long as I follow the example given, and keep the code out of reach of CI.

In CI, it seems that no matter how I include the internal WP file, I do not get access to the WP functions. I've confirmed that the file actually gets executed, but it seems that CI somehow prevents me from calling the functions. If I move all the code to an external file, which I then execute by including it from a CI - file (eg. a view), everything works perfectly. Unfortunately, this has the disadvantage of completely isolating CI from my code, which prevents me from passing parameters between WP and CI!

Does anyone know if it is possible to do what I outlined in the first paragraph within CI? Has anyone else attempted to do a similar integration of another application into CI? Hope someone here will be able to help. Thanks in advance.


  Fatal error: Call to a member function row() on a non-object
Posted by: El Forum - 08-25-2007, 05:32 PM - No Replies

[eluser]BrandonDurham[/eluser]
Why would this be happening here?

Code:
$sql = "UPDATE prizes SET
    email                 = '$email',
    fname                = '$first_name',
    lname                = '$last_name',
    address1            = '$address',
    address2             = '$add_address',
    city                 = '$city',
    state                 = '$state',
    zip                  = '$zip',
    date_submitted      = '$date_submitted',
    opt_in                 = '$opt_in',
    company             = '$company',
    day_phone            = '$day_phone',
    evening_phone        = '$evening_phone'
    WHERE id            = '8'
";

$query = $this->db->query($sql);
$row = $query->row();
Here's the full error:
Quote:Fatal error: Call to a member function row() on a non-object in /Users/Deefee/Documents/Sites/073MHG232/system/application/models/db_functions.php on line 88
Line 88 is $row = $query->row();.


  Retrieving the default controller config item
Posted by: El Forum - 08-25-2007, 04:54 PM - No Replies

[eluser]NemetraL[/eluser]
Hello,

The problem is: I'd need to retrieve

Code:
$route['default_controller'];
from a post-controller-constructor hook.

There's the raw way, which consists in copying the Router library code directly inside the hook:
Code:
// Load the routes.php file.
@include(APPPATH.'config/routes'.EXT);
$this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;
unset($route);
The point is: this file has already been loaded and the class has already been created (in the system/codeigniter/CodeIgniter.php file, under the name $RTR).

But once the controller is loaded, I can't find it anymore :-S

Any idea?


  How get referring URL?
Posted by: El Forum - 08-25-2007, 12:44 PM - No Replies

[eluser]brigham[/eluser]
What's the best way to get the URL of the page "before" the current page?

E.g.,
1. User tries to go to page X, but page X requires a logged in user, so
2. Page X bounces user to the login page.
3. The login page, upon completion, sends user on to page X.

I assume that there is an elegant solution to this...


  single ds with MVC?
Posted by: El Forum - 08-25-2007, 12:40 PM - No Replies

[eluser]Matthew90[/eluser]
Hello,

today I have started to work with CI and my first impression is really good :-)
As this is my first job with a framework, the MVC-Model and strict OOP-Programming is new for me.
Now I have an problem with the MVC-Model.
It concerns the following...
I want to return a single data set... without oop no problem:

Code:
$this->db->where(array('id' => $this->uri->segment(3)));
        $query = $this->db->get('projects');
        
        
        if ($query->num_rows() > 0) {
            $row = $query->row();
        
               echo $row->id;
               echo $row->description;
                    
           //...
        }
But how can I do it, when I want to work with the model class?
I tried a lot of iddeas but without a result...
At the moment my code is as followed:

project_model.php
Code:
function get_requested_project($where)
    {
        $this->db->where($where);
        $query = $this->db->get('projects');
        
        if ($query->num_rows() > 0) {
            return $query->row();
        }
        else {
            return false;
        }
    }

admin.php
Code:
function insert_project()
    {
        $this->load->model('project_model');
        
        $row=$this->project_model->get_project(array('id' => $this->uri->segment(3)));
        if ($row != false) {
               echo $row->id;
               echo $row->description;
                    
            $this->load->view('project_insert',$data);
        }

I hope you know what I mean in spite of my bad English and I look forward to get an answer ;-)

Greetings

Matthew


  Validate Dates & Times
Posted by: El Forum - 08-25-2007, 11:40 AM - No Replies

[eluser]Kemik[/eluser]
Hello,

What's the best way to validate a date and time with CodeIgniter? At the moment I'm using Rapyd's dateField but I'm willing to build a form using CI's form helper instead if I have to.

Thanks.


  CI form not posting. on server, but working on localhost. gives error 500
Posted by: El Forum - 08-25-2007, 11:07 AM - No Replies

[eluser]rudydelhi[/eluser]
Hi,

I am configuring a new site on server 1and1.com. Made a simple login form with username/password and trying to post the values, but it gives a strange error error

Error 500 - Internal server error
The server encountered an unexpected condition which prevented it from fulfilling the request.


This same script works well on my localhost. Tried every possible change in the config file and the form path.

Can any someone please out with this problem.

Thanks,
Rudy


  Validation: Formatting Fields
Posted by: El Forum - 08-25-2007, 09:56 AM - No Replies

[eluser]BrandonDurham[/eluser]
I have a "Daytime Phone" field in my form that I'm validating for length and content regardless of how they enter it. The function I'm using also formats the string to be "(555) 555-5555". I'd like to be able to update that form field with the formatted version once it's been checked. How might I do that?

Thanks!


  RSS Aggregator
Posted by: El Forum - 08-25-2007, 07:11 AM - No Replies

[eluser]Kurai[/eluser]
Hi everyone.
I’m really starting with CI, I like it al lot, but, not being a much of a coder, something is still difficult to figure out for me.

I’m trying to do an RSS aggregator, which displays several sources in several ways (I.E: the last post from a blog, flickr images, the most n recent posts for another blog and so on).

Right now I’m proceeding like this: I’ve made an aggregator view which act as a container, and several other views for various bits of codes (header, footer, and the various RSS boxes) to easily edit them.

Then I’ve installed Simplepie as a class and tried fetching a single RSS source, following literally the tutorial at http://www.nextbigleap.com/blog/developm...deigniter/.

This worked pretty fine, but I’m stuck now. I know I should create a function which takes an url as an argument and then returns the array with the rss feed, but I can’t figure out where to create it (a new library maybe?) and how to call it correctly from the view in which I want to display my feed.

I know thisi is probably quite stupid as a question, but I still have difficulties in understanding the differences between classes, models and libraries.

Can anyone lend me a hand? Thank you!

PS: sorry, I've posted this on the Ignited code section also. It's just an error. If it disturbs, please delete the other one. Thank you.


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by InsiteFX
2 hours 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,449
» Latest member: tzsdigital
» Forum threads: 78,390
» Forum posts: 379,460

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB