• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Making the web work for you

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty
Affordable VAST/VPAID for Wordpress has arrived. Serve ads with your videos starting today!

Getting JustBlogIt to work with WordPress 2.1: Bookmarklet.php Fix

4 September 2007 / Alec Kinnear / Leave a Comment

It's no secret that we are big ecto users at Foliovision. But we've found Ecto for Windows more trouble than its worth. We are not the only ones to think so.

Rather than continue to fight Ecto for Windows which is a bit overkill for what we need to do on our Windows computers we went looking for an alternative, preferably something more portable. The Firefox extension JustBlogIt seemed like just the trick.

Basic, but easy to use and open to multiple accounts - very important to cover our multiple weblogs.

JustBlogIt worked a treat with my legacy Typepad account (if you're asking I don't enjoy Typepad at all - tech support is terrible even on a premium account), but wouldn't work with our WordPress weblog, always returning a PHP fatal error.

I asked Jérémie to investigate and this is what he came up with:

It seems that wordpress development team forgot about this file since the version 2.1 of it because it works on JB which is running under the version 2.0.6 and not on JulieK (2.1.2) FV (2.2) and WTR (2.2.1).

When we are trying to run the file it displays a PHP Fatal Error because one function neede to run the editor is missing. The error is:

Fatal error: Call to undefined function the_quicktags() in /hsphere/local/home/fvmaster/foliovision.com/wp-admin/edit-form.php on line 35

After looking on internet and wordpress website and finding almost nothing newer than WP 1.6 (already in WP 1.6 users got that error) I just decide to fix it myself. I looked on the core for that function, copy and past to bookmarklet.php, the function is present on the file /wp-admin/admin-functions.php. It is:

<?
/*Hacked By Foliovision -  this function is present on the file /wp-admin/admin-functions.php
Somehow edit-form.php should call it but it is never integrated on its file. I just copy it here:
*/
function the_quicktags() {
	// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
	if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari'))
		echo '
		<div id="quicktags">
			<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
			<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
		</div>
';
	else echo '
<script type="text/javascript">
function edInsertContent(myField, myValue) {
	//IE support
	if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = myValue;
		myField.focus();
	}
	//MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == "0") {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		myField.value = myField.value.substring(0, startPos)
		              + myValue 
                      + myField.value.substring(endPos, myField.value.length);
		myField.focus();
		myField.selectionStart = startPos + myValue.length;
		myField.selectionEnd = startPos + myValue.length;
	} else {
		myField.value += myValue;
		myField.focus();
	}
}
</script>
';
}
?>

I've also attached the full fixed file bookmarklet.php to this post. Just download and replace your existing bookmarklet file in ftp://yourdomain.com/wp-admin/bookmarklet.php

And enjoy one click citation in WordPress with JustBlogIt.

Alec Kinnear

Alec Kinnear

Alec has been helping businesses succeed online since 2000. Alec is an SEM expert with a background in advertising, as a former Head of Television for Grey Moscow and Senior Television Producer for Bates, Saatchi and Saatchi Russia.

Share
Tweet
Share
0 Shares

Categories: WordPress Tags: bookmarklets, ecto, justblogit, typepad, weblogs, WordPress

Related Posts

  1. Why WordPress won’t validate

    Why WordPress won’t validate

  2. How to restore missing WordPress Featured Image Screen Option

  3. WordPress Programmer’s Homework

    WordPress Programmer’s Homework

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You can click here to Subscribe without commenting

Primary Sidebar

Categories

  • Business
  • Cameras
  • Case Studies
  • Design
  • Flowplayer
  • Internet Marketing
  • IT
  • Life
  • SEO
  • Slovak
  • Video of the Week
  • WordPress

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2021 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. +1 518 412 4600