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 04-22-2008, 06:53 PM
ChU v2 ChU v2 is offline
 
Join Date: May 2007
Location: Chicago
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
  #2  
Old 04-22-2008, 07:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 04-22-2008, 07:47 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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>
Reply With Quote
  #4  
Old 04-22-2008, 07:58 PM
ChU v2 ChU v2 is offline
 
Join Date: May 2007
Location: Chicago
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
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.
Reply With Quote
  #5  
Old 04-22-2008, 08:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
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.
Reply With Quote
  #6  
Old 04-22-2008, 08:19 PM
ChU v2 ChU v2 is offline
 
Join Date: May 2007
Location: Chicago
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 04-22-2008, 08:21 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

$bbuserinfo contains all the userinfo.
Reply With Quote
  #8  
Old 04-22-2008, 09:15 PM
ChU v2 ChU v2 is offline
 
Join Date: May 2007
Location: Chicago
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
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
Reply With Quote
  #9  
Old 04-22-2008, 10:00 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 04-22-2008, 11:16 PM
ChU v2 ChU v2 is offline
 
Join Date: May 2007
Location: Chicago
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
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?
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 04:42 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.05258 seconds
  • Memory Usage 2,272KB
  • 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
  • (2)bbcode_php
  • (5)bbcode_quote
  • (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