mod_liveusers bugfix
Montag, 15 Januar 2007

mod_liveusers Note: This hack has been replaced by Live Users Pro. Please refrain to this text only for technical information.

This is for all people who may be looking for the fixed version of Live Users that I mentioned in the review section on Joomla! Extensions.


I allready mailed Sarunas Rocevas (Warnenas) my modifications and as soon as he responds to it I will take down this notice as I really do not want to take away any credit from him and maybe he has a better idea than me as it looks like he is a way better programmer than I am.

Please read first then download

(Note: I am currently working on a improved version of the module which will be released VERY soon) 

The changes I made is are follows:

"fixed" the problem with tooltips not appearing. This happened when "special/foreign" characters (like öÄß...) were contained in a field. As I figured this was caused by "rawurlencode" since in the conversion process it created an "invalid" string (error: "malformed URl sequence"). So I replaced it with str_replace(' " ', " \' ", $tooltip) as I think Warnenas used rawurlencode to deal with the problem that he has a javascript inside phpcode that has html code as parameters (so you would need to nest three kinds of " inside each other, but there are only two ' and "), so now all " in the tooltip string are replaced with \' as this is the way you can put ' inside '. I also needed to make put a str_replace(" ' ",' " ',$value) in the function querying the custom cb fields so that ' s won't exit the tooltip string. 

 Hope your head is all garbled now Zunge_rausstreckend

Explaination for humans: If you look at the html code of your site you will see that instead of something like this f%22%20style%3D%22border%3A0p there is now fairly readable text and some \' s.

Notice: This is not a very elegant way all " in the custom fields will become '. Hope this is acceptable.

Beware: There has not been any bug testing worth speaking of. So please keep you eyes open. Only during writing this I noticed that ' s in the custom cb fields will cause problems and put the second str_replace in the code so there may be more conditions that I didn't think of!

So please consider this a hack and not a real bugfix. I am a php newbie, so please bear with me. 

Modification:

I also added a field "female value" in the module configuration that allows you to change the value of the gender field to something different than "female". Any other value in the gender field will default to male anyway so there is no need for a "male value" field. This includes the minor changes in the module code needed.

 If you encounter any errors new to this version you may send me an email. 

Finally: Here is the download link so you can test yourself if this hack helps you. YOU HAVE BEEN WARNED Zwinkernd

Download 

(By downloading this you agree not to hold me responsible for any damage this software may cause. This is a very slightly modified of Warnenas mod_liveusers to deal with foreign characters in cb custom fields. No other changes as the ones described above were made)

Thanks to Sarunas Rocevas for this nice module. 


 
Impressum & Datenschutzerklärung
NDWDesign Oldenburg - Internetdienstleistungen, Webdesign und Joomla Entwicklung