Ok, updated my site and it seems to have gone ok...
Some questions...
1. What is _mediaidx.disp.php ?
2. Why has .disp been added to all these things like arcdir etc etc.
3. What's changed that a plugin that worked in the previous beta now causes a major error on the plugins Admin page.
The plugin is _acronym.plugin.php
<?php
/**
* This file implements the Beano's Acronym plugin for b2evolution
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
*
* Beano's Acronym Plugin (v0.1 alpha - 05/09/2006)
* copyright (c)2006 by Steve Ferson (http://www.steveferson.com)
*
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
class acronym_plugin extends Plugin {
var $code = 'b2acro';
var $name = 'Acronyms';
var $priority = 80;
var $version = '1.8';
var $apply_rendering = 'opt-out';
/**
* Acronym search array (regex)
*/
var $search;
/**
* Replace array
*/
var $replace;
/**
* Acronym definitions
*/
var $acronyms;
/**
* Acronym titles / explanations
*/
var $titles;
/**
* Constructor
*/
function acronym_plugin() {
$this->short_desc = T_('Acronym Explanations');
$this->long_desc = T_('This renderer will convert groups of recognised initials (acronyms) in a post into HTML <acronym> elements with appropriate titles.');
/**
* Acronym configuration.
* TODO: Store acronym/title pairs in database table
*/
require dirname(__FILE__).'/acronym_plugin/_conf.php';
}
/**
* Perform rendering
*
* @see Plugin::RenderItemAsHtml()
*/
function RenderItemAsHtml( & $params ) {
if( ! isset( $this->search ) ) { // We haven't prepared the acronyms yet
$this->search = array();
$tempacros = $this->acronyms;
uksort($tempacros, array(&$this, 'orderbylength'));
foreach($tempacros as $acronym => $desc) {
$this->search[] = '/(\b)'. $acronym .'(\b)/';
$this->replace[] = '$1<acronym title="'.$desc.'">'. $acronym .'</acronym>$2';
}
}
// REPLACE: But only in PCDATA, exclude text inside <code> and <pre> elements
$content = & $params['data'];
// Check if data contains <code> or <pre> elements
if( stristr( $content, '<code' ) !== false || stristr( $content, '<pre' ) !== false ) {
// Call ReplaceTagSafe() on everything outside <pre></pre> and <code></code>:
$content = callback_on_non_matching_blocks( $content,
'~<(code|pre)[^>]*>.*?</\1>~is',
array( & $this, 'ReplaceTagSafe' ) );
} else { // If there are no <code> or <pre> elements, it's safe to replace on the whole block of text
$content = $this->ReplaceTagSafe($content);
}
return true;
}
/**
* This callback gets called once after every tags+text chunk
* @return string Text with replaced acronyms
*/
function preg_insert_acronyms_callback( $text ) {
return preg_replace( $this->search, $this->replace, $text );
}
/**
* Replace acronyms outside HTML-tags in the text.
* @uses callback_on_non_matching_blocks()
*/
function ReplaceTagSafe($text) {
return callback_on_non_matching_blocks( $text, '~<[^>]*>~', array(&$this, 'preg_insert_acronyms_callback') );
}
/**
* sorts the acronyms' array by length
* which allows greedy matching
* (ie will not match a 3 letter acronym if it's part of a 4 letter one)
*/
function orderbylength($a, $b) {
if(($diff = strlen($b) - strlen($a)) == 0) {
return strcmp($a, $b);
}
return $diff;
}
}
?>
Cheers
1) From the file :
So I'm guessing it's summat to do with photo blogging
2) I'd guess that the disp in the file names is to make them reflect the fact that they're shown for $disp=foo
3) what's the error?
¥