vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Determine thread position in the threadlist (https://vborg.vbsupport.ru/showthread.php?t=294844)

addamroy 02-12-2013 01:59 PM

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.

LifesGreatestGift 02-12-2013 04:55 PM

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.

addamroy 02-12-2013 11:20 PM

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.

LifesGreatestGift 02-12-2013 11:34 PM

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.

addamroy 02-12-2013 11:37 PM

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 :/

LifesGreatestGift 02-12-2013 11:39 PM

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.

addamroy 02-13-2013 01:01 AM

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.

LifesGreatestGift 02-13-2013 02:25 AM

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.

addamroy 02-13-2013 12:52 PM

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.


All times are GMT. The time now is 11:00 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.01093 seconds
  • Memory Usage 1,728KB
  • 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
  • (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
  • (9)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