Announcement

Collapse
No announcement yet.

Template Conditional on Custom Profile Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Template Conditional on Custom Profile Fields

    Im trying to edit my showgroups.php page to display data from custom profile fields.

    I can't get any data from my custom profile fields to display. I've tried <if condition="$user['fieldX']"> and it doesnt display anything.

    Here's an example code im trying to get working:

    <if condition="$user['field49']"><div class="smallfont">$user[field49]<else />None</div></if>
    You can see the page at http://www.gamers-union.net/showgroups.php

    Any idea's how i can get this to work? I've tried searching various sites with information on conditionals, but nothing works.

    P.S. The header, navbar and footer are removed because the page will be iframed into another page.
    I Like Turtles

  • #2
    Look at other conditional codes displayed on that page and mimic it. You don't need an else tag.
    That's it. If you REALLY can't say ANYTHING nice to me at all on this forum, then I am going to go insanely mad at you. I've had enough of the UNTOLD ABUSE you are all giving me and you should really be CONSIDERATE of other people.

    Comment


    • #3
      Looks like you are horrifically botching the <div>. You start it after the if and end it in the else, that's not good.

      Code:
      <div class="smallfont"><if condition="$user['field49']">$user[field49]<else />None</if></div>

      Comment


      • #4
        Originally posted by Homeworld'sa View Post
        Look at other conditional codes displayed on that page and mimic it. You don't need an else tag.
        I tried that, it isint working. Here's one of the codes from the default template:

        <if condition="$show['locationfield'] AND $user['field2']"><div class="smallfont" title="$vbphrase[location_perm]">$user[field2]</div></if>
        My code follows the same $user[fieldX] and it still doesnt display.
        I Like Turtles

        Comment


        • #5
          What is your current code and in what template.

          Comment


          • #6
            Originally posted by Zachery View Post
            What is your current code and in what template.
            Template: showgroups_usergroupbit
            Page: http://www.gamers-union.net/showgroups.php

            Code:
            <tr>
                <td class="$bgclass"><a href="member.php?$session[sessionurl]u=$user[userid]">$user[musername]</a></td>
                <td class="$bgclass">
                    <if condition="$user['field51']"><div class="smallfont">$user[field51]</div></if>
                </td>
                    <td class="$bgclass">
                    <if condition="$user['field49']"><div class="smallfont">$user[field49]<else />None</div></if>
                </td>
            <td class="$bgclass">
             <if condition="$user['field41']"><div align="center"><img src="http://steamprofile.com/steam/profile/default/$user[field41].png" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" border="0" border="0"></div><else /><div align="center">SteamID Unknown</div></if>
            </td>
            </tr>
            I Like Turtles

            Comment


            • #7
              Have you considered that your profile field may not be available? Are the other profile fields working? Can you show just field 49/41.

              Comment


              • #8
                All the profile fields that im testing for have content in them (some users), but despite that, the content still doesnt show up in any users' line.

                Even if i put the field without the if statement, it still doesnt display.
                I Like Turtles

                Comment


                • #9
                  Its possible that the information isnt availbe then.

                  Comment


                  • #10
                    The custom fields are not set to private, i dont understand why they dont display. They display fine in the postbit though.

                    You can see on this thread above the signature is the steam graphic. Im trying to get that same graphic (among other things) to display on the showgroups page.
                    Last edited by |Jordan|; Thu 8 Apr '10, 3:27pm.
                    I Like Turtles

                    Comment


                    • #11
                      Its just possible that data is not being fetched so its not available to be used.

                      Comment


                      • #12
                        If the fields empty, it won't display.
                        Just type some text in the field and see if it appears.
                        That's it. If you REALLY can't say ANYTHING nice to me at all on this forum, then I am going to go insanely mad at you. I've had enough of the UNTOLD ABUSE you are all giving me and you should really be CONSIDERATE of other people.

                        Comment


                        • #13
                          The field isint empty for all users. For users that have the field filled out it doesnt display for them either.

                          The field displays fine when used in postbit, but it does not display at all when used in showgroups.
                          I Like Turtles

                          Comment


                          • #14
                            Look, not all varibles are available on every page for use. What I'm telling you is THE VARIBLE YOU WANT TO USE IS NOT AVAILABLE. Changing this will require modifications to the code.

                            Comment


                            • #15
                              Ah, now i understand.

                              Sometimes you've gotta dumb it down for us common folk.
                              I Like Turtles

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X