IMPORTANT

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

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 09 Oct 2018, 11:34

» 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

» Numbering of messages in the topic
by SLGray Mon 04 Dec 2017, 22:40

Recent Tutorials
Top posting users this month
Who is online?
In total there are 8 users online :: 0 Registered, 0 Hidden and 8 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Visitor Messages on All

View previous topic View next topic Go down

avatar
Wilson

Gender : Unspecified
Age : 32
Posts : 868
Points : 2599
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
View user profile http://generalaxis.forumotion.com/

PostWilson on 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): http://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.

--------

A banana a banana does not banana doctor banana. -Poetic
avatar
SLGray
Valued Member
Gender : Male
Age : 45
Posts : 2465
Points : 5123
Reputation : 290
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on 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.
avatar
Wilson

Gender : Unspecified
Age : 32
Posts : 868
Points : 2599
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
View user profile http://generalaxis.forumotion.com/

PostWilson on 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.

--------

A banana a banana does not banana doctor banana. -Poetic
avatar
SLGray
Valued Member
Gender : Male
Age : 45
Posts : 2465
Points : 5123
Reputation : 290
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Tue 26 Apr 2016, 17:43

I read what you posted. I mean that members might not want it set to all by default.
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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';
});

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Wilson

Gender : Unspecified
Age : 32
Posts : 868
Points : 2599
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
View user profile http://generalaxis.forumotion.com/

PostWilson on 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

--------

A banana a banana does not banana doctor banana. -Poetic
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Wilson

Gender : Unspecified
Age : 32
Posts : 868
Points : 2599
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
View user profile http://generalaxis.forumotion.com/

PostWilson on 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?

--------

A banana a banana does not banana doctor banana. -Poetic
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Wilson

Gender : Unspecified
Age : 32
Posts : 868
Points : 2599
Reputation : 124
Language : Filipino and Engrish
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
View user profile http://generalaxis.forumotion.com/

PostWilson on 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

--------

A banana a banana does not banana doctor banana. -Poetic
avatar
Guest
Guest

PostGuest on 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