The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

what is the problem in this JS code

View previous topic View next topic Go down

Solved what is the problem in this JS code

Post by omarpop23 on June 17th 2016, 9:56 pm

i wrote JS code to remove some Id in my Forum when user is online
but it didn't work i don't know why ?!!
The Code
Code:
$(function() {
  if (_userdata.session_logged_in) {
  document.getElementById("visitor-msg").innerHTML = '<style>.contact-item {display: none;}</style>'
    });
  }
//by omarpop23;
});

omarpop23
Forumember

Male Posts : 144
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by SLGray on June 17th 2016, 10:20 pm

Are you trying you remove the visitor message tab?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36639
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: what is the problem in this JS code

Post by omarpop23 on June 17th 2016, 10:34 pm

Pic when i logged out

pic when i logged in



i want to remove that when i logged in Wink

omarpop23
Forumember

Male Posts : 144
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by SLGray on June 18th 2016, 6:59 am

So you want to remove all contact fields from the profiles in messages? If yes, all you have to do is uncheck the message box for those fields: AP > Users & Groups > Users > Profiles > Contact Tab

Did that sentence appear before you added the code?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36639
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: what is the problem in this JS code

Post by SSYT on June 18th 2016, 7:17 am

Code:
$(function() {
  if (_userdata.session_logged_in == 0) {
  document.getElementById("visitor-msg").innerHTML = '<style>.contact-item {display: none;}</style>'
    });
  }
//by omarpop23;
});

SSYT
Forumember

Male Posts : 41
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: what is the problem in this JS code

Post by omarpop23 on June 18th 2016, 11:08 pm

@SLGray wrote:So you want to remove all contact fields from the profiles in messages? If yes, all you have to do is uncheck the message box for those fields: AP > Users & Groups > Users > Profiles > Contact Tab

Did that sentence appear before you added the code?

Invision version of forums dosen't had this part of contact user in profile details you have to add it by template
i add it but lable of Contact info appears to guests so i add that sentence "You have to login to view content"
i want to remove this sentence when user being logged in

sorry for my language hhhhhhhhhh

omarpop23
Forumember

Male Posts : 144
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by omarpop23 on June 18th 2016, 11:09 pm

@SLGray wrote:So you want to remove all contact fields from the profiles in messages? If yes, all you have to do is uncheck the message box for those fields: AP > Users & Groups > Users > Profiles > Contact Tab

Did that sentence appear before you added the code?

Invision version of forums dosen't had this part of contact user in profile details you have to add it by template
i add it but lable of Contact info appears to guests so i add that sentence "You have to login to view content"
i want to remove this sentence when user being logged in

sorry for my language hhhhhhhhhh

omarpop23
Forumember

Male Posts : 144
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by SLGray on June 19th 2016, 12:26 am

@omarpop23 wrote:
@SLGray wrote:So you want to remove all contact fields from the profiles in messages? If yes, all you have to do is uncheck the message box for those fields: AP > Users & Groups > Users > Profiles > Contact Tab

Did that sentence appear before you added the code?

Invision version of forums dosen't had this part of contact user in profile details you have to add it by template
i add it but lable of Contact info appears to guests so i add that sentence "You have to login to view content"
i want to remove this sentence when user being logged in

sorry for my language hhhhhhhhhh
Yes, it does. AP > Users & Groups > Users > Profiles
Contact Tab
Modify the fields you want to remove from messages. Uncheck the box called messages (display option).


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36639
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: what is the problem in this JS code

Post by Nemo on June 28th 2016, 2:07 pm

Hello @omarpop23,

Is this solved? If it is, please mark it as Solved.

Hello

Nemo
Support Moderator
Support Moderator

Male Posts : 1080
Reputation : 113
Language : Greek, English, French

http://www.helpgr.forumgreek.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by omarpop23 on June 30th 2016, 9:20 am

yes i had solved it close topic

omarpop23
Forumember

Male Posts : 144
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: what is the problem in this JS code

Post by Nemo on June 30th 2016, 9:38 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules

Nemo
Support Moderator
Support Moderator

Male Posts : 1080
Reputation : 113
Language : Greek, English, French

http://www.helpgr.forumgreek.com

Back to top Go down

View previous topic View next topic Back to top


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