vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help with, if condition (https://vborg.vbsupport.ru/showthread.php?t=249700)

DamasGate 08-31-2010 10:37 PM

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

Guest190829 09-01-2010 09:49 PM

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.

DamasGate 09-01-2010 10:27 PM

Oh, i do not know how to do that.

Any one can help with this ?

Thank you

BirdOPrey5 09-02-2010 02:23 AM

Quote:

Originally Posted by Danny.VBT (Post 2092612)
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.

DamasGate 09-02-2010 01:34 PM

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

kh99 09-02-2010 01:49 PM

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>


BirdOPrey5 09-02-2010 03:07 PM

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

$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?

DamasGate 09-02-2010 03:28 PM

Quote:

Originally Posted by kh99 (Post 2092807)
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

kh99 09-02-2010 11:18 PM

Quote:

Originally Posted by DamasGate (Post 2092858)
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?

DamasGate 09-02-2010 11:35 PM

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


All times are GMT. The time now is 10:52 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.01526 seconds
  • Memory Usage 1,744KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)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