FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 34 users online :: 0 Registered, 0 Hidden and 34 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

Visitor Messages on All

View previous topic View next topic Go down

Wilson
Wilson

Gender : Unspecified
Age : 37
Posts : 868
Points : 4611
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
http://generalaxis.forums.com.bz/

PostWilson Tue 26 Apr 2016, 11:53

Sup. Just want to ask anyone if there is a way to automatically tick All members on the option "Allow visitor messages on my profile"?

I tried the script that @Ange Tuteur gave on his reply (+rep): https://fmdesign.forumotion.com/t526-how-to-embed-games-into-posts#7542

Modified it a bit, but unfortunately, it was a no-no. This is the modified script:
Code:
$(function() {
  if (_userdata.session_logged_in && !my_getcookie('fa_html_checked')) {
    $.get('/profile?mode=editprofile&page_profil=preferences', function(d) {
      var form = $('#ucp', d);
 
      if (form[1] && !form[1].profilemsgs[1].checked) {
        $.post('/profile', form.serialize().replace(/profilemsgs=1/, 'profilemsgs=2') + '&submit=2', function() {
          my_setcookie('fa_html_checked', '2');
        });
      } else {
        my_setcookie('fa_html_checked', '2');
      }
    });
  }
  'par ange tuteur';
});

Thank you.
SLGray
SLGray
Valued Member
Gender : Male
Age : 51
Posts : 2465
Points : 7135
Reputation : 290
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray Tue 26 Apr 2016, 14:23

Setting things in members' profiles could cause some members to leave.  Profile settings should be set by the members themselves.
Wilson
Wilson

Gender : Unspecified
Age : 37
Posts : 868
Points : 4611
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
http://generalaxis.forums.com.bz/

PostWilson Tue 26 Apr 2016, 14:35

SLGray wrote:Setting things in members' profiles could cause some members to leave.  Profile settings should be set by the members themselves.

I think you read it wrong... I'm not changing their settings, I am requesting a script for a default option. They can always change it everytime they want.
SLGray
SLGray
Valued Member
Gender : Male
Age : 51
Posts : 2465
Points : 7135
Reputation : 290
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray Tue 26 Apr 2016, 17:43

I read what you posted. I mean that members might not want it set to all by default.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12042
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 26 Apr 2016, 20:16

@Wilson see if this one works for you :
Code:
$(function() {
  if (_userdata.session_logged_in && !my_getcookie('fa_vm_checked')) {
    $.get('/profile?mode=editprofile&page_profil=preferences', function(d) {
      var form = $('#ucp', d);
 
      if (form[0] && !form[0].profilemsgs[0].checked) {
        $.post('/profile', form.serialize().replace(/profilemsgs=\d/, 'profilemsgs=2') + '&submit=1', function() {
          my_setcookie('fa_vm_checked', '1');
        });
      } else {
        my_setcookie('fa_vm_checked', '1');
      }
    });
  }
  'par ange tuteur';
});
Wilson
Wilson

Gender : Unspecified
Age : 37
Posts : 868
Points : 4611
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
http://generalaxis.forums.com.bz/

PostWilson Wed 27 Apr 2016, 00:08

Ange Tuteur wrote:@Wilson see if this one works for you :
Code:
$(function() {
  if (_userdata.session_logged_in && !my_getcookie('fa_vm_checked')) {
    $.get('/profile?mode=editprofile&page_profil=preferences', function(d) {
      var form = $('#ucp', d);
 
      if (form[0] && !form[0].profilemsgs[0].checked) {
        $.post('/profile', form.serialize().replace(/profilemsgs=\d/, 'profilemsgs=2') + '&submit=1', function() {
          my_setcookie('fa_vm_checked', '1');
        });
      } else {
        my_setcookie('fa_vm_checked', '1');
      }
    });
  }
  'par ange tuteur';
});
That is much appreciated @Ange Tuteur, thanks a bunch! Smile

Sorry too for abusing the General Discussions as a place for my questions, it'll be my last until the Questions forum show up. Bow 1


Last edited by Wilson on Thu 28 Apr 2016, 08:54; edited 1 time in total
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12042
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 27 Apr 2016, 11:28

You're welcome. Smile

Don't worry about it, I'll move these topics into that section when it's created. Wink
Wilson
Wilson

Gender : Unspecified
Age : 37
Posts : 868
Points : 4611
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
http://generalaxis.forums.com.bz/

PostWilson Thu 28 Apr 2016, 09:14

Doff

Question Smile
Code:
fa_html_checked
fa_vm_checked

Do only handful of peoples know these i-dont-know-what-is-it-called?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12042
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Thu 28 Apr 2016, 12:23

Those are the names that I've given to the cookies. When the request is sent it checks if the specified field has been ticked, if it has it stores a cookie to prevent further requests. If it isn't ticked, the script sends another request that updates the profile and then stores the cookie.

In short, it prevents the request to the /profile page from being sent more than once per session. As long as the cookie lives it'll send no more requests. Wink
Wilson
Wilson

Gender : Unspecified
Age : 37
Posts : 868
Points : 4611
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
http://generalaxis.forums.com.bz/

PostWilson Fri 29 Apr 2016, 04:05

Ange Tuteur wrote:Those are the names that I've given to the cookies. When the request is sent it checks if the specified field has been ticked, if it has it stores a cookie to prevent further requests. If it isn't ticked, the script sends another request that updates the profile and then stores the cookie.

In short, it prevents the request to the /profile page from being sent more than once per session. As long as the cookie lives it'll send no more requests. Wink

Ahh. Thanks for the in-depth explanation. Very Happy
Anonymous
Guest
Guest

PostGuest Tue 23 Aug 2016, 04:14

*** Topic solved, locked and archived ***
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum