inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 13:57:06 GMT -8
I know that there's currently a bug re; genders displaying in profile, but I was wondering if it's possible to get the $[user.gender] variable to work out if you're male, female or neither. I'm making a v4-style mini-profile, and because genders aren't displaying at the minute, I can't work out if I'm doing the right thing or not. Thus far I've just been trying {if $[user.gender] == "male/Male/1"} DO THING {elseif $[user.gender] == "female/Female/2"} DO THING {else} DO THING{/if} However, because I'm not sure which is correct (due to the bug stopping the gender from displaying) I can't really post up the template mod, which I'd like to do sooner rather than later.
Just thought I'd ask, someone might happen to know. =P
ed; having checked the source, it looks like the alt & title for the gender image are both 'Male', so could I just use $[user.gender.alt/title] instead?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 14:23:06 GMT -8
Yeah, match on the alt or title. That's what I would do.
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 14:30:49 GMT -8
Nice one. =]
As I'm going, I've also found another little snag. I'm trying to recreate the little block of images (the homepage/pm/aim/yim/msn etc one), but I can't seem to find any of the details. The PM button is easy enough to do, but for a users' website all I can find is $[user.website], which just displays 'website' as a link. Can't seem to find something I could use in an <a> tag.
Similarly, the various social/messenger networks (aim/msn/yim, and now fb/twitter etc) aren't individually represented by variables. Would there be any way to get at these details?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 14:41:30 GMT -8
$[user.website] does have properties, it just doesn't expand to show them, so am guessing you found a bug $[user.website.href] is what you want. For the social stuff, they are in a loop, so you will need to loop over them... $[user.social_network]
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Dec 3, 2012 14:46:12 GMT -8
Peter how are you finding these variables? Is it just trial and error or are they somewhere we can find?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 14:47:55 GMT -8
Peter how are you finding these variables? Is it just trial and error or are they somewhere we can find? Variables are available when you edit a template. As for the "website" variable, it just seemed right that the href property would exist, so I tried it.
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 14:48:09 GMT -8
$[user.website] does have properties, it just doesn't expand to show them, so am guessing you found a bug $[user.website.href] is what you want. For the social stuff, they are in a loop, so you will need to loop over them... $[user.social_network] I think there's a couple of little ones. The variable displayed for reg date should be $[user.registered_on_date] instead of the $[user.registered_on] that it inserts, for example. Cheers for that though, don't know why I didn't think to try it, just logical, haha. And I'm just going to pretend that I know what that means. =P Looks like a bit of reading is necessary xD
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 14:51:44 GMT -8
$[user.website] does have properties, it just doesn't expand to show them, so am guessing you found a bug $[user.website.href] is what you want. For the social stuff, they are in a loop, so you will need to loop over them... $[user.social_network] I think there's a couple of little ones. The variable displayed for reg date should be $[user.registered_on_date] instead of the $[user.registered_on] that it inserts, for example. Cheers for that though, don't know why I didn't think to try it, just logical, haha. And I'm just going to pretend that I know what that means. =P Looks like a bit of reading is necessary xD Yeah, I just tried it, as it would be rather inconsistent with other variables that are links. Sorry, should have said to use a foreach loop for the social network stuff. For an example, check the summary template for profile.
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 15:06:02 GMT -8
I think there's a couple of little ones. The variable displayed for reg date should be $[user.registered_on_date] instead of the $[user.registered_on] that it inserts, for example. Cheers for that though, don't know why I didn't think to try it, just logical, haha. And I'm just going to pretend that I know what that means. =P Looks like a bit of reading is necessary xD Yeah, I just tried it, as it would be rather inconsistent with other variables that are links. Sorry, should have said to use a foreach loop for the social network stuff. For an example, check the summary template for profile. Clearly just wasn't thinking properly, because I'd had a look through some of the others for inspiration. =P Only problem with that is that they show text as default - I'm using the little square images that used to be PB default. I'd rather they were editable by admins, too. As an example, for a user website I've gone with {if $[user.website]}<a href="$[user.website.href]" target="_blank"><img src="http://images.proboards.com/new/buttons/www_sm.png" alt="View $[user.name]'s homepage" /></a> Allows the admin to change the image/alt text.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 15:32:54 GMT -8
Unfortunately looping through the social network array is no good right now anyway, there is nothing to match it against that stays the same. "title" is always empty, there is no "text" property, and "href" is only good for partial matching, which we can't do. What I would have done is make sure the names of the images that get uploaded for the theme match the social network text, and then I would have matched the "text" or "title" property to display the correct image. Only way this would be possible is to request that all elements that contain text have a "text" property for templates. {foreach $[user.social_network]} {if $[user.social_network.text] == "Twitter"} .... {elseif a == b} ... {/if} {/foreach} That's if I am understanding you correctly
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 15:50:25 GMT -8
I think you are, although I did have to read that twice to make sure I understood you xD Before I go making requests though I'll wait a bit - I think I can live with it just being homepage/pm, and I'll see what happens in the coming updates. Never know, might yet be an easier way - if nothing else, I'd like what I'm doing to be fairly easy to edit, so that admins can choose which icons display. It'd just look silly if all the social/messenger networks were in a miniprofile, along with pm and homepage. Trying to tell people how to edit the loop to choose which icons they wanted to potentially display would be a nightmare. =P
Cheers for your help though mate. =]
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 16:34:58 GMT -8
Last one for now, I promise. xD Is there any way to get a timestamp to only display certain elements? Maybe obvious, but I'm trying to just get the Month/Year for the miniprofile, rather than the full display. <_< Or is that just being really awkward? xD
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 3, 2012 17:06:12 GMT -8
Unfortunately no, as far as I can tell
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Dec 3, 2012 17:23:51 GMT -8
I'd figured as much. ¬_¬
|
|