I really have been making some dumb mistakes the last few days.
Im suffering from a strange flu, so I think I will blame that on my scatterbrain and tendency to make the smallest problem a 3 hour ordeal.

Anyway, whilst sorting out my Virtualbox VM (Ubuntu Server) another of my php scripts broke. At the time, of course I presumed that it couldnt possibly have been anything I'd done, so proceeded to spend the next few hours scouring the web for others with similar problems.

Turns out in my inpatience, my first assumption was correct, which was that I had no ftp module installed on the machine.

A simple apt-get install proftpd would fix it right?
Yep, should have, but the download failed and three coffees later  I remembered that earlier, I had been playing with my hostnames and my vm wasnt getting an internet connection.

Doh.

Fixed the hostname problem, then installed proftp which of course opened up port 21 and all is good with the world again.
Well I have been trying to get my Virtual server running on Virtualbox and hit across the problem of "sockets not connecting" whenever trying to run an email method.

My custom CMS uses gmail to route mail through, so I really should have seen the problem straight away, but for those that also use a gmail setup to send email from their scripts, "Could not connect to socket" actually means.

"You dont have OpenSSL installed dummy!"

So I installed OpenSSL and its all running nicely.
Well, this has been an ongoing thing for me of late.
I love SPAW Editor, but I have had trouble integrating it into my CodeIgniter CMS.
In particular, the quicklinks to link to my database pages.

After much deliberation, it seems, Ive been going around it the wrong way.
First off I used this fellows custom integration, which seemed to work well out of the box, but for the life of me couldn't figure out how to integrate the quicklinks.

Easy solution:

After loading the library in your 'Controller', call it like this

//    Load up Spaw Editor
$config = array(
'name'    => 'content_data[body]',
'caption' => 'Images',
'content' => $data['content_data']->body
);

$this->load->library('spaw', $config);
           
$quicklinks = $this->admin_content_model->get_quicklinks();
$this->spaw->setConfigItem("quick_links", $quicklinks, SPAW_CFG_TRANSFER_SECURE);

Obviously you will have to create a function in "admin_content_model" model to pull the links from your database.

Basically just 2 lines of code in the Controller passing the Spaw instance back to the view.

Worked a treat!

 

Categories

Latest Posts

RSS