Posted via Mobile Device Script
2 posters
Page 1 of 1
Posted via Mobile Device Script
Hi guys! I am just wondering if it's possible to include "Posted via Mobile Device" at the end part of the post once a user posted/replied a topic using their mobile (in mobile version). I wan't this feature to monitor the activity of mobile users (how often they're using it to browse the forum) as I am planning to create a mobile application of my forum for android users.
Thank you in advance!
Where is my cookie?
Posted via Mobile Device.
Thank you in advance!
Last edited by Najerj on September 1st 2015, 2:16 pm; edited 3 times in total
Re: Posted via Mobile Device Script
Hi @Najerj,
Sorry for the delay, I wrote up a small snippet for you to try. Go to Modules > JavaScript codes management and create a new script
Placement : In the topics ( or all pages depending on your preferences )
Sorry for the delay, I wrote up a small snippet for you to try. Go to Modules > JavaScript codes management and create a new script
Placement : In the topics ( or all pages depending on your preferences )
- Code:
$(function() {
if (_userdata.page_desktop) {
var form = $('.postbody form')[0];
if (form) {
form.onsubmit = function() {
if (this.message) this.message.value += '\n\n[size=10][i]Posted via Mobile Device.[/i][/size]';
};
}
}
});
Re: Posted via Mobile Device Script
@Ange Tuteur Thank you! You always amaze me.
However, the code only works when the user replied in a post. Posted via Mobile Device message doesn't appear when posting a New Post even the javascript was tick to all pages.
Forum URL: http://royalflyff.forumtl.com/
However, the code only works when the user replied in a post. Posted via Mobile Device message doesn't appear when posting a New Post even the javascript was tick to all pages.
Forum URL: http://royalflyff.forumtl.com/
Re: Posted via Mobile Device Script
Here, try replacing it with this :
I adjusted the query so it looks for all forms that match the message form.
- Code:
$(function() {
if (_userdata.page_desktop) {
var form = $('form[action="/post"]')[0];
if (form) {
form.onsubmit = function() {
if (this.message) this.message.value += '\n\n[size=10][i]Posted via Mobile Device.[/i][/size]';
};
}
}
});
I adjusted the query so it looks for all forms that match the message form.
Similar topics
» Suggested Script (Need Someone that can read script)
» #1578 Poll boxes aren't visible on mobile device
» Colorize cells when a new message is posted (script issue)
» Disable the Mobile Version (New Script)
» register Script (I Need The Script)
» #1578 Poll boxes aren't visible on mobile device
» Colorize cells when a new message is posted (script issue)
» Disable the Mobile Version (New Script)
» register Script (I Need The Script)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum