vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   bbquote template (https://vborg.vbsupport.ru/showthread.php?t=176886)

ChU v2 04-22-2008 06:53 PM

bbquote template
 
For my hack: https://vborg.vbsupport.ru/showthread.php?t=175282



I'm trying to get the font code to display within the quote box, but I can't get this to work. Here is my code within the bbcode_quote template:



Code:


<div style="margin:20px; margin-top:5px; <if condition="$show['iewidthfix']">width: 100%;</if>">

    <div class="smallfont" style="margin-bottom:2px">$vbphrase[quote]:</div>

    <table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">

    <tr>

        <td class="alt2" style="border:1px inset">

            <if condition="$show['username']">

                <div>

                    <phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase>

                    <if condition="$postid"><a href="showthread.php?$session[sessionurl]p=$postid#post$postid" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/viewpost.gif" border="0" alt="$vbphrase[view_post]" /></a></if>

                </div>

                <div>



<!--Custom Font-->

<if condition="$userinfo[field10] OR $userinfo['field14'] OR $userinfo['field11'] OR $userinfo['field15'] OR $userinfo['field17'] OR $userinfo['field16']">



<span style="font: $userinfo[field14]px $userinfo[field11]; color: $userinfo[field10]; font-weight: $userinfo[field15]; font-style: $userinfo[field16]; text-decoration: $userinfo[field17];">$message</strong></span>





</if>

<!--/Custom Font-->



</div>

            <else />

                $message

            </if>

        </td>

    </tr>

    </table>

</div>


Lynne 04-22-2008 07:37 PM

Lack of quotes here maybe?

<if condition="$userinfo[field10]

Should be..

<if condition="$userinfo['field10']

What is it doing exactly? Nothing for the quotes at all? Or just some? Is it in the source code incorrectly or not at all?

MoT3rror 04-22-2008 07:47 PM

Quote:

Originally Posted by Lynne (Post 1496784)
Lack of quotes here maybe?

<if condition="$userinfo[field10]

Should be..

<if condition="$userinfo['field10']



What is it doing exactly? Nothing for the quotes at all? Or just some? Is it in the source code incorrectly or not at all?

The single quotes will cause a parse error.

Your css won't work right if the user doesn't provide all the fields.

You might be able to try something like this but it will get complex.
Code:

<div style="
<if condition="$userinfo[field14]">
font-size: $userinfo[field14]px;
</if>
<if condition="$userinfo[field11]">
font: $userinfo[field11];
</if>
...
">$message</div>


ChU v2 04-22-2008 07:58 PM

Quote:

Originally Posted by MoT3rror (Post 1496793)
The single quotes will cause a parse error.

Your css won't work right if the user doesn't provide all the fields.

You might be able to try something like this but it will get complex.
Code:

<div style="
<if condition="$userinfo[field14]">
font-size: $userinfo[field14]px;
</if>
<if condition="$userinfo[field11]">
font: $userinfo[field11];
</if>
...
">$message</div>



Yes the quotes did give me an error, I will try your suggestion though, thanks.

Lynne 04-22-2008 08:02 PM

Quote:

Originally Posted by MoT3rror (Post 1496793)
The single quotes will cause a parse error.

How do you memorize this stuff. I can never remember. I just try it and if it works, great! If not, I try it without. It seems to be one way in php and the other in the templates.

ChU v2 04-22-2008 08:19 PM

Ya I can't get it to work with either way. It seems it does not like variable $userinfo. $bbuserinfo works fine, but obvisously that just displays what the browsing user has entered in his/her profile NOT what the acually user that is displayed has selected. I don't know why that is, php works differently between each template.

MoT3rror 04-22-2008 08:21 PM

Yeah $userinfo isn't a variable in the template system. Sorry didn't catch that.

$bbuserinfo contains all the userinfo.

ChU v2 04-22-2008 09:15 PM

Quote:

Originally Posted by MoT3rror (Post 1496815)
Yeah $userinfo isn't a variable in the template system. Sorry didn't catch that.

$bbuserinfo contains all the userinfo.

but $bbuserinfo doesn't display the poster's fields, it displays the user that is browsing, what they have entered into the fields.

So what variable could I use? $post doesn't work either :(

MoT3rror 04-22-2008 10:00 PM

When the quote is parsed in vB_BbCodeParser::handle_bbcode_quote, it only globalize these variables.
PHP Code:

global $vbulletin$vbphrase$stylevar$show

So a way to get around this might be to globalize $post or whatever is used in the location you need but this will take a file edit because there is no hook in this location.

ChU v2 04-22-2008 11:16 PM

Quote:

Originally Posted by MoT3rror (Post 1496866)
When the quote is parsed in vB_BbCodeParser::handle_bbcode_quote, it only globalize these variables.
PHP Code:

global $vbulletin$vbphrase$stylevar$show

So a way to get around this might be to globalize $post or whatever is used in the location you need but this will take a file edit because there is no hook in this location.

How would I go about globalizing the variable?


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

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.03392 seconds
  • Memory Usage 1,746KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_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