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 08-31-2010, 10:37 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with, if condition

Hello,

In the postbit template.

I need to show code at the end of every user post but only once per page of thread.

Its like "show an user's signature only once per page hack"



How to do that ?

Thank you
Reply With Quote
  #2  
Old 09-01-2010, 09:49 PM
Guest190829
Guest
 
Posts: n/a
Default

This is going to take a little more than a simple if conditional; you'll need to create some cache array that stores whether or not a specific user has displayed a signature already.
Reply With Quote
  #3  
Old 09-01-2010, 10:27 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, i do not know how to do that.

Any one can help with this ?

Thank you
Reply With Quote
  #4  
Old 09-02-2010, 02:23 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Danny.VBT View Post
This is going to take a little more than a simple if conditional; you'll need to create some cache array that stores whether or not a specific user has displayed a signature already.
You know thought this too but how does this mod do it?
https://vborg.vbsupport.ru/showthread.php?t=139689

It's just template conditionals and manages to show the sig only once per page???

I read the code but can't figure it out- it doesn't even look like it should work.
Reply With Quote
  #5  
Old 09-02-2010, 01:34 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Explanation:

I install a hack, "show user last 5 threads above his signature".

If user has more than post on the same thread, Show only one time his last 5 threads above his signature.

Like this:
<if condition=" THIS IS THE FIRST USER REPLY ON THE THREAD

show user last 5 threads above his signature

<if condition=" THIS IS THE The second, third, or fourth REPLY ON THE THREAD

DO NOT
show user last 5 threads above his signature



I hope that is Clare
Reply With Quote
  #6  
Old 09-02-2010, 01:49 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good find by BirdOfPrey, I wouldn't have thought to do that but it works because an assignment has a value and can be put in a conditional, so you can create an array like Danny mentioned without needing a plugin.

Modifying the mod that BirdOfPrey found, I think something like this should work:

Code:
<if condition="!$vboptions['shownlinks'][$post[userid]] AND $vboptions['shownlinks'][$post[userid]] = true">

// Show user's links

</if>
Reply With Quote
  #7  
Old 09-02-2010, 03:07 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kh99 - could you walk be through the logic of this- I just don't get it

$post[userid] is just a number, right? so it's like

!$vboptions['shownlinks'][999] AND $vboptions['shownlinks'][999] = true

Maybe I'm not getting how $vboptions['shownlinks'] works?
Reply With Quote
  #8  
Old 09-02-2010, 03:28 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Good find by BirdOfPrey, I wouldn't have thought to do that but it works because an assignment has a value and can be put in a conditional, so you can create an array like Danny mentioned without needing a plugin.

Modifying the mod that BirdOfPrey found, I think something like this should work:

Code:
<if !$vboptions['shownlinks'][$post[userid]] AND $vboptions['shownlinks'][$post[userid]] = true">

// Show user's links

</if>

WOW, Thats work greatttttttttttttttt

But only one thing now

If the user did not have any threads its show empty links box.

Is there any way to hide the box when user did not have any threads ?

Like this:
<if condition="USER DID NOT HAVE ANY THREADS"
DO NOT SHOW ANYTHING
</if>


I really very appreciate your patience and cooperation.
Many many many Thanks
Reply With Quote
  #9  
Old 09-02-2010, 11:18 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DamasGate View Post
Is there any way to hide the box when user did not have any threads ?

Like this:
<if condition="USER DID NOT HAVE ANY THREADS"
DO NOT SHOW ANYTHING
</if>
What code are you using to show the links?
Reply With Quote
  #10  
Old 09-02-2010, 11:35 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Helo,

I use this code

PHP Code:
        <form method="POST">
          <
fieldset style="padding: 2">
            <
legend
              
My Last 5 Threads
              
            
</legend>
            <
font face="tahoma" size="1">$favo
            
</font>
            </
fieldset>
        </
form
Thanks for help
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:24 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.14514 seconds
  • Memory Usage 2,264KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (3)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
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (9)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete