Blogsome


I’ve been getting errors when trying to upload images via ecto, an XMLRPC client.

Method “metaWeblog.newMediaObject” produced a server error: “server error. requested method metaWeblog.newMediaObject does not exist.”.

I’m not sure if this is due to a new version of ecto, or something that’s broken within ecto. I’m downloading some other editors to try it out, but over dialup…

Careless Whisper (w/ R. Wainwright)Ben FoldsWolf Trap 6-29-04 ★★★★

View Comment (1)   RSS Feed for Comments on this Post

Eugenia (who used to write for BeOS sites, back in the day) wanted to know how to stop comments from being posted on posts that are over 10 days. I’ll generalize this to X days, just for completeness.
(more…)

View Comments (4)   RSS Feed for Comments on this Post

I’ve implemented a new feature on my blog, which I think is pretty cool.

Over the the right is a new box labelled: Beta: Inline Search. Try typing something into it, and pressing return, or clicking the button.

Wait a few seconds (depending on connection speed) and search results for this blog should appear underneath.

It’s still fairly rudimentary - I plan to make a “working” indicator, plus the ability to search for more results. But I guess you want to see the code…
(more…)

View Comments (20)   RSS Feed for Comments on this Post

I’ve noticed a certain pattern in Spam Comments to this blog recently - and it’s all since I disabled my rudimentary javascript Spam filter. Basically, the comment has a line or two echoed from the post, or another comment in the page, and then one or two simple additions to this phrase, such as “Good!”

At first glance, they are all sane comments, except that they don’t really add anything. And, they all point at pages that have a list of links, none of which have any relevance to the post from which they were linked to, and I assume would generate Advertising revenue for some scumbag.

The other thing which is a trigger they are Spam comments is that the email addresses are all @yahoo.com, and the IP addresses are all from a small subnet. And the comments are appearing in bursts, and, I’ll be honest here, I’m not getting too many comments any more.

Looks like it’s time to re-implement the javascript filter in addition to Blogsome’s (rather useless, apparently) CAPTCHA.

View Comment (1)   RSS Feed for Comments on this Post

I had a thought on the way home: how to make a blog that only registered users can see. Basically, it will use a similar method how the template decides whether or not to show the captcha. From the Blogsome site, and my comments.html:

  {if $captcha_image_URL != "" && $blog_user_level == -1}
    {$captcha_hidden_form_fields}
    <p>
        <input type="text" name="captcha_value_typed"><img src="{$captcha_image_URL}" align="center"><br>
        Anti-spam measure: please retype the above text into the box provided.
    </p>
  {/if}

So, we should be able to use the following code:

{if $blog_user_level == -1}
    This blog is members only.  Please {wp_loginout}.
{else}
    All content goes here.
{/if}

Of course, you’ll want do disable just anyone from registering, else it defeats the purpose of it…

I’ll try to test this on my test blog over the next couple of days.

View Comments (5)   RSS Feed for Comments on this Post

I’m trying to get Search terms from within the Blog’s search engine to be highlighted. I’ve got the following code:

{if $smarty.request.s == ""}
    {$content}
{else}
    {assign var=hilite value="<span class='hilite'>"|cat:$smarty.request.s|cat:"</span>"}
    {$content|replace:$smarty.request.s:$hilite}
{/if}

This works fine, as long as the search term isn’t in a URL, or something like that. In that case, it breaks the URL.

To get around this, I need to only replace if it’s not inside an HTML tag. regex_replace to the rescue. This took me about 30 minutes to eventually figure out, a tipoff to wfinn at yakasha dot net, and the comment he made on the PHP documentation pages:

{if $smarty.request.s == ""}
    {$content}
{else}
    {assign var=hilite value="<span class='hilite'>"|cat:$smarty.request.s|cat:"</span>"}
    {assign var=regex value="/(?![^< ]*?>)"|cat:$smarty.request.s|cat:"/"}
    {$content|regex_replace:$regex:$hilite}
{/if}

Obviously, you’ll need to have some sort of CSS styling for the search term.

.hilite {color:red; border:1px dashed; padding:0 3px; 0 3px;}
View Comments (10)   RSS Feed for Comments on this Post

This is actually a bug I’ve come across in other contexts, but the tag {wp_title} has a bit of a bug. When a category is selected, it returns a reasonable value (the title of the category). Ditto for an individual post.

However, with a date archive, the value is not as expected. A daily archive is fine, although I don’t like the format:

Captain Obvious » 2005 » October » 16.10.05

It doesn’t seem to be possible to alter this, other than the separator:

{wp_title sep="•"}

But it gets worse. If a monthly or yearly archive is chosen, the date of the last post to be displayed will also be presented:

Captain Obvious » 2005 » 13.08.05

Note that this is the last post on the page, not the first post. IIRC, normal Wordpress would be the other way around.

Instead, what I use is:

<title>
    {bloginfo show="name"}
    {single_post_title prefix=" &raquo; "}
    {single_cat_title prefix=" &raquo; Category: "}
    {if $smarty.request.name == ""}
        {single_month_title prefix=" &raquo; "}
    {/if}
    {if $smarty.request.s != ""}
         &raquo; Search: {$smarty.request.s}
    {/if}
</title>

This has the bonus of also noting when it’s a Search.

View Comments (0)   RSS Feed for Comments on this Post

It’s possible to create a private post within Blogsome, but not a whole private blog.

However, if you turn off allowing registration, you can make your blog private.

In your Main Page template, find the line that has {$content} on it.

Just before the line, insert the following lines:

{capture name=loginout}{wp_loginout}{/capture}
{if $smarty.capture.loginout|strip_tags:'0' == "Logout"}

And then, after it, insert the following lines:

{else}
    <p>This Blog is Private. Please {wp_loginout} before continuing</p>
{/if}

This will then prevent non logged-in users from viewing your posts.

View Comments (7)   RSS Feed for Comments on this Post

There are still a couple of issues with the XMLRPC interface.

  • ecto seems to work nearly fine. It publishes posts without escaping, and allows for the setting of categories. This is with MetaWeblog API as the account type.
  • Performancing publishes wrong unless using MetaWeblog API, but even when doing this, categories are not set.
  • Flock appears to be the same as Performancing, when set to Wordpress, or MetaWeblog API.
  • Qumana is the same - it autodetects it’s a Wordpress blog.
  • MarsEdit - works, but presents an error message.

Thanks to kreaper, who’s been a big help in the testing. Anyone with any other results can leave a comment.

View Comments (2)   RSS Feed for Comments on this Post

I often spend a heap of time tweaking stuff on my blog, and these show up as hits in the Referrers list, as well as on Performancing Metrics, a system of tracking readership.

Now, it’s rather simple to stop your visits counting towards your stats.

First, visit your site, and ensure you are logged in. In your address bar at the top of your browser, type in javascript:document.cookie, and press return. Find the cookie entry that starts with wordpressuser_, and copy the garbage-looking string after it - this is the md5 hash of your server name - to the clipboard.

Find the location of your stat-gathering code. Before it starts, enter:

{if $smarty.cookie.wordpressuser_md5string != "username"}

and after it ends, enter:

{/if}

Make sure to replace md5string with your md5 hash!

This could also be used to have any text show/not show when you visit your own blog. Like Google AdSense ads, for instance.

View Comments (7)   RSS Feed for Comments on this Post

« Previous PageNext Page »