OS & Browser Detection (version 1.5 is out) [20. 09. 2010.]

Started by Branko., December 06, 2008, 05:23:42 AM

Previous topic - Next topic

Apllicmz

Yes
good work
for mi work 100%....portuguese_pt-utf8

<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
    $txt['OS_Browser_Compatible'] = 'compat&iacute;veis';
    $txt['OS_Browser_OS'] = 'OS';
    $txt['OS_Browser_Unknown'] = 'N&atilde;o Identificado';
    $txt['OS_Browser_Browser'] = 'Navegador';
]]></add>
        </operation>
    </file>



villasg

#41
Today i see in my error log that :
1) A new member activate acount.
(http://www.thai.gr/forum/index.php?action=activate;u=656;code=c2744da987)
The time in activate acount i take this errors

2) A moderator MOVE a topik
( http://www.thai.gr/forum/index.php?action=movetopic2;topic=441.0 )
Again take thiw errors

Undefined index: ua_browser_icon
Undefined index: ua_os_icon
Undefined index: ua_browser
Undefined index: ua_os


8: Undefined index: ua_browser_icon
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


AND

Undefined index: ua_os
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


And
Undefined index: ua_os_icon
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


Line 1538 is :
VALUES ('$posterOptions[ua_os]', '$posterOptions[ua_browser]', '$posterOptions[ua_os_icon]', '$posterOptions[ua_browser_icon]',


inside in
// Insert the post.
db_query("
INSERT INTO {$db_prefix}messages
(ua_os, ua_browser, ua_os_icon, ua_browser_icon,
ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES ('$posterOptions[ua_os]', '$posterOptions[ua_browser]', '$posterOptions[ua_os_icon]', '$posterOptions[ua_browser_icon]',
$topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",
SUBSTRING('$posterOptions[ip]', 1, 255), " . ($msgOptions['smileys_enabled'] ? '1' : '0') . ", '', SUBSTRING('$msgOptions[icon]', 1, 16))", __FILE__, __LINE__);
$msgOptions['id'] = db_insert_id();

Robi052

And I have same error. Undefined index: ua_browser_icon, ua_os_icon, ua_browser, ua_os

AlenNS

Quotehttp://www.baklja.com/forum/index.php?action=movetopic2;topic=9938.0
The database value you're trying to insert does not exist: ua_os
Function: createPost
File: /home/baklja/public_html/forum/Sources/Subs-Post.php
Line: 1842

GIMWD

i installed this mod in my SMF 1.1.7.but it is not working with my current theme.but it is working with my default theme without any problem.what is the problem.we have to make any changes for other themes.then help me...

edi67

Quote from: AlenNS on December 16, 2008, 10:53:58 AM
Quotehttp://www.baklja.com/forum/index.php?action=movetopic2;topic=9938.0
The database value you're trying to insert does not exist: ua_os
Function: createPost
File: /home/baklja/public_html/forum/Sources/Subs-Post.php
Line: 1842

Same error for me when moderator try to move one topic

The database value you're trying to insert does not exist: ua_os
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

DeviDarkL

#46
Same to me  :'( Need some help  >:(

DeviDarkL

I solved the problem :D

In MoveTopic.php find:
// Add a URL onto the message.
$_POST['reason'] = strtr($_POST['reason'], array(
$txt['movetopic_auto_board'] => '[url=' . $scripturl . '?board=' . $_POST['toboard'] . '.0]' . $board_name . '[/url]',
$txt['movetopic_auto_topic'] => '[iurl]' . $scripturl . '?topic=' . $topic . '.0[/iurl]'
));

$msgOptions = array(
'subject' => $txt['moved'] . ': ' . $subject,
'body' => $_POST['reason'],
'icon' => 'moved',
'smileys_enabled' => 1,
);
$topicOptions = array(
'board' => $board,
'lock_mode' => 1,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $user_info['id'],
'update_post_count' => !empty($pcounter),
);
createPost($msgOptions, $topicOptions, $posterOptions);
}


replace with:
// Add a URL onto the message.
$_POST['reason'] = strtr($_POST['reason'], array(
$txt['movetopic_auto_board'] => '[url=' . $scripturl . '?board=' . $_POST['toboard'] . '.0]' . $board_name . '[/url]',
$txt['movetopic_auto_topic'] => '[iurl]' . $scripturl . '?topic=' . $topic . '.0[/iurl]'
));

$msgOptions = array(
'subject' => $txt['moved'] . ': ' . $subject,
'body' => $_POST['reason'],
'icon' => 'moved',
'smileys_enabled' => 1,
'ua_os' => 'Servidor',
'ua_browser' => 'Movido',
'ua_os_icon' => 'servidor',
'ua_browser_icon' => 'move',
);
$topicOptions = array(
'board' => $board,
'lock_mode' => 1,
'mark_as_read' => true,
'ua_os' => 'Servidor',
'ua_browser' => 'Movido',
'ua_os_icon' => 'servidor',
'ua_browser_icon' => 'move',
);
$posterOptions = array(
'id' => $user_info['id'],
'update_post_count' => !empty($pcounter),
'ua_os' => 'Servidor',
'ua_browser' => 'Movido',
'ua_os_icon' => 'servidor',
'ua_browser_icon' => 'move',
);
createPost($msgOptions, $topicOptions, $posterOptions);
}


The only problem is that I don't know php enough to know how the server finds your OS or Browser so I just added the image of my OS and Browser since I'm the only one who moves topics.

Hope it helped  ;)

HR

#48

      elseif($tmp_array[1] == "6.0")
        {
        $client_data['system'] = "Windows Vista";
        $client_data['system_icon'] = "win_new";
        }

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

villasg

@HR what is this and how make ?

@X3mE solution for the errors please ?

HR

Quote from: villasg on December 25, 2008, 06:09:30 AM
@HR what is this and how make ?

THat is the detection sceme for Vista in the OS area  and its added to os_browser_detection.php in Sources under the OS area.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

C.Jack

Thx for the MOD.  :D

I have it working perfectly on 2.0B4 with several themes. Be sure to copy the os_browser_detection folder from /Themes/default/images to your custom themes' image folders to which this MOD is applied or you'll get the dreaded red "x" syndrome.
C.Jack

HR

To the gent who wrote the mod.. I have a bit of php I use in my sig.. you really want to trick this out?

// Language (I just use basics here....)
$language = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
if ( strstr($language, "en") ) $lang = "English";
elseif ( strstr($language, "es") ) $lang = "Spanish";
elseif ( strstr($language, "de") ) $lang = "German";
elseif ( strstr($language, "fr") ) $lang = "French";
elseif ( strstr($language, "it") ) $lang = "Italian";
elseif ( strstr($language, "ru") ) $lang = "Russian";
elseif ( strstr($language, "zh") ) $lang = "Chinese";
  else $lang = "Unknown";

// IP Data (Some like the danasoft sig but with my own special tweaks...)
$ip = $REMOTE_ADDR;
$resolved = gethostbyaddr ($REMOTE_ADDR);
// Check for Unresolved IP and Rip Domain (ISP/Host) if Resolved
if ($resolved == $ip) {
$isp = ".. Can't Resolve IP";
}
else
{
$str = preg_split("/\./", $resolved);
$i = count($str);
$x = $i - 1;
$n = $i - 2;
$z = $i - 3;
$isp = $str[$z] . "." . $str[$n] . "." . $str[$x];
}

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

villasg

Quote from: HR on December 24, 2008, 08:33:46 AM

      elseif($tmp_array[1] == "6.0")
        {
        $client_data['system'] = "Windows Vista";
        $client_data['system_icon'] = "win_new";
        }


Why add that ?
In the file os_browser_detection.php
have this
{
        $client_data['system'] = "Windows Vista";
        $client_data['system_icon'] = "vista";
        }

mitz

Hi guys I have read all these posts and tried some but it does not work for mine .. I have version 1.1.5 and I am using the babylon theme. Can someone give me a clue as to what to edit to get this mod going..

I have installed the mod with no problems...but will not show up
BK-SMF Sub-Board 1.5   
OS & Browser Detection 1.0
Anti-Spam Verification Questions 1.02
YouTube BBCode 2.4

I have attached my display.php and my display.template.php

Also do i have to put the images into a certain folder?

Any help would be greatly appreciated!!!! :)

HR

Quote from: villasg on December 30, 2008, 07:49:06 AM
Quote from: HR on December 24, 2008, 08:33:46 AM

      elseif($tmp_array[1] == "6.0")
        {
        $client_data['system'] = "Windows Vista";
        $client_data['system_icon'] = "win_new";
        }


Why add that ?
In the file os_browser_detection.php
have this
{
        $client_data['system'] = "Windows Vista";
        $client_data['system_icon'] = "vista";
        }


I had not noticed that in the version I downloaded.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

P_cool

Have translated it into Swedish-utf8!

Modifications.swedish-utf8.php:
$txt['OS_Browser_Compatible'] = 'kompatibel';
$txt['OS_Browser_OS'] = 'OS';
$txt['OS_Browser_Unknown'] = 'Ok&auml;nd';
$txt['OS_Browser_Browser'] = 'Webbl&auml;sare';

villasg

Quote from: villasg on December 12, 2008, 03:20:54 AM
Today i see in my error log that :
1) A new member activate acount.
(http://www.thai.gr/forum/index.php?action=activate;u=656;code=c2744da987)
The time in activate acount i take this errors

2) A moderator MOVE a topik
( http://www.thai.gr/forum/index.php?action=movetopic2;topic=441.0 )
Again take thiw errors

Undefined index: ua_browser_icon
Undefined index: ua_os_icon
Undefined index: ua_browser
Undefined index: ua_os


8: Undefined index: ua_browser_icon
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


AND

Undefined index: ua_os
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


And
Undefined index: ua_os_icon
Αρχείο: /****/*****/****/forum/Sources/Subs-Post.php
Γραμμή: 1538


Line 1538 is :
VALUES ('$posterOptions[ua_os]', '$posterOptions[ua_browser]', '$posterOptions[ua_os_icon]', '$posterOptions[ua_browser_icon]',


inside in
// Insert the post.
db_query("
INSERT INTO {$db_prefix}messages
(ua_os, ua_browser, ua_os_icon, ua_browser_icon,
ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES ('$posterOptions[ua_os]', '$posterOptions[ua_browser]', '$posterOptions[ua_os_icon]', '$posterOptions[ua_browser_icon]',
$topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",
SUBSTRING('$posterOptions[ip]', 1, 255), " . ($msgOptions['smileys_enabled'] ? '1' : '0') . ", '', SUBSTRING('$msgOptions[icon]', 1, 16))", __FILE__, __LINE__);
$msgOptions['id'] = db_insert_id();


@X3mE any solution for the errors please ?

X3mE

Thanks P_cool for the translation and thanks DeviDarkL for your solution to that moving topic error. I will test when I find some time.

I've been AFK for the last ~20 days, due to holidays and some real life obligations, and now my exam term has started, so I don't have much free time :/

I do promise to try and fix all those problems and publish an update as soon as possible.
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



digger

Quote from: edi67 on December 20, 2008, 04:55:36 PM
Quote from: AlenNS on December 16, 2008, 10:53:58 AM
Quotehttp://www.baklja.com/forum/index.php?action=movetopic2;topic=9938.0
The database value you're trying to insert does not exist: ua_os
Function: createPost
File: /home/baklja/public_html/forum/Sources/Subs-Post.php
Line: 1842

Same error for me when moderator try to move one topic

The database value you're trying to insert does not exist: ua_os

There's some cases when $posterOptions['ua_os'] and other ua_* not defined. For example, RSS Feeder when bot posts rss articles or some moderators actions.
The reason of this errors is not defined $posterOptions['ua_*'] in $smcFunc['db_insert'].



Advertisement: