'I need a Variable from the MyBB-Forum

my previous attempts to declare a variable always failed.

Task: In the table mybb->users there is the column verified. This column has either a "1 or a "0" (or nothing). How can/must be proceeded in order to use e.g. a PlugIn like the following:

($plugins->add_hook('global_start', 'verify_user');
function verify_user() {
global $db, $mybb, $templates, $templatelist, $lang, $current_page, $user; // add useful variables
if (!$db->field_exists('verified', 'users')) {
      return true;
   }
if ($user ['verified'] == 1 {
 $doing = 'do something';
} else { 
 $doing = 'do nothing';
}

define the $doing variable so that it can be used anywhere (in PHP files and/or templates). The above solution does not work.

Unfortunately, the above solution does not work (yet). What am I doing wrong?

PHP is completely new territory for me regarding plugins and variables.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source