Adding a “Thread Starter” banner in Xenforo

In a forum, it is often helpful to see who started a thread when you get to a midpoint in the discussion.  While it is not built into Xenforo, all it takes is one new phrase and a template edit to add it.  No need to wait for an add-on!

First, go to the Appearance page, and choose Phrases from the left menu.  Click the “Create New Phrase” button.  For title, you want to enter the name of your phrase.  Since my site is named “ABC” for example, I prefix my custom phrases with the site name.  I’d create a phrase titled “abc_thread_starter_banner”.  In the text box below, enter your choice of wording:  I used “Thread Starter”; one could use “Discussion Starter” to remain consistent with Xenforo wording, or anything else that makes sense.

Save that, and move on.

Go to your default theme, choose Templates, and search for the template named message_user_info.  Find the following

<!-- slot: message_user_info_text -->

…and enter these lines just before it:

 <xen:if is="{$post.user_id} == {$thread.user_id} AND !{$conversation}">
 <em class="userBanner bannerSecondary wrapped" itemprop="title">
 <span class="before"></span>
 <strong>{xen:phrase abc_thread_starter_banner}</strong>
 <span class="after"></span>
 </em>
 </xen:if>

Note where you enter the title of the phrase you created above; remember to change it from my posted example here.

Remember, you will want to edit your default template, so the change takes place in all child templates below it.

Now, you will have a thread starter banner beneath the avatar on the forum, stacked with the others.  The color is controlled by the class “userBanner bannerSecondary wrapped”, which draws upon the secondary colors in your color palette.  This saves you from having to create new colors for every single theme and variation you might have installed.

 

Posted in Development, Xenforo | Leave a comment

Enabling Memcached in XenForo with Unix sockets

OK, I have always had an issue with getting XenForo to play nice with Memcached, but that was the case when trying to use it on managed servers with no root access.

Prerequisites:  in addition to installing memcached, you must have both memcache and memcached PHP extensions installed.  In Ubuntu,

apt-get install php5-memcache
apt-get install php5-memcached

For whatever reason, Zend needs both installed for this to work.

You must also configure memcached on your server to run with a socket, vs. localhost with port 11211.  This is quite simple.

Create a directory (such as /var/memcached ) and chown it to your memcache user.

In memcached.conf, comment out these lines:

# -p 11211
# -l 127.0.0.1

…and add these lines:

-s /var/memcached/memcached.socket
-a 0766

Make certain you also have your memcache user specified in the file:

-u memcache

What you’ve just done is disable the tcp service but enabled the Unix socket.  Good work.

Now it’s time to change your configuration file in XenForo.

First, make sure you have the frontend cache configured:

$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['cacheSessions'] = true;
$config['cache']['frontendOptions'] = array(
 'caching' => true,
 'automatic_serialization' => true,
 'lifetime' => 3600,
 'cache_id_prefix' => 'xf_myforum_'
);

Using the examples above, you’ll want to add this below:

$config['cache']['backend'] = 'Memcached';
$config['cache']['backendOptions'] = array(
 'compression' => false,
 'servers' => array(
 array( 'host' => 'unix:///var/memcached/memcached.socket', 'port' => 0 )
 )
);

And for now, comment out your file backend config if you have been using it, and keep it in your file in case memcached ever acts up–you can quickly revert:

/* ///// Backup in case Memcache totally borks
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] = array(
 'cache_dir' => '/var/caches/xf/xfcache_myforum',
 'hashed_directory_level' => 2,
 'hashed_directory_umask' => 0707,
 'cache_file_umask' => 0707
);
*/

If all goes well, you’ll be using memcached for XF’s cache, and also be using the faster and more direct Unix socket instead of TCP.

 

Posted in Xenforo | Tagged , | Leave a comment

Epson WF-3640 error 0xDE

In frustration today, I attempted to print a PDF file from Acrobat X that kept causing the Epson WF-3640 printer to throw the 0xDE error message.

The message on the panel mentioned turning off the printer.  Upon restarting, it said to run a nozzle check, which I did, and it printed perfectly. I even cleaned the print heads afterward, and yet I still kept getting the same error.  Help was nonexistent online, other than the most generic nonsense you find when trying to troubleshoot anything, including the non-answers many tech support “professionals” tend to give out.

I then printed the same PDF file from my Nexus 7.  No problem–it printed straight away.  Interesting.

Back on the computer, I tried opening up the PDF with the Windows 8 “Reader” application, and it mentioned that the file might be corrupt.  Aha!  I then generated another PDF file, and printed it with no issues.  Perfect!

Lesson: if you have a printer error that seems illogical, try a few standard error checking practices, then attempt printing perhaps a very generic document from Word, or even from a text editor, on the slim chance that you might have a corrupted document.

And please, do not let technical support at the printer company run you through the typical “reboot your computer, reinstall your drivers, run the printer self-test” merry-go-round.  You can easily troubleshoot on your own. In the future, I am considering posting some simple and logical troubleshooting guides to save end users a lot of grief.

Posted in Uncategorized | Leave a comment

Why you should AVOID WordPress 4.3!

WordPress has been helpful in many ways, allowing us to build out sites quickly and efficiently.  Yet during their “upgrades,” they often build in new features that serve to frustrate long-time users, or introduce features which make absolutely no sense.

One of the lamest developments on the Internet is something called Markdown.  What it does is allow lazy users to use characters such as #, *, >, etc. to format text.

Why is it lazy? They claim it is so their hands to not have to leave the keyboard.

Well, let me clue all of you in to something: I have used keyboard shortcuts in web-based editors for years, and they mirror keyboard shortcuts in common word processing programs we have used for nearly two decades now.  My hands do not leave the keyboard, even to submit messages in some cases, as a simple keyboard shortcut or two gets me to the “submit” button, and I’m in business.

These users are too lazy to memorize/learn these shortcuts.  They’d rather use some lame character-based formatting that comes from the trainwreck that powers Wikipedia (MediaWiki).

Google Plus has had similar editing shortcuts, and they are ultra-annoying.  I cannot even put two hyphens in a paragraph without it assuming I mean to strike out the text.

WordPress, you really need to rethink this strategy. As of yet, nobody has showed us how to deactivate this shortsighted and very frustrating feature.  When they do, I will post it here.  Until then, I will regret upgrading to WordPress 4.3 on one of my servers (which I have already done), and leave the rest at 4.2.

Even better–if someone creates a plugin to dump this nasty feature, I’ll be in full support of it.

WordPress was supposed to be smart.  This is just another case of their serially dumbing-down the product to clueless social media addicts who can’t be bothered to learn what the rest of us have known for decades.

Posted in Uncategorized | Leave a comment

Sour grapes for Mozilla? Boo hoo.

So the CEO of Mozilla is throwing a tantrum in an open letter to Microsoft. Well, boo hoo. I’m crying for you right now.

Let’s see.  If you install OSX or buy a new product with OSX install, tell me again, what is the default browser?  Yep, Safari.  You install Windows 10, like any early version of Windows, and what do you get?  Exactly. Microsoft’s browser, which this time is Edge.

So, what exactly is there to complain about?  It takes me all of two minutes to download Chrome, install it, log in to sync everything, and answer the magic question as to whether or not I want Chrome to be the default.  And even without that, I can hop to the default browser choice in Windows 10’s settings and change it within seconds–Microsoft has made it dead easy to change.

Listen, Mr. Beard, don’t presume that everyone wants your inferior browser, bloated and memory-leaking as it is.  And don’t presume that people out here are so stupid as to not know how to change a default browser.  If they want your bloody Firefox, then they’ll download it, answer the “default” question, and be on their way within minutes.

Mozilla only sees Edge as a threat to their marketshare, nothing more. And that goes back to the ancient browser wars again, something most of us outgrew a decade ago.  Stop living in the past, and go overhaul that mess you call a browser.  Clean up your own yard, Beard, before bitching about someone else’s.

Posted in Uncategorized | Leave a comment