Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Permissions for Sections Article
  • Posted: 05.06.2007, 06:17
     
    ilivetoshop
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    17.06.07
    Posts:
    175
    I am wondering if it is possible to set up a permission so that unregistered people can view the link of the title to the artilce and then when they click on the link have a notice that says you must register to view this article.

    see my site http://bettermyhealthtoday.com/index.php?name=Sections&req=listarticles&secid=3

    I would like people to be able to get to this list of articles but have to register in order to click on the link. Can anyone help???

    --
    http://www.bettermyhealthtoday.com
  • Posted: 05.06.2007, 20:35
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    I have never used sections before, but in permissions

    Unregistered | Sections:: | Article:: | none

    - Igor



    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 06.06.2007, 06:50
     
    ilivetoshop
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    17.06.07
    Posts:
    175
    It still allows people to click on it...here are my permissions

    Admins .* .* Admin
    2 All groups Menublock:: Main Menu:Administration: None
    3 Users .* .* Comment
    4 Unregistered Menublock:: Main Menu:(My Account|Logout|Submit News): None
    5 Unregistered Sections:: Article:: None
    6 Unregistered .* .* Read

    http://www.bettermyhealtoday.com


    --
    http://www.bettermyhealthtoday.com
  • Posted: 06.06.2007, 15:04
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    How about this:

    Unregistered | Sections::Article | .* | None


    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 11.06.2007, 00:46
     
    ilivetoshop
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    17.06.07
    Posts:
    175
    Nope. That completely takes away the links to the artile so then it looks like there are no artilces in that section at all.

    I need to have the link to the title there so it intices someone to click on the link and read the article. Then once they want to read it the site forces them to register.

    You know what i mean?

    --
    http://www.bettermyhealthtoday.com
  • Posted: 11.06.2007, 16:05
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    Yes, I do... unfortunately I have no solution with the permissions system.

    If it were me, I'd look in the source files and use the

    Code

    if (pnUserLoggedIn()) { }

    in the function viewarticle()

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 18.06.2007, 00:21
     
    ilivetoshop
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    17.06.07
    Posts:
    175
    OK, I did this and it didn't work. Did I do it right?

    function viewarticle()
    {
    if (pnUserLoggedIn()) { }
    list($artid,
    $page,
    $allpages) = pnVarCleanFromInput('artid',
    'page',
    'allpages');

    --
    http://www.bettermyhealthtoday.com
  • Posted: 18.06.2007, 01:35
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    Not exactly, however, since I don't have experience with the sections module, I suggest you first make a backup of the file [you never know], but how about following code:

    Code

    function viewarticle()
    {
      if (pnUserLoggedIn()) {
             list($artid,
             $page,
             $allpages) = pnVarCleanFromInput('artid',
             'page',
             'allpages');
      } else {
                pnRedirect('user.php');
      }
    }


    Or if someone knows the perm order for sections... feel free to jump in icon_smile

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula