vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

Asterix_ita 01-01-2010 08:37 AM

Quote:

Originally Posted by ragtek (Post 1943831)
$forum[forumid] have to be registered to the template.
There's an other article here.

thanks, I must enter the new logic. Happy New Year

MikeWarner 01-02-2010 10:27 AM

Hi - thanks for this post, however, can you provide conditionals for CMS sections please?

BBR-APBT 01-02-2010 02:19 PM

Quote:

Originally Posted by MikeWarner (Post 1944821)
Hi - thanks for this post, however, can you provide conditionals for CMS sections please?

I don't have the CMS and most of these will work for the CMS.

You may have to preregister the var.

abumohamed 01-05-2010 05:44 PM

Thanks

hochun 01-05-2010 10:14 PM

Hello everybody! I have one problem with porting one of my products to VB4.

I have the setting for a product called vfsms_can_stick_by_sms - it's comma separated list of forum-sections where this product is turned on.

In this product I have the following plugin:

Code:

        <plugin active="1" executionorder="5">
            <title>Detecting can thread in this forum can be stick up by SMS or not.</title>
            <hookname>showthread_start</hookname>
            <phpcode>
                <![CDATA[
                    $vfsms_can_stick_by_sms_forums_ids = str_replace(' ', '', $vbulletin->options['vfsms_can_stick_by_sms']);
                    $vfsms_allowed4sticky_forums = explode(',', $vfsms_can_stick_by_sms_forums_ids);
                    // I've already read article from this forum abt passing variables to the template engine
                    vB_Template::preRegister('SHOWTHREAD', array('vfsms_allowed4sticky_forums' => $vfsms_allowed4sticky_forums));
                ]]>
            </phpcode>
        </plugin>

And in template SHOWTHREAD I have next conditional:

Code:

{vb:raw $vfsms_allowed4sticky_forums}
{vb:raw $forumid}

    <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin:10px">
      <tr>
        <td align="center">

<vb:if condition="$vbulletin->userinfo['userid'] == $threadinfo['postuserid']  AND ($threadinfo['sticky_till'] != '0000-00-00 00:00:00' AND $threadinfo['sticky'] == 1)">
          Your thread is sticky untill <b style="color: red;">{vb:raw threadinfo.sticky_till}</b>!<br />
          For prolongation send sms with the text <b style="color: red;">#vf sticky {vb:raw threadinfo.threadid}</b> to the number <b style="color: blue;">{$vbulletin->options[vfsms_sticky_num]}</b>.

<vb:elseif condition="$vbulletin->userinfo['userid'] == $threadinfo['postuserid']  AND $threadinfo['sticky_till'] == '0000-00-00 00:00:00' AND $threadinfo['sticky'] == 0 AND in_array($forumid, $vfsms_allowed4sticky_forums)" />

          You can make your topic sticky by sending SMS with text <b style="color: red;">#vf sticky {vb:raw threadinfo.threadid}</b> to the number <b style="color: blue;">{$vbulletin->options[vfsms_sticky_num]}</b>.

<vb:else />
    You can not make your topic sticky.
</vb:if>
        </td>
      </tr>
    </table>

I have few problems:

1. variable $vfsms_allowed4sticky_forums can be accessed only as a {vb:raw vfsms_allowed4sticky_forums} and I can not put it to the condition
2. variable $forumid is not accessible anymore

Please, somebody, help me!

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

but everything is ok if I pass variable directly from the showthread.php:


Code:

1. find showthread.php:2228 print_output($templater->render());
2. replace on

       
Code:

       
        $vfsms_can_stick_by_sms_forums_ids = str_replace(' ', '', $vbulletin->options['vfsms_can_stick_by_sms']);
    $vfsms_allowed4sticky_forums = explode(',', $vfsms_can_stick_by_sms_forums_ids);
        $templater->register('vfsms_allowed4sticky_forums', $vfsms_allowed4sticky_forums);
print_output($templater->render());



and in template also replace $forumid on $thread[forumid]

This is absolutely wrong way of doing the thing I need, pls tell me how to do it without changes in showthread.php!

BBR-APBT 01-07-2010 09:12 PM

well first off this is a thread for conditionals. Thats why your not getting much help with your whole script.

Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

SledgeHead 01-08-2010 04:03 AM

How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.

BBR-APBT 01-08-2010 04:53 PM

Quote:

Originally Posted by SledgeHead (Post 1950116)
How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.

Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

putuajun 01-08-2010 05:55 PM

subscribed :)

SledgeHead 01-08-2010 07:11 PM

Quote:

Originally Posted by BBR-APBT (Post 1950504)
Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

I apologize. I was wondering for the conditional tags to use to accomplish this.


All times are GMT. The time now is 08:30 AM.

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.01905 seconds
  • Memory Usage 1,748KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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