vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forum ID; if conditions, help requested! (https://vborg.vbsupport.ru/showthread.php?t=250814)

OGZ.Korea 09-19-2010 04:28 PM

Forum ID; if conditions, help requested!
 
Hello, I have a problem.

If conditional are very hard for me to understand and to make especially customized if conditionals.

What I'm trying to do is only show the total amount of posts that a member posted in a specific forum / forum id.

Here's my code:
<br />Off Posts: <if condition="in_array($forum['forumid'], array(2,3,4))">$post[posts]</if>

2,3,4 are my forum id's and $post[posts] only show my amount of posts in every forum id not in the specific ones I specified in the if conditional tag.

Please help me, thank you for your time.

Best Regards,
OGZ.Korea

Lynne 09-19-2010 05:14 PM

You would need to write a plugin to do a query to get the number of posts only in those forums. You can't do it with just a variable.

OGZ.Korea 09-20-2010 10:17 PM

Quote:

Originally Posted by Lynne (Post 2100599)
You would need to write a plugin to do a query to get the number of posts only in those forums. You can't do it with just a variable.

How can I do that? Is it possible for you to create one for me.
If so, I can pay via PayPal or you can do it for free, and your help will be greatly appreciated :]

Lynne 09-20-2010 10:55 PM

If you wish to pay someone to write this for you, you may post in the Requests For Paid Services forum.

Alfa1 09-21-2010 10:31 PM

Where do you want to display this?

Here is what I added to the template memberinfo_block_statistics to add a link to the posts in my wiki forum:
Code:

        <fieldset class="statistics_group">
        <legend>Wiki entries</legend>
        <ul class="list_no_decoration">
            <li><a  href="search.php?$session[sessionurl]do=finduser&amp;u=$userinfo[userid]&amp;starteronly=1&amp;forumchoice[0]=176"  rel="nofollow"><phrase 1="$prepared[username]">Find all wiki's  written by $prepared[username]</phrase></a></li>

As you see it doesn't have any way to display the number of posts made by the member, because there is no conditional for this. This code only shows the layout and the search for a members posts in a specified forum. If you want to use this, then replace 176 by the forumID of your forum, and edit the description accordingly.
To add a conditional, you would need to add a plugin. Review the template memberinfo_block_statistics to see what it should do.

Basically what you need is to create the conditional $prepared[posts_in_forum_x]
If you have that, you can just reuse the code thats already in the template memberinfo_block_statistics, but add that conditional.

I hope that helps somewhat. Sorry for providing the complete answer.

This should be a simple thing for a coder to prepare.

OGZ.Korea 09-22-2010 07:07 PM

Quote:

Originally Posted by Alfa1 (Post 2101628)
Where do you want to display this?

In the postbit legend, under $posts[posts]

OGZ.Korea 10-05-2010 09:21 PM

bump

BirdOPrey5 10-09-2010 11:13 PM

Why are you bumping this? You got your answer- you need a plugin- if you're willing to pay make a request in the paid requests forum as Lynne pointed out. You will NEVER be able to do this with just a conditional.


All times are GMT. The time now is 01:56 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.01027 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete