The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Code visible only under conditions

3 posters

Go down

Solved Code visible only under conditions

Post by Niko Mon 10 Mar - 15:10

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 10 Mar - 15:41; edited 1 time in total
Niko
Niko
Helper
Helper

Male Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Rhino.Freak Mon 10 Mar - 15:29

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

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

http://freetest.forumotion.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Niko Mon 10 Mar - 15:38

Nope  Confused Crying or Very sad Crying or Very sad

solved  Mr. Green 
Niko
Niko
Helper
Helper

Male Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Rhino.Freak Mon 10 Mar - 15:42

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

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

http://freetest.forumotion.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by Niko Mon 10 Mar - 15:44

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

using && instead of ||  Mr. Green 
Niko
Niko
Helper
Helper

Male Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Code visible only under conditions

Post by SLGray Mon 10 Mar - 18:32

Problem solved & topic archived.


Code visible only under conditions Slgray10

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

Male Posts : 51554
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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