[phpBB Debug] PHP Notice: in file /viewtopic.php on line 988: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 988: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead
CactiUsers.org - View topic - automatic realms insertion


Cactiusers.org


It is currently Sat Feb 04, 2012 2:46 am




Post new topic Reply to topic  [ 3 posts ] 
 automatic realms insertion 
Author Message
User

Joined: Mon Dec 19, 2005 3:44 pm
Posts: 170
Post automatic realms insertion
Hello

for some years some people were asking for creating/inserting plugin without searching a own realms, and we have seen several problem of duplicate realms.

Now I have inserted in my plugins a function to calculate a new realm.

Could you add a such function in the PA. ? (yours or mine, it does not matter)

here my code: inserted in setup.php.
Code:
define("pluginREALMPLUGINproposition", "70");

function configmanager_search_realms($therealmtitle,$therealmproposition) {
  global $user_auth_realms, $user_auth_realm_filenames;

  $search_realm=$therealmproposition;
  if (isset($user_auth_realms)) {
     $firstnotin=$therealmproposition;
     while (array_key_exists($firstnotin,$user_auth_realms)) {
           $firstnotin = $firstnotin + 1;
     }
     if (array_key_exists($therealmproposition,$user_auth_realms) && ($user_auth_realms[$therealmproposition]==$therealmtitle)) {
           $search_realm=$therealmproposition;
     } else {
       $search_realm=$firstnotin;
     }
  }
  return $search_realm;
}

.....
function configmanager_config_arrays () {
...
$newrealm=configmanager_search_realms($myrealmtitle,pluginREALMPLUGINproposition);
   $user_auth_realms[$newrealm]=$myrealmtitle;



Mon Aug 30, 2010 6:19 pm
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post Re: automatic realms insertion
If you use the API functions in your plugin, then there is already automatic realms. Its been there for a few years.

For instance
Code:
api_plugin_register_realm('thold', 'thold_add.php,thold.php,listthold.php', 'Configure Thresholds', 1);


Tue Aug 31, 2010 9:34 am
User

Joined: Mon Dec 19, 2005 3:44 pm
Posts: 170
Post Re: automatic realms insertion
jimmy wrote:
If you use the API functions in your plugin, then there is already automatic realms. Its been there for a few years.

For instance
Code:
api_plugin_register_realm('thold', 'thold_add.php,thold.php,listthold.php', 'Configure Thresholds', 1);


super ... I will try it.


Wed Sep 01, 2010 11:56 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: