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.

Code visible only under conditions

View previous topic View next topic Go down

Solved Code visible only under conditions

Post by Niko on Mon Mar 10, 2014 10:10 am

Hello guys,

another issue..
what's wrong? the CODE HERE appears, but always! and not only if the member is logged in and if the post number is equal to 1

(and only on the home page)

Code:
$(window).load(function() {
  if (typeof _userdata === "undefined") return;
  if (_userdata["user_posts"] == '1' || _userdata["session_logged_in"] == '1') {
  $('#fa_toolbar').before('CODE HERE');
  }
  });

can you help me?
I want to view the code only if posts=1 and if you are logged in

thanks guys Mr. Green


Last edited by Niko! on Mon Mar 10, 2014 10:41 am; edited 1 time in total
avatar
Niko
Hyperactive

Male Posts : 2298
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Code visible only under conditions

Post by Rhino.Freak on Mon Mar 10, 2014 10:29 am

Im not sure, but I believe that || is OR, you must make it && .. but thats a guess.
avatar
Rhino.Freak
Helper
Helper

Male Posts : 1248
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Niko on Mon Mar 10, 2014 10:38 am

Nope ConfusedCrying or Very sadCrying or Very sad

solved Mr. Green
avatar
Niko
Hyperactive

Male Posts : 2298
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Code visible only under conditions

Post by Rhino.Freak on Mon Mar 10, 2014 10:42 am

Can you post what was the problem?
avatar
Rhino.Freak
Helper
Helper

Male Posts : 1248
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Niko on Mon Mar 10, 2014 10:44 am

@Rhino.Freak wrote:Can you post what was the problem?

using && instead of || Mr. Green
avatar
Niko
Hyperactive

Male Posts : 2298
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Code visible only under conditions

Post by SLGray on Mon Mar 10, 2014 1:32 pm

Problem solved & topic archived.


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

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.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