Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2009, 09:36 AM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-22-2009, 09:49 AM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #3  
Old 10-22-2009, 01:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 10-22-2009, 10:22 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 10-22-2009, 10:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is not going to work in a php file, no, cuz it's html. That should work in a template though.
Reply With Quote
  #6  
Old 10-22-2009, 10:30 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's outside of the <?php tag though.
Reply With Quote
  #7  
Old 10-22-2009, 10:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 10-22-2009, 10:58 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 10-22-2009, 11:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change page type? I have no idea what option you are talking about there.
Reply With Quote
  #10  
Old 10-22-2009, 11:06 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15560 seconds
  • Memory Usage 2,255KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete