The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to hide this?
Hello guys,
Maybe someone can help me... I have this code: PHP Code:
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. |
#2
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
Depending on the hook you may need to make $vbulletin global if you aren't using it already. Doesn't hurt to put this line at the top of the plugin or php code if you haven't already: PHP Code:
|
#3
|
|||
|
|||
hi mate, thank you for your reply
I tried your code but didnt work, It shows this errors: Code:
Parse error: syntax error, unexpected $end in /home/vns/public_html/forum/includes/class_postbit.php(340) : eval()'d code on line 67 PHP Code:
|
#4
|
||||
|
||||
Quote:
PHP Code:
|
#5
|
|||
|
|||
Thank you again for your reply BirdOPrey5
I think that the code is correct now, but is not what Im looking for... my english is a little poor, and maybe you didnt understood well my request hehe Explaining again: That plugin code that I posted is from this mod: https://vborg.vbsupport.ru/showthread.php?t=235619 The mod adds a custom link to the postbit, the default is user album link, but I changed to appear the topics that user started in two specific forums. By default, the link appears to ALL members, even the ones that dont have any topics created in those two forums. For example, below of the avatar will appear "My topics" link. My idea is to show that link only to the users that have topics created in those two forums. If the user dont have any topics created in those two forums, the link dont appear. Got the idea? I give the usergroup idea, because I add my users to a specific group If they created a topic in those two forums. So If they belong to that group, is because they started a topic in one of those two forums. Sorry for the trouble... Any idea how to make this like I want? |
#6
|
||||
|
||||
If you add people to the usergroup the code I have should work. You need to change the number 2 in the is_member_of function to the usergroupid of the usergroup you add members to. 2 was just an example, it shows to all registered users- I would have no idea what the real usergroupid is on your forum.
|
#7
|
|||
|
|||
ohhh damn... I have read my explanation and I think that I explained wrong again :/
very sorry mate... I know that your code works fine! I tried with usergroupid 6 that is administrators and only admins see the link... But is not what I want lol. Let me try explain again: I want to show the link to everyone! but If the user belongs to specific usergroups, the link will appear (to everyone), If the user dont belongs to that specific usergroups, the link will not appear to anyone. For example, please check: http://screensnapr.com/e/g8ii2H.jpg In link above, only the user Ruimaisluisa belongs to the usergroup that I want. And Green_Boy dont belongs. But as you can see, the link that says "As minhas fotos" appears to both. I want to appear only to user Ruimaisluisa, for example |
#8
|
|||
|
|||
I think this does it:
Product: vBulletin Hook location: showthread_postbit_create Title: Find Qualified Members Exectuion order: 5 Plugin PHP code: PHP Code:
Put in YOUR user id in the first line and YOUR forumids. When everything is working get rid of the stuff at the top and bottom so everyone can see it. Now you can use a template conditional: <vb:if condition="$thread_count > 0"> ................. </vb:if> I think this will work. |
#9
|
||||
|
||||
Ahhh...
Try sing $post instead of $vbulletin->userinfo in the is_member_of() function. edited. |
#10
|
|||
|
|||
Thank you for your reply nerbert, and for trying to help me
I created an plugin like you said: PHP Code:
PHP Code:
PHP Code:
Quote:
--------------- Added [DATE]1313332981[/DATE] at [TIME]1313332981[/TIME] --------------- BirdOPrey5, thank you for keep helping me I did what you said, but didnt work... the link disappeared in all users. What I added: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|