Categories
Uncategorized

Showing positions in Joomla

Ever wondered how to tell where the positions are in a Joomla template?

It's simpler than you might think.

Just add ?tp=1 to the end of your URL, as in

http://www.mysite.ca/?tp=1

[ad]

Categories
Uncategorized

Windows cannot use this hardware device because it has been prepared for "safe removal"

This error can arise when you try to safely remove a memory chip from an internal reader by right clicking the drive and selecting "Safely Remove".

Resolve the error by rebooting the machine, the reader should be reset at startup.

Now follow these steps:

  • Go into Computer Management,
  • Expand Storage, select Disk Management,
  • In the lower center pane, right-click and select Properties to view the property sheet for the card reader's drive letter,
  • Click the Policies tab and ensure that Optimize for quick removal is selected.

This disables write caching for the card slot, ensuring that no cached information can be lost when you remove the card.

Categories
Uncategorized

Unlocking PDF files

Some .pdf files come with restrictions on printing etc.

Without comment, this site releases those restrictions.

FreeMyPDF.com

Categories
Uncategorized

Capturing the username in WordPress for use in another webapp

Sharing authentication between a WordPress log and a co-resident webapp is handy, but can be a bit of a challenge.

Today I needed to find a way for my webapp to pick up my WordPress username in order to use that as a filter criterion in an SQL query.

A little searching and experimenting led me to the following snippet of code which I put in my WordPress header.php file, just below the  tag.

1
2
3
4
<?php
$user = wp_get_current_user();
setcookie("username", $use-->user_login);
?>

This drops a cookie called 'username' which I can retrieve in my PHP webapp

1
echo "Username cookie is  ".$_COOKIE["username"];

There is no doubt a more efficient way of doing this, like ensuring that it only happens once in the session or attaching it to the login code, which I will explore when time permits.  For the moment this works and I can get on with my webapp!

Later:

A look at the wp-login.php suggests that the place to put this in the login script is in the wp_signon() function of user.php. This approach would be much preferable to putting it in the header – there's no sense in dropping the cookie every time a page is loaded. I'll report back when I've had a chance to test this out.

Categories
Uncategorized

Converting WordPress back to MD5 Authentication

WordPress introduced a new password hashing method in version 2.5.  For those who wished to piggyback authentication of another webapp onto WordPress, this can cause a problem.  This plugin will restore MD5 password hashing for wordpress.

This plugin reverts storage of user passwords back to using MD5 hashing instead of the newer phpass hashing introduced in 2.5.

It is useful for people who need to maintain MD5 as the hashing type due to sharing of the WordPress user tables with other applications which require it.

If some of your passwords are already converted to phpass, do not fear. The next time those users log in to WordPress their passwords will be converted back to MD5.