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

X3mE

Quote from: dannys on December 08, 2008, 03:41:17 AM
i install manualy but when try to execute mysql syntax give me a error ALTER TABLE {$db_prefix}messages ADD COLUMN ua_os TINYTEXT NOT NULL
Error

SQL query:

ALTER TABLE {$db_prefix}messages ADD COLUMN ua_os TINYTEXT NOT NULL

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{$db_prefix}messages ADD COLUMN ua_os TINYTEXT NOT NULL' at line 1


You need to type the actual prefix, instead of the "{$db_prefix}" part. So, it'll be something like:

ALTER TABLE smf_messages ADD COLUMN ua_os TINYTEXT NOT NULL

Note the "smf_" prefix, which is the actual prefix for all your SMF tables in the database.


saneone, thanks ;)
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



dannys

οκ X3mE thanx work perfect thanx :)

DeviDarkL


X3mE

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



quiz_modder

I am using SMF 2B4 and think I may have found a problem with this mod. When I try to move a post on my forum I am getting the following error:

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

This is definitely related to this mod. Any suggestions on fixes welcome.

Thanks

quiz_modder

Also, just noticed a lot of errors in the admin error log such as:

Undefined index: ua_browser

Undefined index: ua_os

Undefined index: ua_os_icon

I think you need to add a few isset or empty checks.

X3mE

Quote from: m4tthall on December 08, 2008, 05:21:18 PM
I am using SMF 2B4 and think I may have found a problem with this mod. When I try to move a post on my forum I am getting the following error:

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

This is definitely related to this mod. Any suggestions on fixes welcome.

Thanks

Well, I just moved a few posts around and all went fine...

Are there any more details on that error (file, line number)?

Quote from: m4tthall on December 08, 2008, 05:24:38 PM
Also, just noticed a lot of errors in the admin error log such as:

Undefined index: ua_browser

Undefined index: ua_os

Undefined index: ua_os_icon

I think you need to add a few isset or empty checks.

Checked my error logs, didn't get any of those. I'll do some more testing.
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



quiz_modder

OK, more information.

Error 1 - The database value you're trying to insert does not exist: ua_os Function: createPost
File: Sources/Subs-Post.php
Line: 1825

Error 2 - Undefined index: ua_browser_icon
File: Sources/Subs-Post.php
Line: 1822

Error 3 - Undefined index: ua_os_icon
File: Sources/Subs-Post.php
Line: 1822

Error 4 - Undefined index: ua_browser
File: Sources/Subs-Post.php
Line: 1822

Error 5 - Undefined index: ua_os
File: Sources/Subs-Post.php
Line: 1822

Seems most are related to one line.

Cheers

X3mE

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



Martingonnella

Hi,

Like the the sound of your mod, Installed it in to my 1.1.7 and posted a post. Didn't detect.

What's wrong?

I installed the "1.1.x one.

Help?

[unplugged]

It will not affect posts already made....only new posts after the mod has been installed.

At least that was my oversight when I installed this great mod. :P
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



X3mE

Quote from: Martingonnella on December 08, 2008, 09:25:02 PM
Hi,

Like the the sound of your mod, Installed it in to my 1.1.7 and posted a post. Didn't detect.

What's wrong?

I installed the "1.1.x one.

Help?

Are you talking about new posts? If so, did it install correctly? Check your database to see if there are 4 new columns in the messages table (ua_os, ua_browser, ua_os_icon and ua_browser_icon). Check some of your latest records to see if they are filled properly.

If they are, then attach display.php from your sources folder and display.template.php from your theme folder and I'll have a look.
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



tyhgdgh

thi only works on newest posts after this is installed, is this normal??

X3mE

It cannot guess which os & browser were used before it was installed :)
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



tyhgdgh

A swith change would be better, post when using firefox, the login with chrome, changes

X3mE

I'm not quite sure I understood what you tried to say :/

The mod is intended to record the OS & Browser used when posting a particular message, it stores that information in the database along with every post (after installing it, of course), and doesn't change it later.
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



AlenNS

Tonight I've got a critical error in my log:

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

X3mE

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



AlenNS

1841: ORDER BY ' .$sticky_sort. ' id_msg ' . ($ascending ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : '

Now it's on 1841. I don't know how...

DeviDarkL

#39
Hi again X3mE

I have Download System mod installed and I want, when you put an item at downloads to create a post at the forums (automatic) . But it's not working since your mod doesn't recognize the OS or the browser.

Is there a way to add an "if" like: «If don't recognize, dont put ua_os and ua_browser»

The problem is that I don't know php :(

Here it is the Subs-post.php attached (line 1814 and 1821 are from your mod. Don't know which needs to be changed)

Thanks in advance ;D

PS: Sorry for my English >:(

Advertisement: