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

Reply
 
Thread Tools Display Modes
  #11  
Old 02-14-2009, 03:53 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure I understand. It sounds like you are simply using the postbit template, but not the showthread page, correct? So, do these posts even have post numbers? If so, then I suppose <if condition="$post[postcount] == '1'"> may be valid. I really can't tell because I'm not sure if you are using the same variable names at all for these posts.
Reply With Quote
  #12  
Old 02-14-2009, 04:09 AM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne
Thanks for the reply and sorry for the confusion. I'll try explain in more detail.

As mentioned before, we're essentially styling the download manager plugin, vbdynamix. Each download has a details page, where you can post updates in the form of posts and optionally allow users to reply etc. This part of the page seems is handled by vb. Since we've told VBD to use its own template, we can go crazy on it without worrying about messing up the main forum.

My aim with this project is to get the downloads page to look un-forum-y as possible This is what i have in the downloads details page (ADV_DYNA_SHOWENTRY):

PHP Code:
<if condition="$post[postcount] == '1'">
  <
div id="updates">
    <
h2>Update Stream:</h2>
    <
ul>$postbit</ul>
  </
div>
</if> 
I tried the conditional posts check you suggested, but unfortunately it didnt work.

In the postbit_legacy i have this:
PHP Code:
<li class="updates">
$template_hook[postbit_start]
$template_hook[postbit_messagearea_start]
<
class="update-date">$post[postdate]</p>
<
class="update-message">$post[message]</p>
<if 
condition="is_member_of($bbuserinfo, 6)"><a href="$post[editlink]name="vB::QuickEdit::$post[postid]">Edit</a></if>
$template_hook[postbit_end]
</
li
and the postbit_wrapper i have this (there was a bunch of other unnecessary html which i stripped out):
PHP Code:
$postbit 
Hope this helps..
Cheers,
Chris
Reply With Quote
  #13  
Old 02-14-2009, 04:19 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="$post[postcount] == '1'"> doesn't work? If not it's probably because $post[postcount] doesn't exist. You may have to spit out some variables in the templates in order to see exactly what is available and then determine what you want to use for your conditions.I am unfamiliar with vbdynamix so I really don't know that I can be of much help.
Reply With Quote
  #14  
Old 02-14-2009, 04:38 AM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne,
I tried adding $post[postcount] into the ADV_DYNA_SHOWENTRY page and it didnt output anything. I then went on to add it to the postbit_legacy file and it now shows a 1,2,3 etc on each of the posts. So i'm guessing hte postcount option only works when inside of the postbit template.

You mentioned spitting out some variables to see what is available. Could you elaborate?

Thanks,
Chris
Reply With Quote
  #15  
Old 02-14-2009, 04:52 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It sounds like you did what I was suggesting - putting something like $post[postcount] in the template to see what gets spit out. Unfortunately, I don't understand what this output page is you are talking about. If that variable works in the template, isn't that where you wanted to use it? You could do what you were saying in the postbit_legacty template by just wrapping it all in a condition, no?

HTML Code:
<if condition="$post[postcount] == '1'">
<li class="updates">
$template_hook[postbit_start]
$template_hook[postbit_messagearea_start]
<p class="update-date">$post[postdate]</p>
<p class="update-message">$post[message]</p>
<if condition="is_member_of($bbuserinfo, 6)"><a href="$post[editlink]" name="vB::QuickEdit::$post[postid]">Edit</a></if>
$template_hook[postbit_end]
</li> 
<else />
something else
</if>
Reply With Quote
  #16  
Old 02-14-2009, 05:30 AM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your comment just sparked an idea! The postcount works when its inside of the postbit template, so if i move the stuff from the ADV_DYNA_SHOWENTRY template into the postbit_wrapper, the postcount should work and we would be golden. I'm gona give it a shot now and will post my findings once i've tested it..
Thanks again!
Chris

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

close but no cigar it seems that postbit_wrapper is part of the postbit loop. The download that has no updates doesnt display the updates block, which is what we want, but then the download that has 5 updates displays the updates block, but only outputs one post.

Any ideas?
Reply With Quote
  #17  
Old 02-14-2009, 05:51 AM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My goal has been to completely hide the updates block if no updates are available, but thinking more for consistency sake having the block always there isnt necessarily a bad thing. So now i am trying your suggestion, adding the check to the postbit_legacy template:

<if condition="$post[postcount] == '1'">
<li class="updates">
$template_hook[postbit_start]
$template_hook[postbit_messagearea_start]
<p class="update-date">$post[postdate]</p>
<p class="update-message">$post[message]</p>
<if condition="is_member_of($bbuserinfo, 6)"><a href="$post[editlink]" name="vB::QuickEdit::$post[postid]">Edit</a></if>
$template_hook[postbit_end]
</li>
<else />
<li class="no-updates">
$template_hook[postbit_start]
$template_hook[postbit_messagearea_start]
There are no updates for this template.
$template_hook[postbit_end]
</li>
</if>

Based on the above, you would expect that the updates block will always be there and if update posts exist, they are displayed, else show a message saying that no updates are available.

Unfortunately, what i've ended up with is just the updates heading on the page that doest have any updates (ie, no message saying no updates below the heading) and then on the page that does have updates i have the first update message displaying, but then the no updates messages outputted 3 times where the other updates should be.

I know that probably doesnt make sense, so i've attached two images - one showing the download that doesnt have any posts and one of the download that does have posts.

Thanks,
Chris
Attached Images
File Type: png download-without-updates.png (2.5 KB, 0 views)
File Type: png download-with-updates.png (7.3 KB, 0 views)
Reply With Quote
  #18  
Old 02-14-2009, 05:54 AM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the code again, and studying the output of the postcount variable, i think i know why its outputting the way it is. It looks like the conditional is saying "if postcount is equal to 1", essentially targeting only the post whose post count is 1, ie the first post.

What do you think? Is it possible to tweak the conditional to say if posts exist, else...
Reply With Quote
  #19  
Old 02-14-2009, 10:16 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a bit confused, but can't you just use the adlocation_firstpost template?
Reply With Quote
  #20  
Old 02-14-2009, 12:20 PM
connectr connectr is offline
 
Join Date: Jan 2009
Location: Cape Town, South Africa
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Dismounted,
You'll have to excuse as this is my first vb project and am not yet 100% on par with how everything works. Would you mind elaborating on how you see it working? I recall seeing the adlocation_firspost variable in the postbit, but figured it was just a placeholder for a banner ad after the first post..
Cheers,
Chris
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 04:58 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.04169 seconds
  • Memory Usage 2,295KB
  • 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
  • (1)bbcode_html
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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