[geeklog-cvs] geeklog-1.3/system lib-plugins.php,1.32,1.33

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Sun Aug 29 00:23:09 EDT 2004


Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv579/system

Modified Files:
	lib-plugins.php 
Log Message:
Added new Plugin API to support autolinks. This will also other components to autolink between each other. When posting in the forum you could enter the following tag to create the HTML link to a story: [story:20040101093000103 here]. 

Index: lib-plugins.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-plugins.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** lib-plugins.php	26 Aug 2004 03:31:30 -0000	1.32
--- lib-plugins.php	29 Aug 2004 04:23:05 -0000	1.33
***************
*** 802,805 ****
--- 802,836 ----
  
  /**
+ * This function will allow plugins to support the use of custom autolinks
+ * in other site content. Plugins can now use this API when saving content
+ * and have the content checked for any autolinks before saving.
+ * The autolink would be like:  [story:20040101093000103 here]
+ *
+ * @param   string   $content   Content that should be parsed for autolinks
+ *
+ */
+ function PLG_replacetags($content) {
+     global $_TABLES;
+ 
+     $result = DB_query("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1");
+     $nrows = DB_numRows($result);
+     for ($i = 1; $i <= $nrows; $i++) {
+         $A = DB_fetchArray($result);
+         $function = 'plugin_replacetags_' . $A['pi_name'];
+         if (function_exists($function)) {
+             $content = $function($content);
+         }
+     }
+     /* Now check if GL Core Story API exists */
+     if (function_exists('plugin_replacetags_story')) {
+         $content = plugin_replacetags_story($content);
+     }
+ 
+     return $content;
+ 
+ }
+ 
+ 
+ /**
  * Prepare a list of all plugins that support feeds. To do this, we re-use
  * plugin_getfeednames_<plugin name> and only keep the names of those plugins




More information about the geeklog-cvs mailing list