Gossamer Forum
Home : Products : Gossamer Links : Discussions :

an If statement

(Page 1 of 2)
> >
Quote Reply
an If statement
Hi

What will be a tag that will allow the logged in LinkOwner only to view specific info:

<%if LinkOwner%> does not do, everyone can see?

Also tried:

<%if <%Username%> eq <%LinkOwner%>%> and it does not work?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] an If statement In reply to
Hi Katabd, I think I addressed this in a pm.

As far as I know, you cannot have nested tags.


Try: <%if Username eq 'John'%><%endif%>


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jun 23, 2002, 8:35 PM
Quote Reply
Re: [Ian] an If statement In reply to
Funny, I have been trying the same thing, and can't get it to work any old way. I think you can's have nested tags, like Ian said...



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] an If statement In reply to
Which template are you trying it on?

You should do a dump of the gt tags for each template to see what is available. For example if you want to use the username tag in category.html, do a dump and make sure it is there first (it should be in this case).

You can do a dump by placing <%GT::Template::dump%> into any of your templates.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] an If statement In reply to
>>As far as I know, you cannot have nested tags. <<

You can't have tags within tags but you can have nested tags :)

>><%if <%Username%> eq <%LinkOwner%>%> <<

All you need to do here is remove the brackets.....

<%if Username eq LinkOwner%>

(providing those tag names are the right ones). It might be USER

Last edited by:

Paul: Jun 24, 2002, 2:18 AM
Quote Reply
Re: [Paul] an If statement In reply to
In Reply To:

All you need to do here is remove the brackets.....

<%if Username eq LinkOwner%>

and then replace LinkOwner by $LinkOwner...

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] an If statement In reply to
>>and then replace LinkOwner by $LinkOwner... <<

Hmm are you sure?....I think you can leave it out...or maybe thats just with my parser Cool
Quote Reply
Re: [Paul] an If statement In reply to
In Reply To:
>>and then replace LinkOwner by $LinkOwner... <<

Hmm are you sure?....I think you can leave it out...or maybe thats just with my parser Cool

Thats how you showed me how to do it for my Count_Impressions plugin.... <%Count_Impressions($ID)%> Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] an If statement In reply to
Yeah but thats a global code reference...thats a different thing.
Quote Reply
Re: [Ian] an If statement In reply to
Ian:



I have made a page to display various user fields (and, obviously, I have more user fields than the standard install... I have "homepage" and "Country" and "Hobbies", etc.) what I was trying to do was something so that if the Username of the person was the same as the name of the person being profiled, it would show a link to an "Edit Profile" page...



Will try the above!



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] an If statement In reply to
I tried:



Quote:


<%if <%user_name%> eq <%Username%>%>


<%if user_name eq Username%>[/quote]Neither seems to work.... in fact, the second one messes up some tables...



dave

dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] an If statement In reply to
<%if LinkOwner eq $Username%>, or even nicer

<%if isLinkOwner%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] an If statement In reply to
Good Morning Gossamer!

Nice lesson on nesting tags with Username going on here!Cool


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] an If statement In reply to
Have you had you coffee yet.. Wink
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] an If statement In reply to
Just arrived as I got your post!Wink


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [yogi] an If statement In reply to
This is in the description of available template-specific tags in the link.html template:

Code:


isLinkOwner => True if the logged in user owns this link (used to
provide a link to the modify form).


So, Yogi's suggestion of <%if isLinkOwner%> would be accurate (but only in the link.html template).


--
Matt G

Last edited by:

Matt Glaspie: Jun 24, 2002, 9:10 AM
Quote Reply
Re: [yogi] an If statement In reply to
Yogi:



Did not work either.



For me, this is what I am doing:



user_name is the registered name of the user whose profile you are looking at. Username is (obviously) the name you are logged in as. I want to check if you are logged in (easy- <%if Username%>), and , if so, see if you are logged in AS the person whose profile you are looking at... so if Username eq user_name... and, if so, show a link to modify your profile.



I scrapped all that, and just do a check to see if you are logged in, and then display the link, dumping the second check... that works!



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] an If statement In reply to
It might help to display all the template tags available to the page, using

<%GT::Template::dump%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] an If statement In reply to
Ivan:



Just above the IF statement, I did put the tags in, just so I could see them... and I do..



I put in <%Username%> <%username%>



and I get



admin admin



so they are there...



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] an If statement In reply to
So the following does not work? (it should...)
Code:
<%if Username%>
something
<%if Username eq $user_name%>
link to modify profile
<%endif%>
<%endif%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins

Last edited by:

yogi: Jun 24, 2002, 1:45 PM
Quote Reply
Re: [yogi] an If statement In reply to
I'm sure the following works:

<%if Username eq user_name%>

If Im wrong I don't know why I thought that it worked but I just have such a strong feeling.
Quote Reply
Re: [Paul] an If statement In reply to
I think I suggested this waaaay up this thread too. I use this througout my templates and it seems to work.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Paul] an If statement In reply to
I just tried:

Code:
<%set a = 'aaa'%>
<%set b = 'aaa'%>

<%if a eq b%>a eq b<%endif%>
<%if a eq $b%>a eq $b<%endif%>

Output: a eq $b

Wink

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] an If statement In reply to
Yep you are right...no idea why I thought that worked.

Last edited by:

Paul: Jun 24, 2002, 1:42 PM
Quote Reply
Re: [Ian] an If statement In reply to
I should correct my self I use:

<%if Username eq 'Bill'%>

But to use a value then I do use $value. This seems to work.


http://www.iuni.com/...tware/web/index.html
Links Plugins
> >