Welcome to Geeklog Thursday, December 02 2021 @ 04:24 am EST

Geeklog Forums

Is it possible for a block to appear if a user has access to a certain feature?


Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
I am working on a plugin with several different sections in it .. Would make the appearance of the page a lot nicer if a block could appear if a certain feature were present...

Anyone done anything like this before?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
The really simple approach: When a PHP block returns an empty string, it's not displayed.

For the more complex approach, there's also a plugin API function, which the forum uses here to display that Forum Menu block on the left, btw.

bye, Dirk
 Quote

Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
Whats the chance that the API function has some documentaion around it? The closest I could find digging through functions.inc in the forum plugin was the phpblock_..() function ...

Thanks,
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Check lib-plugins.php

bye, Dirk
 Quote

All times are EST. The time is now 04:24 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content