News:

Wondering if this will always be free?  See why free is better.

Main Menu

K-Detection: Detect OS & Browser Version

Started by Nikola_, October 07, 2006, 08:15:24 PM

Previous topic - Next topic

Shinigami

Quote from: crash3903 on January 02, 2007, 09:20:01 AM
This does not appear in my packages list to install - Any ideas why?

Thanks

Mark
If you have SMF 1.1.1 it will not work to install, because:
Quote from: SMF Mod Site
Compatible With:     1.0.6, 1.0.7, 1.0.8, 1.1 RC1, 1.1 RC2, 1.1 RC3

Jacen

Can't you force compatibility mode for the install, as I'm sure there weren't many API changes between RC3 and 1.1.1.
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

xfollowthereaperx

Please make it compatible with 1.1.1

I've seen people do it but I'm not sure how

Jacen

You can open the package and edit it's index file... but if there were API changes between the two SMF versions, it won't work properly
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

Nikola_

new version of mod compatible with smf 1.1.2 is available for download
+ browser & os detection have higher accuracy now and pictures are added

Greek


Jacen

I'd say so... but why are you still using 1.1.1?
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

Greek

Because I can't upgrade. I get errors.
I tried to install manually the new version of K-Detection (I have the old one), but I get errors.

TrueSatan

Quote from: Greek on March 12, 2007, 07:21:48 AM
Because I can't upgrade. I get errors.
I tried to install manually the new version of K-Detection (I have the old one), but I get errors.

Continuing as you are will just make matters worse...the errors should be fixed not ignored.

Here's how I'd do it:

Create a new test forum bases on SMF 1.1.2 (or latest version for those who may read this at a later date).

Add to it, one by one, all the latest versions of the mods you want to use. If there isn't a version of a mod for the latest SMF version posted to the SMF mod page then check the postings on this forum to see if a member has been kind enough to make one available. If there still isn't one available consider altering the package yourself to make it compatible with the latest SMF version or asking others to do it if you can't do so for yourself or abandoning that mod for the time being.

Once that is done:

Back up all your files and database from your live forum...backup the files from the test forum minus <forum root>/settings.php and <forum root>/settings_bak.php

Copy the back up of the test forum files onto the live forum files overwriting as you go.

At the end of this you will have a fresh set of files of the latest SMF version running your live forum...by preserving the settings files you will have kept your install details intact.

I know it's a chore but it's far better to fix errors than to ignore them.

Jacen

You still have to run upgrade.php and if there are errors in the database, taht will fail


Have you tried using the package manager to upgrade?
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

Greek

1. It's right what you say about test forum, copy etc. But I have made many custom changes manually and i cannot remember all of them  ;)

2. There is no upgrade file in latest version of this mod. I tried to install it manually, but without results.

However I have installed this mod in test forum 1.1.2. and works fine. But the problem is my normal forum 1.1.1  :( 

TrueSatan

 As regards your custom manual changes it just goes to show what a good set of documentation and, perhaps, a change log can do for you...sadly it's a bit late now though in your case.

You will have to upgrade your forum sometime, as I expect you realise...so why not bite the bullet and do it now?

If I were you I'd compare your live forum files to a clean installation of SMF 1.1.1 using a differencing engine...software that looks for the differences in two, similar, files and highlights them. It's a useful programming method in any event.

Use whatever differencing engine takes your fancy but if you don't have one and want a free item look at http://winmerge.org/ it's Open Source and certainly well able to help in your current situation.

The differencing engine will show you what changes you made and I would think you will be easily able to identify most of them and allocate them to particular mods. Your custom codes will then stand out and can be managed and transferred (if appropriate) to your fresh install of SMF 1.1.2


Roysen

Great mod but badly written.
I got this i my error log:
Quote8: Use of undefined constant br_ico - assumed 'br_ico'
Fil: /customers/xxxxxxx.com/xxxxxxx.com/httpd.www/forum/Sources/Post.php
Linje: 1561
This is the part of the code:
Quote//K-Detection
   require_once($sourcedir .'/K_Detection_v2.php');
   $k_detected = K_Detection($_SERVER['HTTP_USER_AGENT']);
   $posterOptions = array(
      'k_os' => $k_detected[os],
      'k_br' => $k_detected
,
      'k_os_ico' => $k_detected[os_ico],
      'k_br_ico' => $k_detected[br_ico],
      'id' => $ID_MEMBER,
      'name' => $_POST['guestname'],
      'email' => $_POST['email'],
      'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],
   );
Its also bad that the only part of of my website that not W3 validate is the output fro K-detection.
Quote# Error  Line 215 column 312: required attribute "alt" not specified.

..._Detection/icon_suse.png" align="top"> Linux (Suse)<br/><b>Browser:</b> <br/>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>

Roysen

To get rid of the annoying error in the log i changed the code to this:
Quote
   //K-Detection
   require_once($sourcedir .'/K_Detection_v2.php');
   $k_detected = K_Detection($_SERVER['HTTP_USER_AGENT']);
   $posterOptions = array(
      'k_os' => $k_detected['os'],
      'k_br' => $k_detected['br'],
      'k_os_ico' => $k_detected['os_ico'],
      'k_br_ico' => $k_detected['br_ico'],
      'id' => $ID_MEMBER,
      'name' => $_POST['guestname'],
      'email' => $_POST['email'],
      'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],
   );

Gourgi

First of all thanks for the mod Nikola_.
Had some errors in SMF 1.1.2 but fixed it with the code provided above by Roysen (many thanks ;) )

I don't bother by the copyright but i also think that it is in a very wrong place.
Any chance of moving this to another side of the forum (e.g. bottom) ???
Όσο ζώ, μαθαίνω ...

!Hachi!

is it necessary?come on please....we know about your work but i really hate to add link for each mod.we know its depends on author totally but i request to remove it.
regards.
Happy Ramadan

maximax77

Hi !
i love this mod but i have some errors in SMF log...
Errors in post.php were fixed by Roysen tricks but i still have erros in Subs-post.php.

When i move messages to another sections, i get this for each vars :


8: Undefined index: k_br
Fichier: /home/ovh/www/forum/Sources/Subs-Post.php
Ligne: 1536


So i'm wondering how to avoid K-Detection proc when moving messages...

Best regards from France...

PS : Sorry for my bad english.

nafishasan60

the mode installed successfully for me. But there is no changes in my page.

MrPrise

Great mod. I tried it today. It would be nice to show nothing beside the old posts instead of the OS:Unknown and Browser: Unknown

MrPrise

Fix for the unknown "bug":

Find this after install the mod in the Display.template.php:

//K-Detection
if (!$message['k_os']){$message['k_os'] = 'unknown'; $message['k_os_ico'] = 'unknown';}
if (!$message['k_br']){$message['k_br'] = 'unknown'; $message['k_br_ico'] = 'unknown';}

echo '<b>OS:</b> <br/> <img src="' . $settings['images_url'] . '/K_Detection/icon_', $message['k_os_ico'], '.png" align="top"> ', $message['k_os'], '<br/>';
echo '<b>Browser:</b> <br/> <img src="' . $settings['images_url'] . '/K_Detection/icon_', $message['k_br_ico'], '.png" align="top"> ', $message['k_br'], '<br/>';


and change the above with that:

if ( ($message['k_os']) &&  ($message['k_br']) )
{
echo '<b>OS:</b> <br/> <img src="' . $settings['images_url'] . '/K_Detection/icon_', $message['k_os_ico'], '.png" align="top"> ', $message['k_os'], '<br/>';
echo '<b>Browser:</b> <br/> <img src="' . $settings['images_url'] . '/K_Detection/icon_', $message['k_br_ico'], '.png" align="top"> ', $message['k_br'], '<br/>';
}

Advertisement: