Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-12-2013, 01:59 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LifesGreatestGift, is there anyway I could use a vb:if conditional inside showthread with that new position variable? I just want to wrap it around something. vb:if condition="$position >= x" or something like that.
Reply With Quote
  #12  
Old 02-12-2013, 04:55 PM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Theres no need, it will only display when the condition of the plugin is met. So just put it where you want and style it in the plugin.
Reply With Quote
  #13  
Old 02-12-2013, 11:20 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I have another mod that shows a button somewhere else in the SHOWTHREAD template, and I want to essentially show one button there if the position is higher than a certain number, and another button if its lower than that number. Was hoping to accomplish that with a simple conditional, if it's possible anyway. No big need it's more of an extra.
Reply With Quote
  #14  
Old 02-12-2013, 11:34 PM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will only the thread starter see it or everyone? if everyone, the query will need to be ran for everyone.

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

right now, the query is just ran for the thread author.
Reply With Quote
  #15  
Old 02-12-2013, 11:37 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see what you mean. Yes it does still have to work for the thread owner, but there is a vbif conditional for that right, thread postuserid == bbuserinfo userid or something like that? So I could wrap that conditional around it so the query is still only run for the thread owner, then a conditional inside that for $position (assuming I can even use that as a conditional as a result of using the code you gave me)

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

Maybe i just don't know what I'm talking about lol :/
Reply With Quote
  #16  
Old 02-12-2013, 11:39 PM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need to know, if everyone will be able to see the new button based on the condition you want to make, or just the thread author.
Reply With Quote
  #17  
Old 02-13-2013, 01:01 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just the thread author

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

Right next to the new thread button is where I have it now. (it just doesn't change according to position) The only reason I mention that at all is because I was thinking of the 2 different hook locations you talked about, showthread_complete and showthread_start idk if that location makes a difference.
Reply With Quote
  #18  
Old 02-13-2013, 02:25 AM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does this work?

Code:
<vb:if condition="$position == 2">DO THIS</vb:if>
only way you would be able to tell, is if you are the author of the second thread (or whatever number you put in the conditional). Test it out. If it doesnt work, in the code I gave you

FIND
Code:
    vB_Template::preRegister('SHOWTHREAD',array('display' => $display));
REPLACE WITH
Code:
    vB_Template::preRegister('SHOWTHREAD',array('display' => $display));
    vB_Template::preRegister('SHOWTHREAD',array('position' => $position));
Then see if the conditional works.
Reply With Quote
  #19  
Old 02-13-2013, 12:52 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it's stupid that I have to like someone else's post before I can like yours, LOL

That worked perfect, I had to add the second preregister line to make it work. Awesomeness. Thank you so much for the help, seriously appreciate it.
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 08:28 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.04529 seconds
  • Memory Usage 2,263KB
  • Queries Executed 14 (?)
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
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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