March 2005 Archives

Color Tools

| 2 TrackBacks

Many generous people have created and shared web-based and desktop color utilities. I have used a number of these tools for web design and graphic imaging and found a couple I just can't live without.

The color tool I depend on most is ColorCache from Technology Lighthouse. ColorCache is a color picker, color schemer, scheme previewer, palette manager and more. Currently in version 3.x, it is free to download and use for 15 days, after which paid registration (worthwhile, IMHO) is required.

My second tool of choice is a brilliant Firefox extension, ColorZilla color picker, DOM inspector and all-around groovin' color gizmo. I love this (along with WebDev for FF) for working on MT templates and styles.

Here are some useful web-based favorites to check out:
4096 Color Wheel Version 2.1
Color Palette Creator
Color Blender
Colours on the Web - Color Theory and Color Matching
ColorMixers
Colorblind Filter and Color Lab - excellent tools for accessibility to colorblind users

MTLink

Use the MTLink tag in your Main Index (or wherever) to automatically generate an URL for a template module or blog entry...

to link to a template module:

<h2>About</h2> <div class="about"> <ul> <a href="<$MTLink template="About"$>">about me</a> </ul> </div>

OR to an individual entry:

<h2>About</h2> <div class="about"> <ul> <a href="<$MTLink entry_id="235"$>">about me</a> </ul> </div>

image::magick problem solved

My hosting service recompiled image::magick for me today - I have been unable to create mt thumbnails for several months and finally got around to putting in a help ticket. I'm SO happy to have it back! the boys at dixiesys and 8-95 rock!

problem: automagical thumbnail feature in MT suddenly quit working, yielding a "page not found" error as well as the following entry in error log whenever mt.cgi or mt-check.cgi looked for imagemagick:

[Tue Feb 8 18:15:35 2005] [error] [client 12.34.56.789] Premature end of script headers: /home/username/domains/domain.com/public_html/mt/mt-check.cgi /usr/bin/perl: relocation error: /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Image/Magick/Magick.so: undefined symbol: SetWarningHandler

I found several threads on MT's support forums where users had similar problems. Just about all reported success when their hosts did a forced reinstall of image::magick (whole package with perlmagick, not perlmagick separately). QUOTE FROM ONE THREAD: "Note to Red Hat admins who need ImageMagick-perl for users: Don't bother with the RPMs -- that way lies grief - they install themselves incorrectly. Install the whole ImageMagick tarball from source and PerlMagick gets installed correctly at the same time."

Passed all of the above on to my tech support guys and they fixed me up... huzzah!

3-column archive templates

1)  copy main index template from

<div id=container>
to
<div class=content>
2)  in individual archive template paste (what you just copied above), replacing from
<div id=container>
to
<div class=content>
3)  cut
<br style="clear: both;" />
from beneath/end of "FORGET INFO" code and paste
<br style="clear: both;" />
under/at end of (FINISH THIS THOUGHT! brain fart... sorry!)

That is all fine and dandy as long as you have comments open. If comments are closed you need to clear the floats or your 3 columns will be differing lengths. Not a pretty sight! So...
4)  paste this code:

<MTElse> <br style="clear: both;" /> </MTElse>

just above these closing tags near bottom of page (using tags for 3.1x or earlier):

</MTEntryIfCommentsOpen> </MTEntryIfAllowComments>

or if you're using 3.2 tags clear goes BETWEEN these tags like this:

</MTIfCommentsActive> <MTElse> <br style="clear: both;" /> </MTElse> </MTIfCommentsAccepted>

This is what worked for me. Hope it works for you.

php includes in cgi templates

I wanted to use a php include in my Comment Listing Template, which is actually run inside comments.cgi. An ordinary php include wouldn't do the trick. Another plugin to the rescue... MTIncludePlus. This provided the perfect solution in the form of new container tag, MTIncludeURL. (FYI, this plugin also adds tags MTIncludeFile and MTIncludeModule.) Here's an example of what I used to call a rotating tagline into my banner in dynamic templates that run as cgi:

<MTIncludeURL timeout="15">http://domain.com/tagline/rotator.php</MTIncludeURL>

(obligatory reminder: code is all one line)

This also works in the default search templates.

php includes in dynamic archive templates

I was having a heck of a time calling includes into dynamic archive pages (php files, no extensions). The syntax I used in my Main Index template was NOT working in my dynamic archives. What I found out was that I was using a php shortcut syntax which is not enabled on all servers (and perhaps in my case not in all cases? not sure about that yet - I'll look into an .htaccess solution although I have no reason to believe there is one - just a gut instinct to try)

These worked in the main index, but not in archives:

<? include "http://domain.com/tagline/rotator.php"; ?>

or
<? include "tagline/rotator.php"; ?>

This syntax works in both index AND archives:

<?php include ("http://domain.com/tagline/rotator.php"); ?>

or
<?php include ("links.inc"); ?>

Cool.

Update: having a big "duh!" moment. Forgot about MTInclude as well as plugin MTIncludePlus. The latter provided a solution (new tag MTIncludeURL) for calling includes into my comments.cgi page. (comment listing template,etc) Here's an example of what I used to call a rotating tagline into my banner in dynamic templates that run as cgi:

<MTIncludeURL timeout="15">http://domain.com/tagline/rotator.php</MTIncludeURL>

(obligatory reminder: code is all one line)

NOTE: MTInclude and MTIncludePlus tags slow down the rebuild process. (I only use these tags when a regular php include won't do.) To speed up these tags, consider the MTFastInclude plugin at MTExtensions.

input styles

* this style requires small hack to mt's search_templates search field in form: input id="search" */

.content form input#search { background-color: #fcebd8; }
.link-note form input#search { background-color: #fcebd8; }
.link-note form input#input { background-color: #fcebd8; }

displaying code in entries

There are several ways to suitably display code in MT entries. If you do not encode your code (replace html entities) it will become the very code you're attempting to display. (out of espresso beans this morning, brain is fuzzy, sorry for the convoluted verbiage)

Rather than doing the "textarea" thing (google for more info on that), I prefer to simply run the code through a web utility that replaces the html entities so my code will display properly. I then surround my newly encoded code with blockquote tags and I'm done.

There are numerous free encoding tools on the web. My favorite (because I could install it on my own site) is SimpleCode by Dan at SimpleBits. You might also check out

display categories in category archive

I want to display a list of categories in a sidebar on my Category Archive Template page. If I enter the code from the Main Index, my category archive sidebar comes up empty (literally, it displays nothing under the categories heading). To fix that, I am calling that same code into my category archive template as a php include.

Create a new index template called categories.php and place in it the sidebar code (from main index template) for your CATEGORIES:

<MTSubCategories> <MTSubCatIsFirst><ul></MTSubCatIsFirst> <MTIfNonZero tag="MTCategoryCount"> <li><a href="<$MTCategoryArchiveLink$>" title="<$MTCategoryDescription$>"><MTCategoryLabel></a> <MTElse> <li><MTCategoryLabel> </MTElse> </MTIfNonZero> <MTSubCatsRecurse max_depth="3"> </li> <MTSubCatIsLast></ul></MTSubCatIsLast> </MTSubCategories>

In your Category Archive template, place the following code:


<div id="categories">
<h2>MTInclude Categories</h2>
<$MTInclude file="categories.php"$>
</div>

This should display your category heirarchy just as in the main index. You could also use this method to display recent entries here. I do believe the entire sidebar code would work in your category archive using this method.

(extended entry below is my former not-so-brilliant method... don't bother reading it)

customize comment notification email

| 2 Comments

I tweaked the content of the new comment notification email to add a couple convenient links - one to the main index page of the blog to which the comment was posted and one directly to the approve url for the comment. FYI, I found the "blog_url => $blog->site_url" in MT/*/CMS.pm and edited its syntax for Submission.pm

add to MT/plugins/Blacklist/lib/Blacklist/App/Submission.pm around line 745 or so:
             blog_url => $blog->site_url,

add to MT/plugins/Blacklist/tmpl/new-comment.tmpl (insert as line 1):
Visit <TMPL_VAR NAME=BLOG_NAME> at <TMPL_VAR NAME=BLOG_URL>

Not using MT-Blacklist plugin?  make same changes to MT/MT/App/Comments.pm and MT/tmpl/email/new-comment.tmpl

similar process for approve_url - will post later

About this Archive

This page is an archive of entries from March 2005 listed from newest to oldest.

February 2005 is the previous archive.

April 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 5.01

Fatal error: Smarty error: [in evaluated template line 4]: syntax error: unrecognized tag 'mtfeed' (Smarty_Compiler.class.php, line 580) in /nfs/c04/h04/mnt/66783/domains/geekmum.com/html/mt/php/extlib/smarty/libs/Smarty.class.php on line 1095