| CARVIEW |
June 02, 2007
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.
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)
Posted by: Pixy Misa at July 04, 2007 01:44 PM (PiXy!)
April 23, 2007
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 rightplaced 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 purplered, 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.
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:
Any suggestions?
Posted by: Michael Rittenhouse at September 27, 2007 11:07 AM (/2Jf1)
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)
Posted by: Pixy Misa at September 28, 2007 11:24 AM (PiXy!)
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)
April 18, 2007
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.
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)
Would my Include.Butan template be likeThat's right. One note - this is not in place in the current system, but will be included in this weekend's update."<input type="button" value="{1}">"
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!)
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
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
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.
April 12, 2007
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 Fields
title, subject, text, keywords, more, memo, meta, misc, abstract, excerpt, notes, custom, tags, reply, warn, mod
{.raw|.esc|.text|.clean}
Info Fields
data, xml
{.raw|.esc|.text|.clean}
Date Fields
date, 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 Fields
status, 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 Fields
show.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 Fields
id, tid, pid, fid, etid, cfid
Category Fields
category.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.
Posted by: Kean at April 12, 2007 03:24 PM (td1Rl)
Posted by: Pixy Misa at April 12, 2007 03:28 PM (PiXy!)
Posted by: Ken Talton at September 16, 2007 12:51 AM (V5zw/)
Posted by: Ken Talton at September 16, 2007 12:55 AM (V5zw/)
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)
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!)
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!)
April 10, 2007
Nothing could be easier, because mee.nu has a special [youtube] tag!
Let's say the video you want is at https://www.youtube.com/watch?v=eWEjvCRPrCo
Just put this in your post:
[youtube=https://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.
Posted by: henryjo at April 14, 2007 02:19 PM (/vh1x)
Posted by: Pixy Misa at April 14, 2007 02:54 PM (PiXy!)
Posted by: henryjo at April 14, 2007 03:39 PM (/vh1x)
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)
Posted by: Pixy Misa at May 06, 2007 04:31 PM (PiXy!)
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!)
Posted by: Metzger at July 17, 2007 05:17 PM (2eGp3)
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="/css/mee.nu.css" type="text/css" />And change it to something like:
<link rel="stylesheet" href="/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.
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)
Posted by: Pixy Misa at April 20, 2007 09:12 PM (PiXy!)
Posted by: Will at April 20, 2007 09:34 PM (SOx9v)
Posted by: Will at April 20, 2007 09:37 PM (SOx9v)
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!)
April 08, 2007
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.
cool!
Posted by: Ruth at April 09, 2007 02:51 PM (DTwYZ)
Posted by: erp at April 10, 2007 08:25 PM (9oHan)
Posted by: Pixy Misa at April 10, 2007 08:32 PM (PiXy!)
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)
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)
Posted by: Pixy Misa at April 11, 2007 03:20 PM (PiXy!)
Posted by: Old Grouch at April 11, 2007 03:43 PM (3y3+0)
Posted by: erp at April 12, 2007 12:33 PM (9oHan)
Once again, I expose my web illiteracy.
I have an image I'd like to use in my banner, replacing the text that's there.
I've tried placing the link (it's uploaded to my images at https://rittenhouse.mee.nu/images?file=1430">https://rittenhouse.mee.nu/images?file=1430'>https://rittenhouse.mee.nu/images?file=1430">https://rittenhouse.mee.nu/images?file=1430) directly into the banner code. It won't show up.
I prostrate myself before the gods of HTML in search of knowledge....
Posted by: Michael Rittenhouse at June 23, 2007 02:08 AM (gJ+Se)
Posted by: Michael Rittenhouse at June 23, 2007 02:09 AM (gJ+Se)
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="/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!)
Posted by: Michael Rittenhouse at June 23, 2007 11:44 AM (Ksf5U)










