View Full Version : getFieldValue or similar query
Mysterious2207
10-21-2009, 09:36 AM
I'm looking to edit a template to display something if a user has checked a Radio Button (custom field) in their UserCP.
So what I'm looking for is how I could do this:
<if condition="radiobuttonischeckedyes">
<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>
</if>
Any help would be greatly appreciated,
Thanks,
Danny.
--------------- Added 1256155121 at 1256155121 ---------------
BUMP - any help?
--------------- Added 1256165702 at 1256165702 ---------------
Anyone?
Mysterious2207
10-22-2009, 09:49 AM
Anyone?
Lynne
10-22-2009, 01:52 PM
What template are you wanting to put it in? Search in the Articles forums for "profile*" in "titles only" and you should find an article on how to add user profile fields into the postbit templates.
Mysterious2207
10-22-2009, 10:22 PM
I think I got it, I added this to the PHP file for the portal (reason I was doing this):
<if condition="$post['field11'] == 'No'">
<script type="text/javascript">
window.location="redirectlocation.com"
</script>
</if>
Wouldn't that work?
Lynne
10-22-2009, 10:24 PM
That is not going to work in a php file, no, cuz it's html. That should work in a template though.
Mysterious2207
10-22-2009, 10:30 PM
It's outside of the <?php tag though.
Lynne
10-22-2009, 10:52 PM
I don't think the condition will work unless it's in a template. That is a special type of vbulletin only condition - it isn't regular html. Try it and you'll see what happens.
Mysterious2207
10-22-2009, 10:58 PM
Wait, what if I changed the option in the ACP where it is "Change page type", what if I made it a template, and would it be accessible from there?
Lynne
10-22-2009, 11:02 PM
Change page type? I have no idea what option you are talking about there.
Mysterious2207
10-22-2009, 11:06 PM
I'm using "vBadvanced CMPS", and there's an option to change page type in the ACP, and the options are "PHP", "HTML", "Template", and "BBCode", would changing the page type solve it?
--------------- Added 1256257017 at 1256257017 ---------------
EDIT: I found the template for it, and the home template, I've added this script, however, should it go at the VERY top, or under the <html> tags, ect.?
<if condition="$post['field11'] == 'No'">
<script type="text/javascript">
window.location="LINK"
</script>
</if> is the script I've added, but it isn't working. Is there an issue with the redirect code or something?
Mysterious2207
10-24-2009, 12:55 AM
Anyone?
--------------- Added 1256428841 at 1256428841 ---------------
Please?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.