vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to turn code on/off over UserCP? (https://vborg.vbsupport.ru/showthread.php?t=98200)

Doc Great 10-12-2005 07:24 AM

How to turn code on/off over UserCP?
 
Hello folks,

a little question of mine, how can i set up a profile field to let the users turn on/off a special feature (ads between the posts). I did a new profile filed, and set the following code in front of the ad-code, but i dont know how to get on ...

Code:

if ($vbulletin->userinfo['field6'] == 'Off')
{


Adrian Schneider 10-12-2005 07:53 AM

PHP Code:

if ($vbulletin->userinfo['field6'] == 'On')
{
    
// ad code here



Like that?

Doc Great 10-13-2005 04:22 AM

Doesn't work. Anybody out there :)

Code:

if ($vbulletin->userinfo['field6'] == 'On')
{
<if condition="$GLOBALS['adsense_position'] == $post['postcount']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
        <td class="alt1" align="center">

<!-- Werbung -->

        </td>
</tr>
</table>

</div>
$spacer_close
</if>
}


Adrian Schneider 10-13-2005 04:23 AM

Use <if> if you are doing it in the templates.

HTML Code:

<if condition="$vbulletin->userinfo['field6'] == 'On'">
    your ad code here
</if>


Doc Great 10-13-2005 04:54 AM

Thanks Aj :) it works. Now it logical, (me :rolleyes: ) look at the first if-condition and then at the second, whats wrong :D:D

Often the answer is in front of you.......


All times are GMT. The time now is 07:15 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.01507 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete