Pages

Thursday, September 25, 2014

Wordpress replaces html comment end
"-->" with –>

While working on a "Page" in a WordPress site, I wanted to turn off some code overnight that I was going back to in the morning.

I wrapped it in "<!-- -->".

When I loaded the page, it looked okay, but I checked the source and I noticed that my syntax highlighting continued green (html comments) beyond where it should have. When I inspected the code a little closer, I realized it had converted my double dash into a hex code "–"

I found the solution in a comment here: Visual Editor now strips HTML comments where someone mentioned "Raw" I rememebered seeing a button at the top right side of the editing window.

raw button


It puts a bit of markdown code "[raw]" in your page and becomes a
"/raw" button that then puts "[/raw]" on your page.

The result was that anything inside [raw] [/raw] gets rendered to the browser exactly as it is saved in "Text" view.

Problem solved!

Wednesday, September 24, 2014

PHP auto_append_file

Quick and dirty footer (PHP auto_append_file)

I inherited an existing site that was built as a bunch of static HTML files.
I wanted to add a footer (or sub footer) to them without needing to edit something like 50 files.

I was familiar with Apache being able to append a file, but I hadn't used it much so I had to hack away at it until I got it working right.

First thing. I had to get my *.htm files to be treated like PHP files. (get the server to parse them)

Guides online alternatively suggest AddType, AddHandler or a combination of the two.
I am hosted at HostGator and they suggested

AddHandler application/x-httpd-php54 .html .htm

be added to the .htaccess file.

There's one problem down.

I saw conflicting information about whether auto_append_file is allowed in the .htaccess file. I kept getting 500 Internal Server error when I tried it, so I moved it to php.ini

Here's the line I put in there:
auto_append_file = '/home/[MY USER'S USERNAME]/public_html/sub_footer.php'

Then formatted my subfooter to fit properly at the bottom of all the existing pages.

SUCCESS!

I should point out that this is not an ideal solution, but rather a quick and dirty work around until I can actually re-build the site in php. You're likely to run into exceptions and edge cases if you try to use this on an ongoing basis.

Tuesday, September 23, 2014

Choices Psychotherapy St Louis Park, MN

Choices Psychotherapy St Louis Park, MN

I am very happy to announce that I have been given the opportunity to work with Choices Psychotherapy, hosting and continuing to maintain their website.

Choices Psychotherapy is a mental health provider in the Minneapolis, St Paul area, actually located in St. Louis Park.

715 Florida Avenue South
Suite 307
St. Louis Park, MN 55426
http://choicespsychotherapy.net/


The mental health professionals at Choices  Psychotherapy offer Dialectical Behavior Training (DBT), Cognitive Behavioral Therapy (CBT) and Solveig, an intensive outpatient program as well as helping clients cope with various issues including Grief Management, Attachment Issues, Chronic Illness and Pain, Bipolar Disorder as well as anixiety, defiance and anger.

Friday, September 19, 2014

HTML WYSIWYG (Drag and drop) editor

When I am writing PHP, I have settled on Sublime Text 2. (Why 2 and not 3? I have NO idea. It's just what someone suggested and I haven't bothered to upgrade.) I was using TextPad, but I like the syntax highlighting and some of the editing features (Multi-select, for example) that Sublime Text has. Seriously, if you do any coding, you'll fall in LOVE with this editor!

When I'm coding new pages, I find myself starting with some plain text boilerplate, and putting in my styles and what-not to make it look the way I want. But, sometimes I want a mouse driven interface. This is especially true when I am editing some really old site that I haven't taken the time to re-factor, and it's layout is tables nested inside nested tables... A good WYSIWYG editor can help dig through the clutter. That being said, I didn't have such an editor on my developing machine, so I went looking for one today. I did very quick tests on a couple. I started with an ancient version of FPXpress. I had messed with it years ago, and I have experience with it's big brother, MS Frontpage. I couldn't get it to open my PHP files, and when I just created a blank file to mess with, it just didn't feel right. There's probably an issue with that dinosaur on a newer system. (Win7)

Next, I tried PageBreeze.  If I remember correctly, it choked on my PHP file as well. When I started a blank document I tried my litmus test for any mouse driven HTML editor: Create a table. A GUI HTML editor should provide a dragable grid where you can choose the number of rows and columns. This one gave a dialog box to type (or select with increment / decrement buttons) the number of each. UNINSTALL

Then, I tried amaya, from w3c. Still not happy (similar to what I experienced with PageBreeze) UNINSTALL

THEN another search revealed that MS has made Expression Web 4 available for free. I know, I know; I expect it to make UGLY code, but FINALLY the GUI does what I expect it to. If the code is too bad, I can tweak it after the fact. The job that sent me on this chase was pulling a nested table out of one document to use in another similar one. It was a good way to ensure the formatting of the two documents would match. Could I have done it in a text editor? Sure! Would it have been faster than finding a new editor? Almost certainly. But, in the long run, I think it was worth it.

I do miss "CRTL + /" from Frontpage, (Show tags) but there's a decent alternative where the current cursor focus generates a breadcrumb style tag list at the top of the page, in nesting order. That makes it easy to select children and parents of a given element.

Where is this legacy code?
On a page all about outdoor advertising:
Giant Balloon Rental
Advertising Balloons

Wednesday, September 17, 2014

Google Ads

It's interesting that with the little bit I've been posting lately that my pageviews have gone up pretty well. I'm not getting any clicks on my google ads yet, but that's not the biggest goal for this blog anyway.

I'm not saying I expect to be the go-to source for any of the topics I write about, but it's still enjoyable to see a little spike on my Blogger stats.

My key takeaway from this so far: Post frequently!

Friday, September 12, 2014

Hooray! and Praise God!

TecBrat.com would like to announce the re-release of 5 websites:

Giant Balloon Rental
Skytracker Florida
It's sister site Sky Tracker
Florida LED Signs and
Commercial Landscaping by Orlando Outdoors

More information will come soon as I re-develop or re-factor various aspects of these sites.

A huge thank you to the A1 Balloon Rental family and related companies for giving me the opportunity to serve your web hosting, maintenance and developing needs.