Archive

Posts Tagged ‘app’

Styling the The TinyMCE Text Area

January 4th, 2010 Chris No comments

They guys who produce TinyMCE suggest, when initialising the editor, that you set the content_css parameter to be the url to your site’s CSS, so that the content you type into the text area is styled in the same way as the rest of your site.

This is a great idea and works very well, but a lot of CSS layouts make use of various text positioning options which don’t really apply when translated to a wysiwyg editor, for example making the default alignment centred with no padding.

Thankfully you can get around all of this quite easily and add further custom styling to your editor’s textarea by adding the .mceContentBody style to the end of your site’s CSS file and specifying any further layout options in that.

For example the following css tells the editor in my app to always ensure the text alignment is left justified by default and give a 10 pixel padding to the textarea the editor’s being applied to so that the text that will be input by the user doesn’t squash up against any particular border of the text area itself:

.mceContentBody {
text-align: left;
padding: 10px;
}

Nice and simple really but not so easy to find quickly when searching on Google so I hope this helps someone else out there too!

Starting App’s For Facebook

September 19th, 2007 Chris 3 comments

Yesterday for a bit of fun I decided I'd try and write my first application for facebook - and I have to say the setup based on the example code they give you is pretty straightforward, however it could do with some extra vital documentation.

What would be in this documentation you ask?

You might think, "being a social networking site users may want to upload photos or other files to your app. for various reasons", so lets make that side of things easy and secure.

Well obviously facebook didn't, and as such seem to have turned off/prevented access to PHP's $_FILES array and don't mention it anywhere obvious.

This is annoying as it wasn't really mentioned anywhere and, after all, your app is essentially it's own self contained program sitting on it's own server somewhere which obeys it's own set of rules and just appears on facebook by means of, what can only be described as an extended iframe, so why should they prevent access?

In fact file upload is possible but you have to do it via some convoluted method where you mime encode the file and send it through via POST, which is a pain.

Though I spent 3 hours or so trying to work out why my app wasn't receiving files before finding this out, that hasn't deterred me and you can expect some more posts about Facebook app building here as soon as I have time to write them :)

Categories: MySQL, PHP Tags: , , ,