Native sh404SEF (for Joomla!) extension for PU Arcade component SEF with scores!

Trust me, that title was a pain to figure out! First, I need to explain that so I get some search terms in here that make sense for future visitors:

I'm using the Joomla! CMS system on some other sites I run (this site uses Drupal, by the way,) and there's a search engine-friendly (SEF) URL component for it called "sh404SEF". I'm also using a sweet online arcade component for Joomla! called PUArcade by Pragmatic Utopia. Until roughly now, there weren't many ways (if there were any at all) to have SEF URL rewriting in Joomla turned on without rendering the high score saving in PUArcade inoperable. (...whew! See how hard it is to construct a title with all that info??)

Well, I've solved the problem, so here we go with a post about it. Read on to see how I've solved the problem. This worked for me using PUArcade 2.3x and sh404SEF on Joomla! 1.5x. I hope it works for you. ;)

Native extension for sh404SEF with working high scores!

Wheee! I was really stoked to figure this out, so I'm really happy to share this one. I had been trying to find a solution for over a year and finally just solved it myself, so this is pretty gratifying, too. Huge thanks again to Pragma for making the great PUArcade component for Joomla! and releasing it for free. :) Some day, I'm going to either make my own, or get blessings from Pragma to migrate PUA for use in Drupal. I've looked into that and man, it's a large undertaking! For now, I'm using Joomla and PUA on a few sites that I need a solid, working online Flash game arcade.

The Problem:
I've outlined this roughly in the opening bit, but to summarize, the PUArcade Joomla component won't save scores for games unless SEF functions in Joomla are disabled.

This Worked:
I've coded a working native plugin/extension for the sh404SEF Joomla! component. From what I've seen, this SEF system is very robust and allows for some really sweet possibilities for creating extensions. The newest version of this system is quite a bit different from the prior ones (from what I understand) so other extensions I've tried don't seem to work very well for me. I started digging in and have come up with a solid working version of an extension.

Here's the "how" on a Joomla! 1.5x system:

Install sh404SEF and follow all their directions to get things set up. Once it's installed, you'll find a directory tree like this on your server:

joomla-root-path/components/com_sh404sef
 ./cache
 ./meta_ext
 ./sef_ext

Go into the "sef_ext" directory and you'll see a bunch of other "native" extension plugins for various other Joomla! components. It is in here that we'll copy my new "com_puarcade.php" SEF extension file for sh404SEF. (Be sure to rename the file to "com_puarcade.php" since I believe it will be downloaded with a ".txt" extension to it.) Please note that it's possible to put this file elsewhere (like in the root of the PUA component directory?) and change some settings in sh404SEF itself, but I've just decided to put it into the native ext directory. It is also my intention to submit this plugin to the sh404SEF folks for inclusion in their shipping set of native plugins -- we'll see how that goes! I need to spiff it up a bit first, likely. My current version is a bit rusty and could use more tweaks and additions, I think. I'm still learning about both sh404SEF and PUArcade so I've stopped where it all works and I'm calling that good for now. :)

After you've uploaded the attached file to this directory -- and if you've turned on sh404SEF via its Joomla admin control panel -- you should see some URLs for your arcade that look a lot like this (with your respective folder/game settings, of course):

http://www.flashgamepost.com/online-game-arcade/classic-games/snake.html

Currently, I had stopped my research of this extension with a hard-coded string that was used to replace the "com_puarcade" as component name for SEF. If you look in the attached file, you can change it to what you want. It's at line 69, with some instructions in the comments a bit above that. The code should pull the arcade's menu title from Joomla, but I believe that's either not working right now, or I just don't have a title for mine.. not sure off hand, sorry. Either way, you'll want to edit the string 'Online Game Arcade' if you'd like something else in there. If you name it 'PU Arcade', for instance, the same URL above would look like this:
.../pu-arcade/classic-games/snake.html (hyphen (-) is my default space-replacement character)

In addition to the arcade name string, there are several other $title variables that you can feel free to change to your liking (until I get around to adding in some settings for the sh404SEF admin page that let you edit these there, of course! ;) ) For now, this is annoying to change the file directly, but I'm working on that. Look through the file for comments that say things like "can change the desired SEF string here..." and such. I tried to document the file pretty well, but... I'm pressed for time at the moment, as my wife and I are taking care of our new baby daughter(!!)

That should about do it, unless I forgot some other key point! Hopefully this gets others up & running with a nice SEF option where the high scores are still working for their games in PU Arcade!

As a side note, if you're also having trouble with the "newscore.php not found" problems (and most of you likely are), I've posted a solution to that here, so try it out if you need that too:
"Solving 'newscore.php' 404 using .htaccess"
(Update May 10, 2010 -- Had to fix the link above again since the PU Arcade module has been taken over by a new group and has received its own domain. The old forum contents appear to be intact, but they moved again. The above link is correct again -- but I think I'll be duplicating that content here in a new article instead of just chasing around external stuff. I just wanted to link into their system but this is getting annoying.)
(Update Nov.25, 2009 -- fixed this link. Pragma changed his forum component and the old link was dead. Sorry 'bout that.)

Well, I hope that gets a bunch of people fired up with some good SEF Joomla/PUArcade arcades! It works great for me on Joomla! 1.5 with PUA 2.3-ish.

Cheers!
Hoza

(right-click the link below and select "save link as..." to save the file, or click it and use your browser save function so save the file. Remember to rename it to "com_puarcade.php" before use!)

AttachmentSize
com_puarcade.php_.txt7.31 KB

Comments

When things are out of

[spam]

I'm going to either make my

I'm going to either make my own, or get blessings from Pragma to migrate PUA for use in Drupal. I've looked into that and man, it's a large undertaking! For now, I'm using Joomla and PUA on a few sites that I need a solid

My design is gone

Hi.

I have made all this steps, is working but my template design is gone after I enable sh404sef.
I set up the $live_site variable in my joomla configuration.phpfile, but still have this issue.

Can you tell me please how can I repair this? I really need Puarcade to be SEF.

Take a look http://jocuri.ramatis.ro/index.php/Online-Game-Arcade/Snake.html

Thanks a lot man.

Regards,
TheSlym

Way, way late.. ugh.

So sorry I missed this post amongst the spam crap we've been getting. I once again thought the auto-notice of new comments was working, but that's also seemingly broken. Bad combination: spammers & misconfiguration.

I've sent an email directly for now, but I'll post here when there are some answers, so the rest of the folks can benefit.

Suffice to say for now, that you're getting an extra bit added into your URLs ("index.php/"), which when removed, allows your CSS files to be found properly:

http://jocuri.ramatis.ro/Online-Game-Arcade/Snake.html

Hopefully I'll hear back from you soon via email and we'll sort this out.

Very, very sorry about the long-ass wait for a reply.

Paul

Link fixed

Apparently, Pragmatic Utopia changed their forum software and the link I had to the "newscore.php" thread I started was dead. I went and found the new location and updated the link. Sorry about that!

HTH,
Paul

Argh!! File link unavailable.

Damn, I'm sorry folks. It appears that a few things are no longer functioning on this site after some big changes & upgrades -- including file attachments to articles and the almost-as-important feature of emailing me when new comments are posted!

Grrrrrr...

I'm on it. I'll post soon about my progress and just email this file directly to anyone posting here about it if I have to. So very sorry about this.

Big thanks to Ruthless for sending me a note that brought this to my attention. I apologize for missing the comments posted up until now.

Soon...

File should be there now

Very, very sorry for the hassle, but I've re-attached the file so you should now see the file linked at the bottom of the post. I hope there weren't too many folks who got stopped up by this oversight!

I'm just glad now that someone spoke up in an email since my comment system is obviously in need of attention. Grrrrr.

Hope this works for you guys (or gals?).

Link?

This has no link? Even for registered members.

Fixed. See other comment

Fixed. See other comment thread. Sorry!!

link?

what link below? I can't see anything...

Fixed. See other comment

Fixed. See other comment thread. Sorry!!

Link?

What Link, there is no link? Can you plaese upload the LINK.....