vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   getFieldValue or similar query (https://vborg.vbsupport.ru/showthread.php?t=225687)

Mysterious2207 10-21-2009 09:36 AM

getFieldValue or similar query
 
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:
Code:

<if condition="radiobuttonischeckedyes">
<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>
</if>

Any help would be greatly appreciated,
Thanks,
Danny.

--------------- Added [DATE]1256155121[/DATE] at [TIME]1256155121[/TIME] ---------------

BUMP - any help?

--------------- Added [DATE]1256165702[/DATE] at [TIME]1256165702[/TIME] ---------------

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):
Code:

<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 [DATE]1256257017[/DATE] at [TIME]1256257017[/TIME] ---------------

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.?

Code:

<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?


All times are GMT. The time now is 04:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00999 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete