![]() |
[HUH?] if not first post display within first post
Im lost, cant get this one down.
So Im trying to do a tab thingy, and show posts that are not the first post in a tab. Code:
<if condition="$post[postcount] != 1"> so how can I get this to un contradict itself =/ heres what i have POSTBIT Code:
<if condition="$post[postcount] == 1"> Code:
<div id="posts">$postbits this has to be possible somehow =/ maybe im over thinking it |
Are you sure $post['postcount'] can be used for that? I thought that stores the current postcount of the user.
|
Can you not use defined <else conditions /> to get where you want to be?
|
Quote:
Code:
$post[postcount] my if condition is not wrong, i just need a way to un-contradict myself, so i can show posts not post 1 within a div, in post 1... i think thats right lol, confussing myself now Quote:
hmmmm just an idea, tested - results 2 post down HTML Code:
<if condition="$post[postcount] == 1"> |
Perhaps use one of the examples shown here:
https://vborg.vbsupport.ru/showpost....59&postcount=2 Of course remove the vb:if and make it vB3 compliant. Edit: Rough example IF max posts per page is set to 20 in admincp: Code:
<if condition="$post['postcount'] % $vboptions['maxposts'] == 19">YOUR CODE HERE</if> |
ok, so that almost did it, but the page output is (relative to the example code I placed above)
Code:
POSTBIT TEMPLATE HERE POSTBIT TEMPLATE AGAIN HERE should be inside div content1 hmmm...... beats me =( |
Quote:
|
Quote:
i guess i can spoil the addon and show you guys one sec ill include code --------------- Added [DATE]1462844841[/DATE] at [TIME]1462844841[/TIME] --------------- https://vborg.vbsupport.ru/external/2016/05/24.png https://vborg.vbsupport.ru/external/2016/05/25.png this would be the new postbit template: replace red text with def postbit code (just keeping it short) Code:
<if condition="$post[postcount] == 1"> what it returns in page *notice content1 is blank, then postbit repeats (those would be comments) at the end, i cut it cause it just keeps repeating for each comment. HTML Code:
<input id="tab4" type="radio" name="tabs"> LIVE: DEV ZONE |
Mannnnnnnnnnn why'd you break my brain! This is so simple I think it's being over-complicated or perhaps some of your </if> positions are not correct... see this example:
Code:
<section id="content1"> I'll have another look tomorrow, been coding my brains out today and now brain = pudding! This looks like a job for Tomorrow Man :cool:. |
thanks, yeah my head hurts trying to figure this out, i like the idea of seperating the comments from the social comments, but i have tried so many ways i cant figure this out for nothing lol
makes sense to me just cant seem to get it <if condition="$post[postcount] == 1"> ***PASTE POSTBIT TEMPLATE HERE*** SHOWS FIRST POST <section id="content1"> </if> <if condition="$post[postcount] != 1"> ***PASTE POSTBIT TEMPLATE HERE*** ALL POSTS NOT POST 1 NEED TO BE INSIDE CONTENT1 DIV*** THIS IS NOT THE COREECT PLACEMENT </if> <if condition="$post[postcount] == 1"> MORE STUFF IF POST 1 </section> |
Okay I came back to this today and BAM it hit me... you're using conditionals to call postbit content but there is no way for it to know... hmm how to explain "it doesn't know with you simply pasting the template code that it should show post 1 versus post 2+ in the areas you're pasting the code". So when you see the info being shown twice it's because you pasted the ****** Postbit template contents here ****** more than once and the conditional will not split a query or anything of that nature.
***PASTE POSTBIT TEMPLATE HERE*** ALL POSTS NOT POST 1 NEED TO BE INSIDE CONTENT1 DIV*** <-- will not work because the postbit template code is calling to show all posts (or XX amount per page depending on settings). You won't be able to do this unless you do some custom queries and a plugin of some sort, it simply won't differentiate between them despite using conditionals until you do so in my opinion. |
makes sense to me :) think I may just go about it another way (put the comments tabs under the forum comments or something just to not get too tied up on this.
my thinking behind it was cause ive done 2 templates for postbit before quick ugly example Code:
<if post 1> |
PHP Code:
|
Quote:
in what way were you thinking? |
Its been a while since playing with vb but I believe
PHP Code:
PHP Code:
|
that shows "Do something" on every post. like I said I played with alot of things that maybe could have worked, but never was able to come up with anything
|
1 Attachment(s)
Ok so did a little playing around and have come up with this kind of cheat solution to hide replies when other tabs are open using jquery...
Open postbit template and copy it to a text file and save it as you will need it later. headinclude template: Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> Additional CSS: Code:
ul.tabs{ Top of postbit template (original): PHP Code:
End of postbit template (original) add: HTML Code:
<ul class="tabs"> Code:
$template_hook[postbit_start] Code:
$template_hook[postbit_start] HTML Code:
</if> and finally copy this all over to the end of original postbit template. So now you should have something like PHP Code:
|
oh shoot, and i was going to leave it the sloppy way I had it lol, I dont believe this is a cheat solution this is pro status THE SOLUTION lol havent got to throw it together yet, dont want to get sidetracked from my embed plugin atm. But this looks solid and amazing =)
thank you! (this was inspired from a wordpress plugin btw ;) ) |
All times are GMT. The time now is 10:22 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|