WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 patch for multi-group (WB2.7rc2)
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 patch for multi-group (WB2.7rc2)  (Read 4806 times)

doekia

  • Guest
show_menu2 patch for multi-group (WB2.7rc2)
« on: March 31, 2008, 03:28:24 PM »
Hi,

Since the WB2.7RC2 supports - ich - multi-groups here is the patch required to have the show_menu2 to adopt the correct behaviour when a page is marked private for a group and the user group list matches:

Quote from: 'WB2.7RC2-show_menu2-include-php.patch'
--- /home/doekia/WebsiteBaker/wb2.7rc2/wb/modules/show_menu2/include.php    2007-09-06 22:15:28.000000000 +0200
+++ include.php    2008-03-31 15:04:39.000000000 +0200
@@ -485,8 +485,8 @@
         // get this once for performance. We really should be calling only need to
         // call $wb->get_group_id() but that outputs a warning notice if the
         // groupid isn't set in the session, so we check it first here.
-        $currGroup = array_key_exists('GROUP_ID', $_SESSION) ?
-            ','.$wb->get_group_id().',' : 'NOGROUP';

+        $currGroups = array_key_exists('GROUP_ID', $_SESSION) ?
+            $wb->get_groups_id() : array('NOGROUP');

         
         // we request all matching rows from the database for the menu that we
         // are about to create it is cheaper for us to get everything we need
@@ -506,7 +506,7 @@
                 // following limit to the SQL query above:
                 //  (visibility <> "private" OR $wb->get_group_id() IN viewing_groups)
                 if ($page['visibility'] == 'private'
-                    && false === strstr(",{$page['viewing_groups']},", $currGroup))
+                    && count(array_intersect($currGroups,explode(',',$page['viewing_groups']))) == 0 )
                 {
                     continue;
                 }


Hope this helps.
Logged

Offline DGEC

  • Posts: 388
  • Gender: Male
    • EbelTech homepage
Re: show_menu2 patch for multi-group (WB2.7rc2)
« Reply #1 on: March 31, 2008, 06:03:02 PM »
Ah, I wonder if this - partially - explains my menus exploding.

Despite installing in a new setup, at least one of my production sites is messed up, including the menu. I'm not sure if the GENERIC template uses sm2, but regardless, a separate install shouldn't mess up existing ones.
Logged

doc

  • Guest
Re: show_menu2 patch for multi-group (WB2.7rc2)
« Reply #2 on: March 31, 2008, 06:07:12 PM »
Hello DGEG,

as far as I know, the Generic templates uses its own menu sysmtem, not the ones implemented with WB (show_menu) or the external show_menu2(). Can you please switch to another template and check if yours sites still gets messed-up? For example simply switch all three sites to the WB template round and test again.

Regards Christian
Logged

bsp4750

  • Guest
Re: show_menu2 patch for multi-group (WB2.7rc2)
« Reply #3 on: August 04, 2008, 12:16:49 AM »
i also have a problem with private pages dosent get displayed when loggin in.
But how do i apply this pathc ??? hop someone can help.

/BSP4750


Never mind i figured it out (removed the lines marked - and insert the lines mark + , and reloaded the modules)
And it works =)
« Last Edit: August 04, 2008, 12:34:14 AM by bsp4750-denmark »
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 patch for multi-group (WB2.7rc2)
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2