MainelyDesign.com Blog

Site Avenger Tagged Blog Posts

Global Mysql Find and Replace with CakePHP

Posted on 08/31/2010 at 09:03 am | Viewed 14,841 times | 0 comments

I'm moving my Content Management System over to CakePHP 1.3.  I'll post an article about my experiences later.  Today I will focus on one and only one issue with the migration from Cake 1.2 to 1.3: the change of webroot/theme/ to webroot/theme/ to serve static content.  At first I was a little disapointed/scared at the prospects of making this change, but have since come to see the absolute brilliance in this approach.

Upgrading Jquery UI Tabs and it Stopped Working

Posted on 12/09/2009 at 08:16 pm | Viewed 12,962 times | 0 comments

I was upgrading the version of Jquery UI that I use with Site Avenger.  The last time I was in a rush, nothing seemed to work and I rolled the changes back.  This time, I took the time and decided to finally make this Jquery UI upgrade happen.  This time everything went swell, except my Jquery UI tabs plugin stopped working.  WTF?

Cakephp's Flay Class is Amazing - Examples Included

Posted on 09/08/2009 at 09:31 pm | Viewed 13,971 times | 0 comments

If you haven't checked out CakePHP's Flay class, check it out. It's one of the best utility classes for text output in CakePHP.

I just noticed that my blog was using the same META description for all of my blog entries- not good for SEO.  Instead, I want to pull a fragment of the article copy and use that as my META description.  I currently use this convoluted way to get my summaries from the article copy, so I decided to try using the Flay class.  I've used it before but I'm glad I revisited it... it's amazing!

Changing Filetypes Shown in SWF Upload File Browser

Posted on 08/25/2009 at 04:17 pm | Viewed 16,672 times | 0 comments

It's easy to change which file types are allowed to show up (and are displayed) when you browse for files to upload through SWF Upload.  SWF Upload makes it easy to upload multiple files in PHP.

I just had to hunt through some source files until I found this in my SWF Upload config. (goes in the new SWFUpload() function)

TinyMCE Doesn't Work in IE8

Posted on 07/24/2009 at 11:54 am | Viewed 26,753 times | 4 comments

I was training a client how to update their web site using Site Avenger when the strangest thing happened- no copy was showing in TinyMCE.  No matter what I pasted the tiny editor would remain a nice, plain white.  I didn't think to try typing directly into TinyMCE.  No matter, a click on the HTML button to view the source revealed the content was in fact there, just not being shown within the TinyMCE editor.

Changing the CakePHP Model Schema on the Fly

Posted on 06/11/2009 at 10:28 am | Viewed 14,219 times | 0 comments

I have an interesting way of dynamically changing a model's validation on the fly.  I have a standard approach that involves contact forms, contest entries, etc. using a database to store which fields should be on a form.  I tweaked this over time, and recently needed to change the schema from text, which all answers have been up to this point (and IS the DB field type), to a type of date. I kept getting the error 'preg_replace expects parameter 2 to be a string, array given'.  Once I got the right schema, the errors went away.

Displaying phpinfo() without CSS styles

Posted on 06/09/2009 at 10:18 am | Viewed 23,312 times | 1 comment

I wanted logged in users to be able to see the output from phpinfo(); within Site Avenger.  The problem with using phpinfo() is that it outputs a full HTML page, CSS styles and all.  In the past this has been fine, but now I wanted to show the phpinfo() within the Site Avenger layout and CSS styles.  I came across a simple, yet highly effective solution...

A tale of caution: naming CakePHP "view" functions

Posted on 05/06/2009 at 05:13 pm | Viewed 14,338 times | 2 comments

Spoiler: functions that generate a view must be named using lower_case_with_underscores()

I just ran into a very interesting problem.  I was testing out some of my plugins to make sure they were still working with Cake version 1.2.2.8120.  They worked fine except for one function.  I had a form that updates a shopping cart, changing the quantities of products placed in the cart.  When I hit the submit button to change the quantities, I was getting redirected to my site root. 

Preformatted Text in TinyMCE <pre></pre>

Posted on 04/21/2009 at 10:26 am | Viewed 21,722 times | 1 comment

Now that I've got my blog up and running, I've been playing around with syntax highlighting of source code.  I really appreciate sites that serve up code samples in a nice format, so I've tried to comply with my own version of this best practice.

Getting Geshi working, for syntax highlighting was one battle (I'll try and post what I came up with later). My real trouble came with using <pre></pre> tags for my code samples within TinyMCE.  I absolutely love TinyMCE! I did a lot of research on the best JavaScript-based WYSIWYG editor oh about 5 years ago, and decided on TinyMCE and never looked back.  I use it in all of my applications that require formatted HTML input (especially Site Avenger).  Every now and then I will look at another editor (I know 5 years is ancient by web standards) but I've never found an editor I like more.  Each editor has its quirks and I think the quirks within TinyMCE are the most manageable (as I tell my clients- even MS Word has quirks, you're just used to them).

Importing an Excel file into CakePHP

Posted on 04/16/2009 at 02:42 pm | Viewed 33,691 times | 0 comments

I needed to be able to upload an excel file, parse the file, and then add each row as a separate database entry.  I had this working for a CSV file using the php built-in function fgetcsv(), but the client switched to using an excel file (instead of direct PHP access to the in-house database, we decided to have the client upload a CSV/Excel file). 

Full Tag List

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design