vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Personal Stickys (https://vborg.vbsupport.ru/showthread.php?t=102535)

iRO Wiki 03-25-2008 05:38 PM

After fiddling with it, I figured out a way to limit it to X usergroups:

Code:

<if condition="is_member_of($vbulletin->userinfo, 2)">
Just keep adding group ID's after the first, seperated by commas, like so:

Code:

<if condition="is_member_of($vbulletin->userinfo, 2, 6, 32, 14)">

If you put it around the code for sticking/unsticking a thread, only people in those groups will see that link!

Code:


<if condition="is_member_of($vbulletin->userinfo, 2, 6)">
<tr>
                <td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/mysticky.gif" />
                <if condition="in_array($thread['threadid'], $personalstickys)">
                        <a href="showthread.php?$session[sessionurl]do=unpersonalsticky&amp;t=$threadid">$vbphrase[personal_unsticky]</a>
                <else />
                        <a href="showthread.php?$session[sessionurl]do=personalsticky&amp;t=$threadid">$vbphrase[personal_sticky]</a>
                </if>
                </td>
        </tr>
        </if>
</if>


Need to add the first if statement then a </if> at the end.

Keep in mind that if a person you allow to have stickies gets removed from the group, they will still see the stickied threads, they just won't be able to unstick them without using the direct link.

Edit: co-admin brought up a good point, can you still stick from the URL if you knew it, the answer was yes, so I went back to fiddling. The URL's look like this:

showthread.php?do=personalsticky&t=1
showthread.php?do=unpersonalsticky&t=1

And can be called even if you hide the link.

Edit the following plugin: Stick/unstick check

Find:

Code:

if ($_REQUEST['do'] == 'personalsticky' )
replace with:

Code:

if ($_REQUEST['do'] == 'personalsticky' AND is_member_of($vbulletin->userinfo, 2))

Making sure to edit your usergroups.

If you aren't in the defined groups, and try to manually stick a thread, it just takes you to the thread and nothing happens. I'd love it to go to an error message but I have no idea how.

ThE LeAdEr 07-17-2008 09:25 PM

Work in 3.7??

Kaelon 09-02-2008 03:40 PM

Quote:

Originally Posted by ThE LeAdEr (Post 1578015)
Work in 3.7??

For those interested, with the original author's permission, I released an update to this hack for vBulletin 3.7.x:

https://vborg.vbsupport.ru/showthread.php?t=189444


All times are GMT. The time now is 07:33 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.01062 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
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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