June 02, 2007
Imagery
It's been a while since the last update, but I have been busy. Here's the first of the new features uploaded today:
Automatic Server-Side Image Scaling and Thumbnails (ASSIST!)Shrink to 200 pixels wide - side-by-side with a browser-scaled image for comparison:
[
thumbnail=/images/Benten.jpg size=200x]

Shrink to 200 pixels tall:
[
thumbnail=/images/Benten.jpg size=x200]
Fit inside a box 100 pixels square, keeping proportions:
[
thumbnail=/images/Benten.jpg size=100x100]
Resize to 100 pixels square, regardless of proportions:
[
thumbnail=/images/Benten.jpg resize=100x100]
Accessing this directly from HTML:
<img src="/images/Benten.jpg?size=200x" border="0" />

This
is intended to make it easy to produce image galleries and photo albums
where you need to produce images in multiple resolutions. Also, it
will be used for user avatars: Since mee.nu users have complete control
over their site layouts, there won't be a single fixed size for
avatars, and resizing in the browser produces ugly images.
The
advantages (apart from the improved quality) is that it makes it very
easy to keep the image proportions, and it produces smaller files for
fast loading times. (And less strain on your bandwidth.) Doing
high-quality image processing is fairly CPU intensive, but we already
have 16 CPUs at our disposal, so that is not anticipated to be a
problem.
One hitch: This doesn't currently work for animated GIFs.
Neither does the image processing function in the file module; the GIF
library I'm using is lacking in several respects. This will be resolved in the next month or so.
Posted by: Pixy Misa at
01:56 PM
| Comments (2)
| Add Comment
Post contains 231 words, total size 3 kb.
1
I just found the coolest image function on this blog.
When you click on the image (the first one, of the guy creeping along), see how the image pops to full size and the background goes black.
Any way we can copy that?
Posted by: Michael Rittenhouse at July 04, 2007 02:26 AM (q4Tbt)
2
Yep, we're going to be adding something along those lines. It's called a "lightbox", and there's a whole range of Javascript functions available to do it. I haven't standardised on a Javascript library yet, but I'll have to do so soon.
Posted by: Pixy Misa at July 04, 2007 01:44 PM (PiXy!)
Hide Comments
| Add Comment
April 23, 2007
Quote Me On That
PullquotesThe pullquote
tag makes for easy and
attractive magazine-style pullquotes.
The
pullquote
tag makes for easy and
attractive magazine-style pullquotes. You can place the
pullquote to the left or right of the text, set your own colour
schemes, control the line breaks yourself or let the system handle it
for you, and select different text for the quote and the main body.
Code: [
pullquote left strip scheme=orange]The
pullquote
tag|makes for|easy and
attractive|magazine-style|pullquotes.[
/pullquote]
Usage: [
pullquote {left|right} {strip} {nobody} {scheme=scheme_name}]
- The quote can be
placed either left or right
placed either left or right (the default) of the body text. - Markup in the body text may cause problems in the pullquote. The strip option removes any markup from the pullquote, leaving it in the body.
This text appears only in the pullquote.
When
needed, the pullquote text can be different to the body text. To
specify that the contents are to appear in the pullquote only, specify
the nobody option.
- Schemes
can be user-defined in your CSS. The standard schemes include
red, orange, green, blue, and purple
red, orange, green, blue, and purple. The default scheme (if no scheme is specified) is black and grey. The CSS code for the blue scheme, for example, is simply:
.pullquote-blue-1,.pullquote-blue-5 { color: #55D; }
.pullquote-blue-2,.pullquote-blue-4 { color: #339; }
.pullquote-blue-3 { color: #004; }
- Pullquotes are automatically split into five sections, unless you specify the break points using pipes | as shown in this example.
Posted by: Pixy Misa at
02:50 PM
| Comments (4)
| Add Comment
Post contains 204 words, total size 2 kb.
1
I love this! Thank you for developing it.
I can't seem to get the pipes to break my quote into four lines in this entry. Here's the code I'm using:
"Oh, that's very impressive."
Any suggestions?
Posted by: Michael Rittenhouse at September 27, 2007 11:07 AM (/2Jf1)
2
Oops. The code executed in the comment. Preview is the friend I ignore.
With square brackets in place of the parentheses, the code looks like:
(pullquote right nobody)"Oh,|that's|very|impressive."(/pullquote)
I also tried adding "strip" but it didn't change the line breaks.
Posted by: Michael Rittenhouse at September 27, 2007 11:12 AM (/2Jf1)
3
Hmm.. Haven't looked at this in a little while; what you are doing seems right. I'll grab a copy of your blog to my test environment so I can see why it's not working.
Posted by: Pixy Misa at September 28, 2007 11:24 AM (PiXy!)
4
As I noted before, I love the pullquotes for the way they break up copy and help draw the reader into a longer article.
I am having trouble getting them to appear alongside a longer paragraph without the code (apparently) causing a break in the paragraph itself.
If I put the code at the very beginning of the paragraph (before the first sentence), the pullquote is nicely positioned but I get a couple of blank spaces in the first line of the paragraph, where the code is hidden.
If I put the code at the end of the previous paragraph to eliminate the blank spaces, the pullquote can only be positioned alongside the opening lines of the following paragraph. I can't move the pullquote down to a more attractive location, several lines into the paragraph. (See this example.)
If I splice the code down inside the paragraph a few lines, it breaks the paragraph like a stray line break.
Any suggestions?
Posted by: Michael Rittenhouse at January 27, 2008 10:18 PM (FPLdZ)
Hide Comments
| Add Comment
April 18, 2007
Include
Quickly Process another template and add the results to the current page.
Usage [
include {args}]
[
include:once {args}]
Type control tag
Data Fields n/a
more...
Posted by: Pixy Misa at
04:50 PM
| Comments (2)
| Add Comment
Post contains 148 words, total size 2 kb.
1
Let me get this straight... Say, I have
[include butan "hello!"]
in a template. Would my Include.Butan template be like
"<input type="button" value="{1}">"
which would output a button with the text "hello!" on it? Cool.
Can we do testing on args? Like [if {1}]value="{1}"[/if]?
Posted by: McGurk at April 19, 2007 03:40 PM (Ri74D)
2
Would my Include.Butan template be like
"<input type="button" value="{1}">"
That's right. One note - this is not in place in the current system, but will be included in this weekend's update.
Can we do testing on args? Like [if {1}]value="{1}"[/if]?
Actually, that won't necessarily work with the plain if, which always assumes that you've fed it a template tag. if.nz should do what you want, though.I'm working to extend this to allow using template tags as parameters in other template tags, using $ to denote a variable as opposed to an absolute value. So you'll be able to do [include $foo], and the template that gets included depends on what the value of foo is at that point. That should also make it into this weekend's update.
(This isn't just an academic exercise; I needed this functionality to extend some of the user-interface templates. Naturally, once it's in place I make it available to everyone.

)
Posted by: Pixy Misa at April 19, 2007 03:55 PM (PiXy!)
Hide Comments
| Add Comment
Formatting Options
You can add formatting to any data tag using the
format= option. The main formatting commands are described below.
Date and Time
Dates and times use a format string
as described below. You can use any combination of formatting options and text in the format string. If the format string contains spaces, you will need to enclose it in either single or double quotes.
Date Formatting Options
Code
| Meaning
| Examples
|
%a
| Abbreviated weekday name.
| Tue, Thu
|
%A
| Full weekday name.
| Tuesday, Thursday
|
%b
| Abbreviated month name
| Jan, Aug
|
%B
| Full month name.
| January, August
|
%c
| Date and time.
| Tue Apr 3 14:53:38 2007
|
%d
| Day of month.
| 3
|
%j
| Day of year.
| 093
|
%m | Month. | 1, 8 |
%U | Week of year (weeks starting Sunday). | 13
|
%W | Week of year (weeks starting Monday). | 13 |
%x | Date (mm/dd/yy). | 04/03/07 |
%y | Year. | 07 |
%Y | Year with century. | 2007 |
Time Formatting Options
Code
| Meaning
| Examples
|
%H
| Hour (24-hour clock).
| 11, 23
|
%I
| Hour (12-hour clock).
| 11, 11
|
%M
| Minute.
| 03, 29
|
%p
| AM or PM.
| AM, PM
|
%S
| Second.
| 15, 59
|
%X
| Time.
| 14:53:38
|
Some Examples
Code
| Result
|
%A, %B %d
| Monday, April 09 |
%I:%M %p
| 08:57 PM |
%A, %B %d %Y %I:%M %p
| Monday, April 09 2007 08:57 PM |
%Y-%m-%d
| 2007-04-09
|
Example: [
post.date format="%I:%M %p"]
Text
Multiple text formatting options can be applied by separating the commands with commas. The formatting commands are applied in the order they are listed. Example: [
post.text format="first=100,underscore,lower"].
Option
| Description
|
left=n
| Returns the first n characters of the text.
|
right=n
| Returns the last n characters of the text.
|
first=n
| Returns the first n words of the text.
|
last=n
| Returns the last n words of the text.
|
trim
| Removes any leading and trailing spaces.
|
trim=s
| Removes any leading or trailing instances of string s.
|
lower
| Converts text to lower case.
|
upper | Converts text to upper case. |
words | Returns the number of words in the text. |
letters | Returns the number of letters in the text. |
nospace | Removes any spaces from the text. |
underscore | Convert any spaces in the text to underscores. |
Numbers
Number formatting works by placing the formatted value into a string containing both formatting options and text.
Option
| Description
|
%d
| Signed integer decimal.
|
%i
| Signed integer decimal.
|
%o
| Unsigned octal.
|
%u
| Unsigned decimal.
|
%x
| Unsigned hexadecimal (lower case).
|
%X
| Unsigned hexadecimal (upper case).
|
%e
| Floating point exponential (lower case).
|
%E | Floating point exponential (lower case). |
%f | Floating point decimal format.
|
%F
| Floating point decimal format. |
%g | Variable floating point format. |
%G | Variable floating point format. |
%s | Default representation. |
%% | % symbol. |
As an example, you could have [
post.words format="There are %d words in this post."]
Each of the numeric formatting options can take a number of flags:
Flag
| Description
| Example
|
0
| Zero fill the result.
| %0d
|
-
| Left-adjust the result
| %-d
|
| (Space) Leave a space before a positive result.
| % d
|
+
| Always show a leading + or -.
| %+d
|
Posted by: Pixy Misa at
09:34 AM
| No Comments
| Add Comment
Post contains 430 words, total size 13 kb.
April 16, 2007
Some Quick Notes About Caching
The caching module is designed to keep the most frequently requested pages in memory so that they can be served more quickly. Every time you request a page, the server first checks if it already has a copy in the cache. If it doesn't, it creates the page from the templates, and then saves a copy in the cache - possibly pushing an older page out of the way to do so.
Pages live in the cache for a limited amount of time, currently 120 seconds. They are automatically flushed (removed from the cache) after certain events; leaving a comment on a page, for example, will flush that individual page. And pages are never cached if you are logged in, so you will never see an old copy of a page while you are maintaining your site.
The real benefit of the cache comes in when you get a link from a high-traffic site like Slashdot, Fark, or Instapundit. The main page of my blog currently takes around 400 milliseconds to generate (it has a
lot of comments...) Once in the cache, it takes just 3.5 milliseconds - over 100x faster. You can imagine the difference that would make to the server if I got 10,000 visitors in the space of an hour. Typically the performance gain would be somewhat less than that, in the range of 20x to 60x, but still definitely worthwhile.
If you log out and reload a page a couple of times, you'll see that the system actually tells you that it's coming from the cache, so you can keep an eye on this yourself.
Posted by: Pixy Misa at
08:06 AM
| No Comments
| Add Comment
Post contains 274 words, total size 2 kb.
April 13, 2007
Working With Custom CSS - Part 2
[Part 1]There's a second way to work with custom CSS - use the template engine.
There are two steps to this:
First, create a folder. Give it a type of "Style" and a name that you find appropriate - let's say "Default", since this will be your default CSS. Set the path to be something like "css/mystyle.css", or "css/mee.nu.css" if you don't want to change your Header template just yet.
Set the index template and page template both to Style.Default.
Make sure that it's not marked private! If you mark a folder as private, only you can access its contents - which is not a good thing for your CSS files (unless you want to try out a new design, in which case it's ideal).
Save your new folder.

Now create a template. Set the type as Style and the name as Default. Make sure you set the content to "text/css", or you may have problems.
Now, just put your CSS code into the template. Make sure it's marked as active. Save it, and you're done!

The advantage of this method is that you can use template tags, including conditional tags, in generating your CSS. The downside is that because the CSS is generated dynamically, it won't be cached by the browser, so your pages will appear just a little more slowly.
Posted by: Pixy Misa at
02:43 AM
| Comments (1)
| Add Comment
Post contains 228 words, total size 2 kb.
1
But, we can edit our CSS in the website without going through the whole upload thing. Now I just have to take all my styles out of the HTML and move it into the stylesheet...
Posted by: McGurk at April 13, 2007 02:05 PM (Ri74D)
Hide Comments
| Add Comment
April 12, 2007
Posts
[Note: This documentation is for the updated version of the system that is in testing right now. Some features documented here may not work correctly just yet. The new version is expected to be available by the end of Sunday, April 15th.]
Quickly View posts.
Usage [
posts {paged|unpaged} {page=n} {count=n} {skip=n} {show=all|publish|draft|pending|expire|user} {sticky|unsticky|nosticky|stickyonly} {sort=posted|updated|title|comments} {order=asc|desc}]
[
posts:here {template=type.name} {options}]
Type block tag, here tag
Data Fields Text Fieldstitle, subject, text, keywords, more, memo, meta, misc, abstract, excerpt, notes, custom, tags, reply, warn, mod
{.raw|.esc|.text|.clean}Info Fieldsdata, xml
{.raw|.esc|.text|.clean}Date Fieldsdate, time, datetime, shortdate, day, month, year
create
.date, update
.date, start
.date, end
.date, comment
.date, ping
.date[.date|.time|.datetime|.shortdate|.day|.month|.year]Status Fieldsstatus, type, category, comments, pings, edits, reads, locked, allow.comments, allow.pings, allow.attach, sticky, hidden, defer, expire, flag, ip, ip.hash, filter, number, even, odd, mod.
[3|4|5], bytes, kbytes, words, first, last
Display Fieldsshow.html, show.bbcode, show.smilies, show.macro, show.dict, show.sig
User Fields
author.name, author.nick, author.mail, author.web, author.aim, author.msn, author.yim, author.icq, author.location, author.occupation, author.interests, author.sig, author.hash
ID Fieldsid, tid, pid, fid, etid, cfid
Category Fieldscategory.name, category.desc, category.path, category.nospace
Sub-tags [1]
[
post:comments]
[
post:pings]
[
post:attachments]
[
post:links]
[
post:images]
[
post:stats]
[
post:categories]
[
post:folders]
[
post:sites]
[
post:next]
[
post:prev]
[
post:first]
[
post:last]
[
1] Sub-tags aren't working yet, but these are the ones that will become available for posts.
more...
Posted by: Pixy Misa at
02:47 PM
| Comments (7)
| Add Comment
Post contains 134 words, total size 4 kb.
1
Funny timezone on this blog!
Posted by: Kean at April 12, 2007 03:24 PM (td1Rl)
Posted by: Pixy Misa at April 12, 2007 03:28 PM (PiXy!)
3
Heeeeeelp! I need the original post template!
Also how do I add categories to the post?
Posted by: Ken Talton at September 16, 2007 12:51 AM (V5zw/)
4
Oh dear. It was right there.....OK I found it.
Boneheaded Beta Tester Is Boneheaded......
Posted by: Ken Talton at September 16, 2007 12:55 AM (V5zw/)
5
I got the categories added to my posts by adding this to my Post template:
Category: [post.category]
My problem is that I wanted to link that text to the category folder and I tried this:
But it didn't work.
Category: <a href="[category.path]">[post.category]</a>
Any ideas?
Posted by: Flibbertigibbet at December 03, 2007 04:50 AM (ru7wW)
6
Um. I just realised, I cheated when I did that for the standard templates. I need to fix it.
Basically, the post isn't picking up all the category data automatically; my cheat was to use the category name in the link - which works for me, but isn't correct in the general case.
I'll get this fixed for you.
Posted by: Pixy Misa at December 07, 2007 12:20 PM (PiXy!)
7
Scratch that. Reverse it! I actually did it properly, but it's sort of hidden.
Use [
post.category.path]. The system is wrapping the category data into the post data. It does the same for the author - there's a [
post.author] object inside the post data containing the user details of the author.
I need do document that better.
Posted by: Pixy Misa at December 08, 2007 01:48 AM (PiXy!)
Hide Comments
| Add Comment
April 10, 2007
Youtube Videos
Pixy, I hear you cry,
how do I post Youtube videos on my mee.nu blog?Nothing could be easier, because mee.nu has a special [
youtube] tag!
Let's say the video you want is at
http://www.youtube.com/watch?v=eWEjvCRPrCoJust put this in your post:
[
youtube=http://www.youtube.com/watch?v=eWEjvCRPrCo]
and the result will be this:
You can also use a shorter form where you just specify the video ID, in this case eWEjvCRPrCo. So
[
youtube=eWEjvCRPrCo]
again produces:
Posted by: Pixy Misa at
08:52 PM
| Comments (7)
| Add Comment
Post contains 69 words, total size 1 kb.
1
Why am I only getting the coding back out, and not a video? Am I stupid?
Posted by: henryjo at April 14, 2007 02:19 PM (/vh1x)
2
Hi henryjo. Don't mark the youtube tag in colour; I do that in the documentation
because it prevents the system from processing it - which is exactly
what you don't want.
Posted by: Pixy Misa at April 14, 2007 02:54 PM (PiXy!)
3
I am stupid or something cuz, now I get a big white space?
Posted by: henryjo at April 14, 2007 03:39 PM (/vh1x)
4
I followed the instructions to a T, but only the link showed up, any suggestions?....Bunny
Posted by: Bunny at May 05, 2007 05:55 PM (+OVgL)
5
It should work... Let me try:
[
youtube=http://www.youtube.com/watch?v=qY0pi3WPvq4]
Posted by: Pixy Misa at May 06, 2007 04:31 PM (PiXy!)
6
There. Hmm. You didn't turn off BBCode on that post, did you?
Don't colour the text the way I do in my examples, though - I do that so that the examples won't work so that you can read them. If you colour the text it won't work for you either - probably not what you want!
Posted by: Pixy Misa at May 06, 2007 04:33 PM (PiXy!)
7
Thanks. This place gets better on the time. Any more info on paid subscription plans for blog space yet?
Posted by: Metzger at July 17, 2007 05:17 PM (2eGp3)
Hide Comments
| Add Comment
Working With Custom CSS
By default, your site is set up with a standard CSS file, which you can find here:
http://mee.nu/css/mee.css.
You will find the CSS location specified in your Header template. In the future - probably later this week - I'll add a setting to the Manage Site page to make this easier to change, but for now you can just edit that template. Find the line that says:
<link rel="stylesheet" href="/http/mee.nu/css/mee.nu.css" type="text/css" />
And change it to something like:
<link rel="stylesheet" href="/http/mee.nu/files/my.css" type="text/css" />
Where
/files/my.css
is the location of your CSS file.
There are a couple of ways you can put your own CSS into action. The first way is to simply edit it offline, and then upload the file into your files directory.
The second way is more complicated, but more powerful; it lets you use template tags to process the CSS, so that you can (for example) deliver different CSS to different browsers. I'll cover that tomorrow.
Posted by: Pixy Misa at
12:31 PM
| Comments (5)
| Add Comment
Post contains 164 words, total size 1 kb.
1
Well I tried this method (tweaking with a copy of mee.nu.css and saving it down in my files folder as my.css) to fiddle around with the appearance of the page, but I decided I was coming to an ugly dead-end. When I tried reseting to the default css, something happened, because the h-line.gif and v-line.gif borders will not come back no matter what I try. I've tried routing my header back to mee.nu/css/mee.nu.css . I've put a copy of the original css in my files folder and sent the header there for the style sheet. Neither brought the borders back.
Any idea what's going on?
Posted by: Will at April 20, 2007 09:04 PM (SOx9v)
2
mee.nu.css doesn't have the borders; you want mee.css.
Give that a try.
Posted by: Pixy Misa at April 20, 2007 09:12 PM (PiXy!)
3
That did it. But mee.nu.css (the one you supplied in your link) references v-line and h-line in #banner and #menu. Is there some reason why those would not work?
Posted by: Will at April 20, 2007 09:34 PM (SOx9v)
4
Wait... I think I see what's wrong. Does it have to do with the way the url is incomplete when linking the image? Mee.css has those urls filled out completely? (another work around I attempted)
Posted by: Will at April 20, 2007 09:37 PM (SOx9v)
5
Sorry about that! I've fixed the link now.
The mee.nu.css file is tailored for this site - which doesn't have the borders. You can see that those sections are commented out.
Posted by: Pixy Misa at April 21, 2007 12:11 PM (PiXy!)
Hide Comments
| Add Comment
April 08, 2007
New Toys
A new set of features has been uploaded to mee.nu, ready for our full-scale beta test. You'll see new options for managing your posts, files, folders, templates and directories, automatic RSS and Atom feeds, site statistics, and a host of other bells and whistles.
And a
much improved file upload screen:
more...
Posted by: Pixy Misa at
09:58 AM
| Comments (14)
| Add Comment
Post contains 182 words, total size 7 kb.
Posted by: Ruth at April 09, 2007 02:51 PM (DTwYZ)
2
Can we browse for an image?
Posted by: erp at April 10, 2007 08:25 PM (9oHan)
3
If you mean look through a screen of thumbnails or something similar - not yet, but I do plan to add that.
Posted by: Pixy Misa at April 10, 2007 08:32 PM (PiXy!)
4
Three items that I have found while working on the new digs:
1. Whenever I upload a file, and then rename it with a name that already exists, instead of writing over it, there are now two files listed with the same name. Hard to distinguish which one is the new one, especially when dealing with uploading my new css.
2. A text editor for the CSS file would be nice as opposed to editing it offline and having to upload it. (put it on my wish list of things).
3. On the comments, if we can make it so that it has an option to remember commenter's info.
Minor things so far. Great job Pixy!!
Posted by: duncan at April 11, 2007 12:30 AM (V1YuZ)
5
Whenever I upload a file, and then rename it with a name that already
exists, instead of writing over it, there are now two files listed with
the same name. Hard to distinguish which one is the new one, especially
when dealing with uploading my new css.
Rats. I thought I'd fixed that. I'll take another look.
A text editor for the CSS file would be nice as opposed to editing it
offline and having to upload it. (put it on my wish list of things).
There's actually a way to do that, and I'll post about that today in the Docs section.
On the comments, if we can make it so that it has an option to remember commenter's info.
At the moment, it always remembers the commenter's info. This works slightly strangely if you're a registered user, because it looks at your Profile page rather than at what you last type in for a comment.
Posted by: Pixy Misa at April 11, 2007 03:43 AM (PiXy!)
Posted by: Old Grouch at April 11, 2007 03:08 PM (3y3+0)
7
It's a Canadian lynx kitten, according to my photo library.
Posted by: Pixy Misa at April 11, 2007 03:20 PM (PiXy!)
8
Look at the size of those feet!
Posted by: Old Grouch at April 11, 2007 03:43 PM (3y3+0)
9
Yes, that's what I mean by browsing. Thanks.
Posted by: erp at April 12, 2007 12:33 PM (9oHan)
Posted by: Michael Rittenhouse at June 23, 2007 02:08 AM (gJ+Se)
11
Whoo, I couldn't even place the code in my question without making a mess.
Posted by: Michael Rittenhouse at June 23, 2007 02:09 AM (gJ+Se)
12
I think there's a post about replacing the banner image somewhere, but I can't find it, so here goes:
You want the Banner template (you already seem to have found that).
You want an image that is roughly 408x98 (it's that size because I started with a 400x90 box and added a drop shadow).
Remove the whole section that starts with
<div id="titlebox">
and ends with
</a>
</div>
.
In its place, put
<a href="/">
<img src="/http/mee.nu/images/myimage.jpg" border="0">
</a>
(where myimage.jpg is replaced with the real name of your image.)
That should do the trick!
We'll be adding new templates over the next two weeks, and a new template builder module which will handle putting images into the banner for you. I've put a
preview on my blog.
Posted by: Pixy Misa at June 23, 2007 04:40 AM (PiXy!)
13
Woo hoo! Works. Thank you.
Next week I attend XML school so I may come back less naïve.
Posted by: Michael Rittenhouse at June 23, 2007 11:44 AM (Ksf5U)
Hide Comments
| Add Comment