PDA

View Full Version : New Posting Features - Append User Agent String to New Threads and Posts


dartho
07-21-2008, 10:00 PM
Description
This add-on will append a user's browser's User Agent String to new posts/threads.

Version Information
0.0.1 - Initial Release
0.0.2 - Added ability to only append User Agent Sting to posts/threads in specified forums.
0.0.3 - Fixed bug where previewing a post adds UA multiple times
0.0.3c - Fixed possible HTML injection vulnerability

Options
You can optionally configure it to append alternative text or BBCode (Such as IMG tags) rather than the literal User Agent String for specific User Agent Strings (or parts of).

You can configure it to not appended anything under certain styles

You can change the way the string is displayed with BBCode

(0.0.2) You can specify to only append User Agent String to posts/threads in specific forums.

Limitations
1. The User Agent String (or alternative BBCode/Text) is appended to the post text itself. There is nothing to stop the user from then editing the post and removing it. As such it will also show by default when quoted.

2. Turning the add-on OFF will not stop the display of User Agent Strings for past posts, it will only stop new posts/threads having it appended.

The upside of these is that there are no additional queries added to display this.


Screen Shots
https://vborg.vbsupport.ru/attachment.php?attachmentid=84387&d=1216700936

bxbigt
07-22-2008, 04:46 AM
Sweet!!!

M-Tuning
07-22-2008, 09:58 AM
Nice!

digicom
07-24-2008, 07:00 AM
thanks installed :up:

GreasySpoon
07-24-2008, 07:47 AM
Is it possible to configure it just for special forums, not for all?

Q-v-n-s-Q
07-24-2008, 08:20 AM
perfect, thanks

dartho
07-24-2008, 10:02 AM
Is it possible to configure it just for special forums, not for all?

Yes you could do that buy editing the plugins for this addon and adding another conditional based on the forum ID. I can see value in this - I'll look into making it a feature. Would be especially good in say a 'site problems' forum so you can see exactly what browser is causing people issues....

GreasySpoon
07-24-2008, 01:25 PM
Would be especially good in say a 'site problems' forum so you can see exactly what browser is causing people issues....

Yes, this is exactly the reason why i have asked for this feature ;)

dartho
07-25-2008, 03:04 AM
I've now added the ability to specify forums in which the User Agent String will be appended to posts.

GreasySpoon
07-25-2008, 02:59 PM
I've now added the ability to specify forums in which the User Agent String will be appended to posts.

Great, thank you. I will give it a try.

temporaryins
09-01-2008, 10:59 PM
Just recently got this, was wondering if it was possible to add in a option to only show browser information if it's on an admin-defined list (ie: iphone/ipod), and not post it otherwise?

Also, can there be an option to post it at the top of the post/thread instead of the bottom?

Edit: One other thing :) if it's turned on and set to show the browser information, can it not show it in the preview page? Only because if I preview a post/thread multiple times before posting it I have to keep deleting the browser information unless I want it repeated over and over multiple times.

Cybertims
09-02-2008, 05:39 AM
Usergroup permissions would be great, cheers for this.

dartho
09-02-2008, 06:59 AM
Edit: One other thing :) if it's turned on and set to show the browser information, can it not show it in the preview page? Only because if I preview a post/thread multiple times before posting it I have to keep deleting the browser information unless I want it repeated over and over multiple times.

not tested much, but hopefully Fixed in 0.0.3

dartho
09-02-2008, 07:28 AM
Also, can there be an option to post it at the top of the post/thread instead of the bottom?

Editing the Add Useragent String to New Posts and Add Useragent String to New Threads plugins and changing the line (2nd last line)

$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n" . $vbulletin->options['ua37_prefix'] . $ua37_new_ua . $vbulletin->options['ua37_affix'] . "\n";
}

to

$vbulletin->GPC['message'] = $vbulletin->options['ua37_prefix'] . $ua37_new_ua . $vbulletin->options['ua37_affix'] . "\n" . $vbulletin->GPC['message'];
}

should do it for you

Usergroup permissions and selectively applying it are a thing for a future release ...

vbreal
09-18-2008, 01:54 PM
is it possible to make this show just for phones and not web browsers on pcs

vbreal
09-18-2008, 01:56 PM
Just recently got this, was wondering if it was possible to add in a option to only show browser information if it's on an admin-defined list (ie: iphone/ipod), and not post it otherwise?

.

oops didn't see this

vbreal
09-18-2008, 01:57 PM
ahh shit i just realized this was 3.7

will this work with 3.6

dartho
09-18-2008, 09:12 PM
I reckon it would assuming the hook locations exist in 3,6...

vbreal
09-21-2008, 04:07 AM
yo how can i get it to put a break between the post and the browser info.


oh for the peeps that want it to show for just the iphone or ipod. i assume u have a mobile theme. exclude all themes BUT the mobile theme and that should hold us over until showing for phone only is an option. if it becomes an option in the future i should say. haa

dartho
09-21-2008, 04:22 AM
Editing the following line in the newreply_post_start and newthread_post_start plugins and replace the for "\n" with "\n\n" will put an extra line break bewteen the message and the user agent


$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n" . $vbulletin->options['ua37_prefix'] . $ua37_new_ua . $vbulletin->options['ua37_affix'] . "\n";

vbreal
09-23-2008, 08:40 PM
thanks

that did the job

vbreal
09-26-2008, 09:17 PM
few issues

i have my main forum set to be excluded from appending the browser info. it should only show for my mobile theme. BUT it shows for mozilla browser and mac users on the forum that's excluded


also
HTC TOUCH and palm centrio phones don't even show up when they use the mobile theme. but it should, any idea why it isn't

dartho
09-26-2008, 11:11 PM
There is no option for excluding forums. By default, all forums are included or you can choose to only have it show in explicitly defined forums only.

Could it be that the Mozilla/Mac users are actually browsing your site using the mobile style and teh HTC/Palm users are using your default style?

I'll check the logic of the product also and see if there may issues with it

nerofix
09-26-2008, 11:22 PM
Could you do this to show in the Memberinfo template?

vbreal
09-30-2008, 10:43 AM
There is no option for excluding forums. By default, all forums are included or you can choose to only have it show in explicitly defined forums only.

Could it be that the Mozilla/Mac users are actually browsing your site using the mobile style and teh HTC/Palm users are using your default style?

I'll check the logic of the product also and see if there may issues with it

your mod has the ability to set what style you do not want the user info to show on.

I made my main theme not show the user agent string. but users who use macs and modzilla are showing up when posting from this style. i am sure they are not using the mobile theme. i had them do screen shots and i made the mobile theme unselectable.

the HTC users were on the mobile style.

No User Agent for these styles
Enter a comma separated list of StyleID numbers to not append User Agent String to.

If a user is using the any of the following styles, the User Agent String will not be appended to their posts.

vbreal
10-06-2008, 12:11 PM
any thoughts?

dartho
10-06-2008, 01:07 PM
I've looked and can;t see what could be causing your issues - do you have any other addons install which modify styles, or even with new posts/threads? Or, perhaps it is not compatible with 3.5/3.6?

Anyone else have similar issues - or any otehr for that matter?

dartho
10-13-2008, 12:08 AM
I've had another look and the *may* be missing parenthesis in a plugin - I say may as I think it should be OK anyway, but if you could edit the Add Useragent String to New Posts and Add Useragent String to New Threads plugins and change

if ((($vbulletin->options['ua37_enabled']) && ($_POST[preview] != "Preview Post") && (!in_array($styleid,explode(",",$vbulletin->options['ua37_not_this_style'])))) && (in_array($threadinfo[forumid],explode(",",$vbulletin->options['ua37_this_forum_only'])) || (trim($vbulletin->options['ua37_this_forum_only'])=="")))


to


if ((($vbulletin->options['ua37_enabled']) && ($_POST[preview] != "Preview Post") && (!in_array($styleid,explode(",",$vbulletin->options['ua37_not_this_style'])))) && ((in_array($threadinfo[forumid],explode(",",$vbulletin->options['ua37_this_forum_only']))) || (trim($vbulletin->options['ua37_this_forum_only'])=="")))


and see if that fixes things?

-----

For a reality check - the logic for adding the useragent string is as follow:

IF the product is enabled, AND we are not previewing the post AND the user is not using an excluded style are all true

AND

We are in an forum where UA strings should be appended OR no forums are specified (ie. append in all forums) are true

THEN add the UA string

this sound right?

CR_TurboGuy
01-22-2009, 01:13 PM
What about the ability to add this to private messages? I've taken a look at the hooks private_newpm_reply and private_newpm_start, and neither seem to do the trick for adding to a PM.

--JOsh

dartho
01-23-2009, 12:51 AM
After a cursory look, I think PM integration would require file edits - hooks don't seem to be in quite the right place ...

CR_TurboGuy
01-23-2009, 12:27 PM
Ok, that's fine. Someone else had asked about it in the iPhone optimized skin thread.

--JOsh

kawzaki
05-19-2009, 12:17 PM
very very very NICE!

I was looking for this hack and was about to create one my self after losing hope to find one already made (could not believe nobody has created it yet, any rational webmaster needs such a good info to track spammers).

my addition is to allow USERGROUPS to view this info,

<if condition="in_array($bbuserinfo[usergroupid], array(1,3,4))">
This is not a registration or login page and this person is not a fully registered forum member.
</if>


1,2,3,4 can be specified by the user in the admincp
(if u add a textbox field)

milto grace

kawzaki
05-19-2009, 11:21 PM
Successfully installed and running with vbulletin 3.6.8 and 3.7.5

it works as expected except for one situation in 3.6 that I am trying to understand why..
with 3.7, the problem does not happen.

The code does not append the UA to the message
when the FORUM has (Moderate new Posts/Threads ). that is, new threads or replies need moderator's approval.

Sorry if can't support it, but thought someone could shed a light here while searching..
could it be related to HOOK order ?

dartho
05-20-2009, 02:54 AM
Sounds like a hook issue. I'd guess that the hooks used aren't called for moderated posts/threads ...

dancue
06-09-2009, 08:16 PM
Any way I can have this in the postbit_legacy under Location or Join date?

froglips
06-25-2009, 02:00 PM
Love this mod, one minor question on the version.

I downloaded the 0.0.3c xml file, but the contents of the file show this line:

<version>0.0.3a</version>

Filename is product-ua37-0.0.3c.xml

Thanks,
Jim

dartho
06-25-2009, 09:38 PM
The version is an oversight on my behalf - that is the correct file.

vbreal
04-01-2010, 04:33 PM
is there a vb 4.0 version?