SEO for SMF (Simple Machines Forum)

16/07/2009 | 12:45 | Code

This is the most important SEO mod for your SMF installation. This mod named Pretty URLs totally elivates the level of SEO u have, plus this is automatic, so no need to worry about anything, just install and forget about it.

So let’s see what this actually does, basically it rewrites the original non pretty URLs of SMF to pretty ones and SEO friendly too.

snakehit.be/index.php?topic=100 (original url)

now the new one would look like this

snakehit.be/board-name/topic-name/ (new url)
snakehit.be/profile/snakehit (new profile url)
snakehit.be/unreadreplies

Cool, isnt it? So, lets install it.

Pretty URLs will work with SMF 1.1 and 2.0. It requires an Apache webserver with support for mod_rewrite and .htaccess files.

To install:

  • First check your server supports .htaccess per-directory config files and mod_rewrite
  • UTF-8 is recommended, though not required. Certain functions will work unreliably with other encodings
  • Download and install the base package from the mod site.
  • Enable the filters in the new Pretty URLs page

Here is the mod link

Have fun!

EXT Js code completion Zend Studio for Eclipse

17/11/2008 | 18:32 | Code

Usage of EXT Js code completion in Zend Studio for Eclipse

  1. Download EXT Js http://extjs.com/products/extjs/download.php?dl=extjs22
  2. Extract to C:\Program Files\Zend\Zend Studio for Eclipse – 6.1.0\plugins
  3. Start Zend Studio for Eclipse
  4. Help → Software Updates → Find and Install… → Search for new features to install → New remote site
  5. Name: “EXT Js”, Url: “http://www.spket.com/update/”
  6. Restart Zend Studio for Eclipse
  7. Window → Preferences → Spket → JavaScript Profiles → New
  8. Enter “ExtJs” and click OK
  9. Select “ExtJs” and click “Add Library”, then choose “ExtJS” from the dropdown
  10. Select “ExtJs” and click “Add File”, then choose the “ext.jsb” file in your “C:\Program Files\Zend\Zend Studio for Eclipse – 6.1.0\plugins\ext-2.2\source” directory
  11. Check all possible options
  12. Set the new ExtJs profile as the default by selecting it an clicking the “Default” button on the right-hand side of the “JavaScript Profiles” dialog.
  13. Window → Preferences → General → File Associations → *.js to Spket Javascript Editor (set to default)
  14. Restart Zend Studio for Eclipse
  15. Create a new JS file and type: Ext. and you should get the Ext Code completion options.

(Original tutorial: http://extjs.com/blog/2008/02/01/ides-plugins-and-tools-for-ext-js-20/)

Have fun :-)

Zend_Form with XML Tutorial

9/03/2008 | 13:50 | Code, Zend

Since Zend_Form is released a lot of people have been searching for a good tutorial how to combine Zend_Form with XML. Rob Allen wrote a very good tutorial to use Zend_Form with some code. During my interneship i’ve been busy with Zend_Form and XML and now I like to share it with you. So here is a very easy, complete example that shows it in action. Let’s make a small login form from XML with Zend_Form.

zend_form_01

Read More »

There’s a hole in Friendfeed!

4/03/2008 | 20:49 | All, Code, Dump

You know Friendfeed, yes? If you don’t:

FriendFeed is service for people to keep up-to-date on the web pages, photos, videos and music that their friends and family are sharing. It offers a unique way to discover and discuss information among friends.
The goal of FriendFeed is to make content on the Web more relevant and useful for you by using your existing social network as a tool for discovering interesting information. You get a customized feed made up of the content that your friends shared – from news articles to family photos to interesting links and videos. And your friends get their customized feeds, full of the cool stuff that you’ve shared.

But there is a problem with the mashup from Twitter! People love Twitter because they can stay in touch with their friends and communicate privately what they’re up to? Well. If you use it like this and are happily twittering away about people you work with, or fancy, or both, or whatever, you probably need to know that everything you think is protected (private) within Twitter actually isn’t.

At Friendfeed you can add your Twitter account to make your twitts public for everyone else. If you did this you need to know that someone who’s twittering privately at twitter.com/[username] is actually visible to everyone at friendfeed.com/[username]. Another markup is when you try to delete your connection between Friendfeed and Twitter is that Friendfeed keeps the Twitter messages… They doesn’t delete them :-( .

And if you thought that wasn’t bad enough, those friendfeed userpages with archived messages on them are now showing up in search engine results.

That’s bad! Please Friendfeed sort it out…

A possible fix: Get the protection status with the Twitter API and if it is set to private then they are only visible for the people that are subscribed to me.

Shutdown skype before installing Apache

3/03/2008 | 12:58 | Code

I have been running my local webserver for some time now and today I decided to change that old 2.0 version into 2.2.8. I went ahead and downloaded the latest version of Apache thinking that it must be a really straight forward thing to do… Isn’t it pretty obvious ;-) . But when I installed it, it wont work. It kept throwing this error on the last step of the installation.

Only one usage of each socket address (protocol / network address/port) is normally pemitted. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets availbale, shutting down
Unable to openlogs
Note the errors or messages above, and press the <ESC> key to exit.

I tried to install it several times and even tried to install Apache on port 8080 but everytime the same error came up. After spending about 30 minutes to figure this out, it turns out that Skype was to blame. Skype listens to port 80 alternatively for incoming requests. Why should they do that? I have no idea… You can find out what programs are listening to what port by running the following command in command prompt.

netstat -anb

So I had to shut down Skype and then Apache installation worked like a charm.

Bottomline :

  • Turn off Skype when you install Apache.
  • There is a setting in Skype Tools -> Options -> Advanced -> Connection
    “Use port 80 and 443 as alternatives for incoming connections” – This is checked by default. You must uncheck this to prevent it from blocking Apache.
  • If Apache is installed as a Windows service, I assume it would start using the port 80 before Skype gets initiated. So not an issue once its installed.

[MediaWiki] Extension: SMF_Authentication v1.2

11/01/2008 | 17:36 | Code

New release of SMF_Authentication v1.2.

What is SMF_Authentication exactly:

This extension is a connection between SMF (Simple Machines Forum) and MediaWiki. This causes users who are logged in to SMF to be (created if necessary and) logged in to the MediaWiki. When the session expires or they logout with SMF, they will no longer be logged in to the MediaWiki.

We urge all users of this extension to upgrade to SMF_Authentication v1.2 as soon as possible to take advantage of these fixes. A summary of the fixes:

  • Fixed the bug with the trailing slashes in the topics
  • Fixed the error message in ‘edit token’
  • LocalSettings.php has some new vars
  • Disabled ssi.php (only using smf_api.php)
  • Fixed a little bug in Auth_SMF.php (logout)
  • Version upgrade
  • Fixed the readme file

The new package can be download from here.

What shall I do if I have any problems?
If you have any reason problems to complete the installation or you have any kind of troubles, please be so kind to contact me, I’ll try to resolve your problem immediately.

Further information about this extension can be found on this link
http://www.mediawiki.org/wiki/Extension:SMF_Authentication

[MediaWiki] Extension: SMF_Authentication v1.1

4/12/2007 | 11:30 | All, Code

I’m proud to announce the release of SMF_Authentication 1.1.

What is SMF_Authentication exactly:

This extension is a connection between SMF (Simple Machines Forum) and MediaWiki. This causes users who are logged in to SMF to be (created if necessary and) logged in to the MediaWiki. When the session expires or they logout with SMF, they will no longer be logged in to the MediaWiki.

This release mainly addresses some documentation issues and fixes a few small bugs.

We urge all users of this to upgrade to SMF_Authentication 1.1 as soon as possible to take advantage of these fixes. A summary of the fixes is as follows:

  • User.php has been added because of some little bugs
  • Little fix in GlobalFunctions.php
  • Bug fixed in Auth_SMF.php (logout)
  • Change of the directory hierarchy
  • Upgrade of the readme file
  • LocalSettings.php is better documented

To upgrade just overwrite the files and change the LocalSettings.php file.

Further information about this extension can be found on this link
http://www.mediawiki.org/wiki/Extension:SMF_Authentication

[C#] Convert a DateTime Field to a SQL Field

21/11/2007 | 21:06 | Code

If we want to insert a date in a SQL string in C#, the solution seems obvious:

DateTime date = DateTime.Now;
string sql = "INSERT INTO tabel VALUES('" + date.ToString() + "')";

Unfortunately this code doesn’t work! The function DateTime.ToString() returns a string like 21/11/2007 19.55.49, while MySQL wants a string like 2007-11-21 19:55:49.
The following static function converts a DateTime object in a valid date field for MySQL:


private static string MakeSQLDate(DateTime date) {
string sql = date.Year.ToString() + "-" + date.Month.ToString() + "-" + date.Day.ToString() + " " + date.Hour.ToString() + ":" + date.Minute.ToString() + ":" + date.Second.ToString();
return sql;
}

For using:

string sql = "INSERT INTO tabel VALUES('" + MakeSQLDate(date) + "')";

Add a Windows XP client to a Windows domain

8/11/2007 | 14:07 | All, Code

Wow, so much frustrations, just don’t know how windows works… This here is just for me, cause I keep forgetting!

On client machine:

  • right click on My Computer
  • Properties
  • Machine name
  • Change domain button
  • Add to workgroup
  • Restart…
  • right click on My Computer
  • Properties
  • Machine name
  • Change domain button
  • Add to domain
  • Join with login and pass
  • Restart…

Done…

Then sync time with domain controller…

  • Login with administrator account.
  • Open command prompt.
  • Type following:

    w32tm /config /syncfromflags:domainhere /update
    net stop w32time
    net start w32time

Done…

[.NET] Create valid XHTML

23/10/2007 | 00:38 | All, Code

A common problem with .NET is that the Web Forms and Web Controls generate invalid XHTML. As a webstandard-minded developer I’m getting pretty irritated about this… Let’s search for a fix!

Issues:

  • Invalid attributes and inline elements without a correct block element container.
  • The form tag’s name attribute is deprecated in XHTML.
  • The ViewState value is encrypted in a hidden input tag, which is wrapped in a div in order to make it validate. This extra XHTML is plain nasty. It goes against what web standards promotes, i.e. clean, semantic mark-up.

All these errors are automatically created when the page is being rendered in the web browser, meaning that even if you write flawless code you will still fail to get it valid :( .

To the rescue, some google hits:

Do you have experience with those techniques to make it valid, or some other way to accomplish it? Please feel free to share!