vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Board Optimization - Forum Archive List Forum Footer (https://vborg.vbsupport.ru/showthread.php?t=134102)

R-D 03-10-2008 08:43 PM

Quote:

Originally Posted by Boofo (Post 1460380)
@Atakan KOC - Is there any way to add permissions to this so only the links that are viewable to the viewing user are displayed?

Here you go, Boofo. Here's two versions, both tested on 3.6.8.

Both show links based on what the user has permission to see. product-falf-perms-all.xml shows the archive links to all users, while product-falf-perms.xml only shows the links to guests (group 1).

*Both products now also include the photoplog fix*
You'll need to uninstall Atakan KOC's original product before installing either of these.


Basically, for the permissions part, I changed:
Code:

foreach ($vbulletin->forumcache AS $forum)
        {
                $forum_sira[$forum['forumid']] = $forum['forumid'];
        }

to:
Code:

foreach ($vbulletin->forumcache AS $forum)
        {
        $forumpermas = $vbulletin->userinfo['forumpermissions'][$forum['forumid']];
                if (($forumpermas & $vbulletin->bf_ugp_forumpermissions['canview']) OR ($forumpermas & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR ($forumpermas & $vbulletin->bf_ugp_forumpermissions['canviewothers']))
                {

                        $forum_sira[$forum['forumid']] = $forum['forumid'];
                }
        }


Tom_S 03-10-2008 09:20 PM

I haven't looked yet but did you leave in the photoplog fix?

EDIT:
I checked. No you didn't so it won't work for the photoplog issue.

Boofo 03-10-2008 09:33 PM

Quote:

Originally Posted by R-D (Post 1461771)
Here you go, Boofo. Here's two versions, both tested on 3.6.8.

Both show links based on what the user has permission to see. product-falf-perms-all.xml shows the archive links to all users, while product-falf-perms.xml only shows the links to guests (group 1).

You'll need to uninstall Atakan KOC's original product before installing either of these.


Basically, for the permissions part, I changed:
Code:

foreach ($vbulletin->forumcache AS $forum)
    {
        $forum_sira[$forum['forumid']] = $forum['forumid'];
    }

to:
Code:

foreach ($vbulletin->forumcache AS $forum)
    {
    $forumpermas = $vbulletin->userinfo['forumpermissions'][$forum['forumid']];
        if (($forumpermas & $vbulletin->bf_ugp_forumpermissions['canview']) OR ($forumpermas & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR ($forumpermas & $vbulletin->bf_ugp_forumpermissions['canviewothers']))
        {
            $forum_sira[$forum['forumid']] = $forum['forumid'];
        }
    }


Thank you very much. ;)

R-D 03-10-2008 09:55 PM

Quote:

Originally Posted by Tom_S (Post 1461796)
I haven't looked yet but did you leave in the photoplog fix?

EDIT:
I checked. No you didn't so it won't work for the photoplog issue.

The fix has now been added to both products and my post has been edited to reflect this.

Boofo 03-10-2008 10:10 PM

Quote:

Originally Posted by R-D (Post 1461826)
The fix has now been added to both products and my post has been edited to reflect this.

Excellent! I just didn't like the idea of listing forums for people who couldn't see them as then the questions start as to what is in there and why can't they access them. Thanks again. ;)

Tom_S 03-10-2008 10:19 PM

Quote:

Originally Posted by R-D (Post 1461826)
The fix has now been added to both products and my post has been edited to reflect this.

That's because you da man! Thanks! :D

R-D 03-11-2008 02:06 PM

Quote:

Originally Posted by Boofo (Post 1461835)
Excellent! I just didn't like the idea of listing forums for people who couldn't see them as then the questions start as to what is in there and why can't they access them. Thanks again. ;)

No problem, glad I could help. :)


Quote:

Originally Posted by Tom_S (Post 1461845)
That's because you da man! Thanks! :D

I would've put it in sooner if I had realised it was such a simple fix. I don't have photoplog so I kinda skipped your posts... :o :D

Boofo 03-11-2008 06:59 PM

Quote:

Originally Posted by R-D (Post 1462276)
No problem, glad I could help. :)

I took out this code as I couldn't figure out what it was doing in there. The permissions still work fine without it. ;)

Code:

if (is_member_of($vbulletin->userinfo, 1)){

R-D 03-12-2008 12:24 AM

Quote:

Originally Posted by Boofo (Post 1462427)
I took out this code as I couldn't figure out what it was doing in there. The permissions still work fine without it. ;)

Code:

if (is_member_of($vbulletin->userinfo, 1)){

That's there to hide the archive links from registered users. I don't know about your site(s) but mine has a dark black background with yellow links, so they stand out a fair way, and I don't really want regged users going into the archive when it's mainly for search engine bots.

I did upload 2 versions though, one with that, one without, so it's your choice. :)

Boofo 03-12-2008 12:48 AM

Quote:

if (!$vbulletin->userinfo[userid])
{
would have worked to, I suppose. I don't care who uses it as long as they don't see areas they can't use.


All times are GMT. The time now is 09:03 AM.

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.01540 seconds
  • Memory Usage 1,749KB
  • 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
  • (6)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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