Blogsome Moderator

Just today, I was promoted to the position of a Moderator within the Blogsome community. (Yay!) Now, I just need to make sure I use my power for good, not for evil…

Gravatars in JavaScript for Blogsome

To create an image tag for a Gravatar in JavaScript, for use on Blogsome. Download the md5.jpg file (it’s really a .js file, but we are tricking Blogsome into allowing it to be uploaded), and upload it to your site. Put the following code into your Main Page template (probably in the head section): <script type="text/javascript" src="/images/md5.jpg" /> Put The following code where you want the Gravatar to appear: <script type="text/javascript">document.write('<img src="http://www.gravatar.com/avatar.php?gravatar_id='); document.write(hex_md5("{comment_author_email}")); document.write('&size=20" />'); </script> You can change the size of your Gravatar image with the size=20 part, set it to whatever value you want. Enjoy! **Edit: **Don’t use this code, as it displays the email address to the browser, and then asks it to generate the MD5 fingerprint. This means that a Spam-collector would actually have access to the raw email address. I’ve diasabled the code until I figure out how to get around this…

Blogsome Gravatar Code

I like the idea of Gravatars, and they are easy to implement in PHP, but I cannot execute straight PHP code, only Smarty Templates (under Blogsome). I’d like to be able to write a Gravatar plugin in Smarty Code, but I don’t know how to MD5 encrypt just in Smarty. I thought the following would work, but it doesn’t seem to: {php}echo md5("email@address.net");{/php} In fact, I can’t seem to get any code to execute using the {php} {/php} tags. {php}echo "Hello, World";{/php}

WordPress Template Help

I get quite a few people emailing or leaving comments asking for help with Templates and so on for WordPress, or issues with Blogsome that I’ve dealt with, but don’t appear in the forums.

Matt, Can you give a newbie some advice about installing the Connections theme? In the top nav menu there are five buttons: Home, About, Archives, Links, and Contacts. I can’t figure out how to make these links work. The Home button works ok, but not the others. My feeling is that I need to edit the links in header.php, but what do I put? Do I need to create pages first? If so, how do I do this? Also, can you tell me how to add a calendar like you have on your site? Thanks for all your help, Caitlin

It won’t matter if you have Pages created or not - and you can do this with Posts, or any URI. If you do have a Page or Pages created, you can then use the URI the Dashboard gives you in one of the later steps. To create a Page, use the ‘Write - Write Page’ menu in the Dashboard. Pages can not currently be created from ecto, or other off-line editing tools. Note that Pages use a different template file from posts, so if you are using Blogsome, you will have to hand code any markup in your Pages, they don’t just add the Page content into the {content} section. You will need to edit your Template to change the links at the top of the Connections Theme. If you are using Blogsome, or any WordPress Multi-User system, the changes will need to be made in the Main Page (index.html) template. Otherwise, under standard WordPress, the changes will indeed need to be in the header.php file. Either way, open the relevant file, and find the section that begins with <ul id="topnav"> There will be a series of list items (probably on seperate lines, although the Stylesheet will place them all on the same line). Each list item contains a URI, and the Link Text. Connections also has a seperator, of the Unix Pipe character: |. Each item you want in your navbar must appear, in the order you want them in your list of list items. Mine looks like the following: <li><a href="{ bloginfo show='url'}" id="navHome" title="Posted Recently" accesskey="h">Home </a>|</li> <li><a href="/about-me/" id="navAbout" title="About the Author" accesskey="a">About </a>|</li> <li>{wp_loginout} |</li> <li> {wp_register} |</li> <li><a class="rss" href="{bloginfo show='rss2_url'}"> RSS</a> |</li> <li><a href="mailto:{bloginfo show='admin_email'}" id="navContact" title="Contact the Author" accesskey="c">Contact </a></li> Notice that mine has a whole heap of curly brackets - that’s because I use Blogsome, and they have Smarty Tags instead of raw PHP code. It’s taken me a while to get used to them, but they are kind of cool. If you are using standard WordPress, you’ll need to replace them with the proper PHP code - go to the WordPress Codex for examples of how they work. Basically, the curly braces need to be replaced by <?php and ?>; and the arguments are not named, are in parenthesis, and commands are followed by a semi-colon. For example, the first entry, Home should be: <li><a href="><?php bloginfo('url'); ?>" id="navHome" title="Posted Recently" accesskey="h">Home </a>|</li> Finally, the calendar is really easy to implement. PHP Code: <?php get_calendar(); ?> Smarty Code: {get_calendar} You can also alter your Stylesheet to modify the display styles of the calendar - look at the Source Code for your page to see what the classes are called. I also received the following question via email from Peter Valentino:

I just dunno who or where to turn to.. The blogsome forum doesnt help at all. I usually have long blog entry and want to cut it to the first small paragraphs view in the index page, and use that excerpt/more feature to read the rest. The trouble is i dunno how to do it. I have filled the excerpt box for every post and checked the view the excerpt option on the dashboard cpanel, but it still doesnt work. I’m thinking that prolly I delete the html tag for the feature in index.php, and if it’s true, I dunno where to find the original tag. This is also my problem: where can I go to easily get the original coding for each default templates provided by blogsome? Thanks for your help, Peter

This one’s easy - when posting using the Dashboard, locate the cursor where you want the break to be, and press the little more button from the Quicktags. Or, type in `

`. If you are using ecto, typing into the first box will create text before the more seperator, the second box will be after. The trick here is that it’s not an excerpt or summary, but more of a teaser. I recall that it’s also possible to change the text that is displayed, but I’ll leave that as an exercise for the reader (hint: this may not work in Blogsome, IIRC). I’m more than happy to help with other issues, but be aware that I’ll post responses to my site, in preference to email, as this might help someone else out in the future.

'After the fact' Comment line

I’ve noticed a whole heap of blogs that use the “X hours after the fact” tagline as part of the comment. I’ve tried to implement this under Blogsome, but I’m struggling. I know I need to use the following: { comment_date } and { the_date } The problems I have encountered - Smarty doesn’t seem to like subtracting values that are dates, and I can’t seem to get them as numbers… Anyone done this?

Blogsome Error

When I went to my blog today to see if there were any new comments, I was unable to see anything. I received an error:

It doesn’t look like you’ve installed WP yet. Try running install.php.

Clicking on the link had no effect. What you need to do is:

  1. Login to your blog. Even if you cannot see the front page, you can go to /wp-admin/
  2. Edit any post from your blog. You do not need to make any changes.
  3. Save the post, and the database will have fixed itself.

It seems so be an annoying bug in the WordPress Multi-User code. It has happened before, and it doesn’t seem to happen to everyone as anyone in the process of posting when the bug appears will automatically fix it without realising. I don’t know what time it occurred at, whether it was when a visitor placed a comment, or what. But it seems to be all fixed now.

Edit This links

Playing around with WP tags, I discovered it’s easy to put Edit This links/buttons onto posts and comments, that will only appear when a user who is able to edit them is logged in. So, there’s now a reason to register as a user: it means you can edit any comments you make. Of course, it’s easier to just comment, and enter your details. Since I don’t get much comment spam, I won’t be turning on ‘Only Registered Users Can Comment’ any time soon, but a nice feature for me to have. The code in my templates is:

  1. To change the links at the top of the page to Login/Logout, and Register/Site Admin, depending on context, use the following Smarty Tags:
* `{wp_loginout} `
* `{wp_register} `
  1. To put the Edit This in the post header:
* `{edit_post_link before='<span class="button">' after='</span>'} `
  1. To put the Edit This in the comment box:
* `{edit_comment_link before='<span class="button" >' after='</span>'} `

Blogsome Missing Features

I’ve been playing around with my template files under Blogsome, and have come across some limitations - I’m not sure if they are limitations of WordPress Mu, or Blogsome’s installation.

  1. No Page Template. Without page templates it’s impossible to make Pages display a particular way, without writing the bare HTML code yourself. It’s also not possible to implement Smarty Tags in pages without a template file.

(I’m sure I had some others to add to this list.)

Still No Joy (XML-RPC)

I’m still not able to post with ecto on Blogsome: some of the functionality is there, but I get an error on posting. I might try MarsEdit or something else and see if that works, as w.bloggar does, apparently. I’ve also stopped using Dvorak keyboard layouts, as it takes too long to learn to type, and I hate not being able to keep up with my thoughts.

Blogsome XMLRPC issues

I cannot post via ecto, or any other offline client at the moment: Blogsome has disabled XMLRPC support, due to a security issue. Since they use Multi-User WordPress, there is not fix for this build as yet.