Avatar

Disable image/link posting for unregistered user? (Design/Themes)

by Micha ⌂, Saturday, February 16, 2019, 10:05 (1899 days ago) @ AlmostAnonymous

Hello,

I'm prepared to make the changes to the code myself.

The posting is parsed by the BBCodeParser-Class using the function html_format, here and here. A possible modification of the html_format may be the following, which adds an additional argument:

function html_format($string, $userType) {
//...
}

Dependent on the argument $userType you can enanble/disable the parser, e.g,

function html_format($string, $userType) {
//...
if($settings['bbcode_img']==1 && $userType > 0) {
  //...
}
}

If you changed the signature of the function, you have to modify the function all. Instead of using html_format($txt) you should use

html_format($txt, isset($_SESSION[$settings['session_prefix'] . 'user_type']) ? $_SESSION[$settings['session_prefix'] . 'user_type'] : -1)

in posting.inc.php.

Beside the adjusted php sources, you have to modify the SMARTY code, to restrict the buttons.


/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


Complete thread:

 RSS Feed of thread