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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2011, 11:19 AM
Divvy Divvy is offline
 
Join Date: Nov 2008
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to hide this?

Hello guys,

Maybe someone can help me...

I have this code:
PHP Code:
$template_hook['postbit_userinfo_right_after_posts'] .= '<div style="clear:both;" class="left"><a target="_blank" href="'.$mylink.''.$usernumber.'">'.$mylinktitle.'</a></div>'
That shows a link at postbit with all topics from the user at a two specific forums.

I need that:
- the link only shows when the user have threads at least in one of that two forums.
- If not, the link doesn't appear.

It is possible? Please?

Or else, I had another idea...
The links only appear If the user belongs to a specific group.
Reply With Quote
  #2  
Old 08-13-2011, 03:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You didn't post the full code. We would need to see the whole thing in order to suggest how to modify it to get what you want.
Reply With Quote
  #3  
Old 08-13-2011, 03:19 PM
Divvy Divvy is offline
 
Join Date: Nov 2008
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for helping me Lynne

Here is full plugin code:
PHP Code:
if ($vbulletin->options['ecpl_Online'] == 1)
 {
 
$mylink $vbulletin->options['ecpl_link'];
 
$mylinktitle $vbulletin->options['ecpl_link_title'];
 if (
$vbulletin->options['ecpl_unique_number'])
   {
    
$usernumber ''.$post[userid].'';
   }
 else
   {
    
$usernumber '';
   }

 
$template_hook['postbit_userinfo_right_after_posts'] .= '<div style="clear:both;" class="left"><a target="_blank" href="'.$mylink.''.$usernumber.'">'.$mylinktitle.'</a></div>';
 } 
Reply With Quote
  #4  
Old 08-13-2011, 04:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, nowhere in that code do you check for threads at all. If you put a query in there that checks to see if the user has any posts (or is it only starting threads?), then that is going to add one query per post on the page (20 extra queries?). Is that an issue for you?
Reply With Quote
  #5  
Old 08-13-2011, 09:18 PM
Divvy Divvy is offline
 
Join Date: Nov 2008
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello Lynne, thank you for your reply!

hmmm, 20 extra queries is too many no?
but ok, I can try to see how the server handles.

can you help me?
and is starting threads only.

Thank you!
Reply With Quote
  #6  
Old 08-14-2011, 01:56 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just write a query that looks at the 'thread' table and counts how many times the $post[userid] = thread.postuserid. Then, use the count in a condition around the template_hook code (if $variable >= 1, then.....)
Reply With Quote
  #7  
Old 08-14-2011, 11:06 AM
Divvy Divvy is offline
 
Join Date: Nov 2008
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Lynne, thank you for your reply, but I dont have any knowledge to write a query.
Can you help me?
Reply With Quote
  #8  
Old 08-14-2011, 04:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, I'm a trial and error query writer which is why I do not like writing queries for people - they never work the first time. (And yes, I have killed my site a few times because of this!)
Reply With Quote
  #9  
Old 08-15-2011, 11:17 PM
Divvy Divvy is offline
 
Join Date: Nov 2008
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Lynne,

I already have this working
BirdOPrey5 has helped me:
https://vborg.vbsupport.ru/showthread.php?t=268443

Thank you anyway for your help mate!
Reply With Quote
  #10  
Old 08-15-2011, 11:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it working!
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 12:36 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.06220 seconds
  • Memory Usage 2,255KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete