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 05-09-2016, 06:51 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [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">
but to do this i had to wrap the postbit template in an if is first post condition
so how can I get this to un contradict itself =/

heres what i have POSTBIT
Code:
<if condition="$post[postcount] == 1">

POSTBIT TEMPLATE WOULD GO HERE?

  <div id="content1">
    <if condition="$post[postcount] != 1">
      PUT POSTS NOT POST 1 IN DIV - POSTBIT TEMPLATE WOULD GO HERE AGAIN BUT CONTRADICTS ITSELF
    </if>
  </div>
    
  <div id="content2">
    more stuff to only show if post one
  </div>
</if>
ive tried this in the showthread template too using something like

Code:
<div id="posts">$postbits
<if condition="$FIRSTPOSTID">
but that failed.

this has to be possible somehow =/ maybe im over thinking it
Reply With Quote
  #2  
Old 05-09-2016, 07:11 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure $post['postcount'] can be used for that? I thought that stores the current postcount of the user.
Reply With Quote
  #3  
Old 05-09-2016, 08:21 PM
greigeh greigeh is offline
 
Join Date: Jan 2015
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you not use defined <else conditions /> to get where you want to be?
Reply With Quote
  #4  
Old 05-09-2016, 11:09 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Are you sure $post['postcount'] can be used for that? I thought that stores the current postcount of the user.
Code:
$post[postcount]
is the post number in a thread, starting back at 1 for the first post of every thread.

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:
Originally Posted by greigeh View Post
Can you not use defined <else conditions /> to get where you want to be?
ya could... see somewhere it would fit? lol.

hmmmm just an idea, tested - results 2 post down
HTML Code:
<if condition="$post[postcount] == 1">
  POSTBIT TEMPLATE HERE
  <div id="content1">
</if>

<if condition="$post[postcount] != 1">
  POSTBIT TEMPLATE AGAIN HERE
</if>

<if condition="$post[postcount] == 1">
  </div>
  <div id="content2">
    more stuff to only show if post one
  </div>
</if>
Reply With Quote
  #5  
Old 05-09-2016, 11:26 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Maybe I misunderstood too? Maybe this will help
Reply With Quote
  #6  
Old 05-09-2016, 11:30 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, so that almost did it, but the page output is (relative to the example code I placed above)


Code:
POSTBIT TEMPLATE HERE

<div id="content1">

</div>
<div id="content2">
  more stuff to only show if post one
</div>

POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
so div content 1 is empty and comment display at the end...
POSTBIT TEMPLATE AGAIN HERE should be inside div content1 hmmm...... beats me =(
Reply With Quote
  #7  
Old 05-09-2016, 11:34 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dr.CustUmz View Post
ok, so that almost did it, but the page output is (relative to the example code I placed above)


Code:
POSTBIT TEMPLATE HERE

<div id="content1">

</div>
<div id="content2">
  more stuff to only show if post one
</div>

POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
POSTBIT TEMPLATE AGAIN HERE
so div content 1 is empty and comment display at the end...
POSTBIT TEMPLATE AGAIN HERE should be inside div content1 hmmm...... beats me =(
Post us YOUR entire postbit template so we can see, perhaps we'll notice the issue right off the bat.
Reply With Quote
  #8  
Old 05-09-2016, 11:37 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheLastSuperman View Post
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>
Maybe I misunderstood too? Maybe this will help
I'm trying to display all comments that are not the first post, within the first post, not show something after a specific post... well kinda but not in the same sense lol

i guess i can spoil the addon and show you guys one sec ill include code

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





this would be the new postbit template: replace red text with def postbit code (just keeping it short)
Code:
<if condition="$post[postcount] == 1">

***PASTE POSTBIT TEMPLATE HERE***

  <input id="tab1" type="radio" name="tabs" checked>
  <label for="tab1">Comments</label>
    
  <input id="tab2" type="radio" name="tabs">
  <label for="tab2">Disqus</label>
    
  <input id="tab3" type="radio" name="tabs">
  <label for="tab3">Facebook</label>
    
  <input id="tab4" type="radio" name="tabs">
  <label for="tab4">Google+</label>

  <section id="content1">
</if>  
<if condition="$post[postcount] != 1">
    ***PASTE POSTBIT TEMPLATE HERE***
</if>    
<if condition="$post[postcount] == 1">
  </section>
    
  <section id="content2">
    2
  </section>
    
  <section id="content3">
    3
  </section>
    
  <section id="content4">
    4
  </section>
</if>

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">
  <label for="tab4">Google+</label>

  <section id="content1">

  </section>
    
  <section id="content2">
    ...
  </section>
    
  <section id="content3">
    ...
  </section>
    
  <section id="content4">
    ...
  </section>

<!-- END TEMPLATE: postbit -->

	</div>
	<!-- BEGIN TEMPLATE: spacer_close -->
		</div>
	</div>
</div>

<!-- / close content container -->
<!-- END TEMPLATE: spacer_close -->

<!-- / post #5 -->
<!-- END TEMPLATE: postbit_wrapper --><!-- BEGIN TEMPLATE: ad_showthread_firstpost -->

<!-- END TEMPLATE: ad_showthread_firstpost --><!-- BEGIN TEMPLATE: postbit_wrapper -->
<!-- post #6 -->

	<!-- BEGIN TEMPLATE: spacer_open -->
<!-- open content container -->

<div align="center">
	<div class="page" style="width:980px; text-align:left">
		<div style="padding:0px 25px 0px 25px" align="left">

<!-- END TEMPLATE: spacer_open -->
	<div id="edit6" style="padding:0px 0px 6px 0px">
	<!-- this is not the last post shown on the page -->


<!-- BEGIN TEMPLATE: postbit -->

LIVE: DEV ZONE
Reply With Quote
  #9  
Old 05-10-2016, 12:38 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">
</if>  
<if condition="$post[postcount] != 1">
    ***PASTE POSTBIT TEMPLATE HERE***
</if>    
<if condition="$post[postcount] == 1">
  </section>
I think... hmm perhaps you pasted the code in the wrong location. It's almost like you have the != backwards maybe? I've been stuck in a similar position when working on a mod waaaay back in the day very similar to DJ's mod https://vborg.vbsupport.ru/showthread.php?t=184136

I'll have another look tomorrow, been coding my brains out today and now brain = pudding! This looks like a job for Tomorrow Man .
Reply With Quote
Благодарность от:
Dr.CustUmz
  #10  
Old 05-10-2016, 01:03 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
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:02 PM.


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.05473 seconds
  • Memory Usage 2,303KB
  • Queries Executed 12 (?)
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
  • (10)bbcode_code
  • (2)bbcode_html
  • (4)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
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete