Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 05-10-2016, 06:36 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
Dr.CustUmz
  #12  
Old 05-10-2016, 07:39 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
some awesome postbit style
</if>
COULD USE ELSE HERE
<if not post 1>
some simple postbit style
</if>
but yeah, thats not the same thing. So I'm liking the easiness of just throwing this below the quick reply or something lol.
Reply With Quote
  #13  
Old 05-15-2016, 09:53 PM
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Location: Earth
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$thread['firstpostid'
Reply With Quote
  #14  
Old 05-15-2016, 10:00 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 PinkMilk View Post
PHP Code:
$thread['firstpostid'
I played with that var when I was messing with all this trying to figure it out.

in what way were you thinking?
Reply With Quote
  #15  
Old 05-15-2016, 10:10 PM
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Location: Earth
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its been a while since playing with vb but I believe
PHP Code:
$thread['firstpostid'
is/was used to swap postbits (first post differ from others, amongst other things) at least thats what I think I used it for so my thinking is:
PHP Code:
<if condition == "$thread['firstpostid']">
Do 
something
<else />
Do 
something else
</if> 
Reply With Quote
  #16  
Old 05-15-2016, 10:54 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #17  
Old 05-16-2016, 06:04 PM
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Location: Earth
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>

<script>
$(document).ready(function(){
 
$('ul.tabs li').click(function(){
  var tab_id = $(this).attr('data-tab');

 $('ul.tabs li').removeClass('current');
 $('.tab-content').removeClass('current');
 $(this).addClass('current');
 $("#"+tab_id).addClass('current');

// hide replies if other tabs clicked
if($(this).index()) {
 $(".repliez").hide();
    } else {
 $(".repliez").show();
}
  });
}); // end
</script>

Additional CSS:
Code:
ul.tabs{
 margin: 0px;
 padding: 0px;
 list-style: none;
}

ul.tabs li{
 background: none;
 color: #222;
 display: inline-block;
 padding: 10px 15px;
 cursor: pointer;
}

.first {
 height:0!important;
 padding:0!important;
}

ul.tabs li.current{
 background: #ededed;
 color: #222;
}

.tab-content{
 display: none;
 background: #ededed;
 padding: 15px;
}

.tab-content.current{
 display: inherit;
}



Top of postbit template (original):
PHP Code:
<if condition="$post[postcount] == 1"

End of postbit template (original) add:

HTML Code:
<ul class="tabs">
		<li class="tab-link current" data-tab="tab-1">Comments</li>
		<li class="tab-link" data-tab="tab-2">Discus</li>
		<li class="tab-link" data-tab="tab-3">Facebook</li>
		<li class="tab-link" data-tab="tab-4">Google</li>
	</ul>

	<div id="tab-1" class="tab-content first current">


</div>
	<div id="tab-2" class="tab-content">
		 
Relevent content here.

	</div>
	<div id="tab-3" class="tab-content">
		
Relevent content here.

	</div>
	<div id="tab-4" class="tab-content">
		
Relevent content here.

	</div>

<else />
Now go find the postbit template copy you made earlier and make thse edits to it...find:
Code:
$template_hook[postbit_start]
<table class="tborder"
and change to
Code:
$template_hook[postbit_start]
<table class="tborder repliez"
Add
HTML Code:
</if>
to the end of the copy to close the condition.

and finally copy this all over to the end of original postbit template.

So now you should have something like

PHP Code:
if condition

pb template
tabs

else

pb template

/if 
Its probably not ideal thats why I said cheat solution but it does what you want I think?!
Attached Images
File Type: png comments.png (64.2 KB, 0 views)
File Type: png other-tab.png (48.4 KB, 0 views)
Reply With Quote
3 благодарности(ей) от:
Dr.CustUmz, greigeh, TheLastSuperman
  #18  
Old 05-16-2016, 07:51 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 )
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:46 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.04430 seconds
  • Memory Usage 2,286KB
  • 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
  • (5)bbcode_code
  • (2)bbcode_html
  • (6)bbcode_php
  • (1)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
  • (8)post_thanks_box
  • (4)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete