vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [HUH?] if not first post display within first post (https://vborg.vbsupport.ru/showthread.php?t=322585)

Dr.CustUmz 05-09-2016 06:51 PM

[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

Dave 05-09-2016 07:11 PM

Are you sure $post['postcount'] can be used for that? I thought that stores the current postcount of the user.

greigeh 05-09-2016 08:21 PM

Can you not use defined <else conditions /> to get where you want to be?

Dr.CustUmz 05-09-2016 11:09 PM

Quote:

Originally Posted by Dave (Post 2570417)
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 (Post 2570418)
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>


TheLastSuperman 05-09-2016 11:26 PM

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

Dr.CustUmz 05-09-2016 11:30 PM

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 =(

TheLastSuperman 05-09-2016 11:34 PM

Quote:

Originally Posted by Dr.CustUmz (Post 2570427)
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.

Dr.CustUmz 05-09-2016 11:37 PM

Quote:

Originally Posted by TheLastSuperman (Post 2570426)
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 :p

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] ---------------

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">

***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

TheLastSuperman 05-10-2016 12:38 AM

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 :cool:.

Dr.CustUmz 05-10-2016 01:03 AM

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>


All times are GMT. The time now is 03:53 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.01347 seconds
  • Memory Usage 1,769KB
  • 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
  • (10)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_quote_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
  • (10)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