source: extensions/NBM_Subscriber/include/functions.inc.php

Last change on this file was 6436, checked in by Eric, 14 years ago

[NBM_Subscriber]

  • Initial SVN add. This plugin will allow registered users to subscribe or unsubscribe themselves to the Notification By Mail (aka NBM).
  • Technical goals: Add radio options on profile.tpl page that shows the NBM subscription status and allows to change it.
  • Property svn:eol-style set to LF
File size: 1.3 KB
Line 
1<?php
2/* Function called from UAM_admin.php and main.inc.php to get the plugin version and name */
3function NBMSInfos($dir)
4{
5  $path = $dir;
6
7  $plg_data = implode( '', file($path.'main.inc.php') );
8  if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
9  {
10    $plugin['name'] = trim( $val[1] );
11  }
12  if (preg_match("|Version: (.*)|", $plg_data, $val))
13  {
14    $plugin['version'] = trim($val[1]);
15  }
16  if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
17  {
18    $plugin['uri'] = trim($val[1]);
19  }
20  if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
21  {
22    $plugin['description'] = trim($desc);
23  }
24  elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
25  {
26    $plugin['description'] = trim($val[1]);
27  }
28  if ( preg_match("|Author: (.*)|", $plg_data, $val) )
29  {
30    $plugin['author'] = trim($val[1]);
31  }
32  if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
33  {
34    $plugin['author uri'] = trim($val[1]);
35  }
36  if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
37  {
38    list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
39    if (is_numeric($extension)) $plugin['extension'] = $extension;
40  }
41// IMPORTANT SECURITY !
42  $plugin = array_map('htmlspecialchars', $plugin);
43
44  return $plugin ;
45}
46?>
Note: See TracBrowser for help on using the repository browser.