Hallo,
ich habe ein Problem mit Wordpress.
Hab das bbcode Plugin installed.
Mein Problem ist jetzt, das wenn man einen Link einfügen will, man immer
eingeben muss.
Will aber, das man nur
eingeben muss.
Das ist der Code im Plugin:
Spoiler anzeigen
Code
class BBCode {
// Plugin initialization
function BBCode() {
// This version only supports WP 2.5+ (learn to upgrade please!)
if ( !function_exists('add_shortcode') ) return;
// Register the shortcodes
add_shortcode( 'b' , array(&$this, 'shortcode_bold') );
add_shortcode( 'B' , array(&$this, 'shortcode_bold') );
add_shortcode( 'i' , array(&$this, 'shortcode_italics') );
add_shortcode( 'I' , array(&$this, 'shortcode_italics') );
add_shortcode( 'u' , array(&$this, 'shortcode_underline') );
add_shortcode( 'U' , array(&$this, 'shortcode_underline') );
add_shortcode( 'url' , array(&$this, 'shortcode_url') );
add_shortcode( 'URL' , array(&$this, 'shortcode_url') );
add_shortcode( 'img' , array(&$this, 'shortcode_image') );
add_shortcode( 'IMG' , array(&$this, 'shortcode_image') );
add_shortcode( 'quote' , array(&$this, 'shortcode_quote') );
add_shortcode( 'QUOTE' , array(&$this, 'shortcode_quote') );
}
// No-name attribute fixing
function attributefix( $atts = array() ) {
if ( empty($atts[0]) ) return $atts;
if ( 0 !== preg_match( '#=("|\')(.*?)("|\')#', $atts[0], $match ) )
$atts[0] = $match[2];
return $atts;
}
// Bold shortcode
function shortcode_bold( $atts = array(), $content = NULL ) {
if ( NULL === $content ) return '';
return '<strong>' . do_shortcode( $content ) . '</strong>';
}
// Italics shortcode
function shortcode_italics( $atts = array(), $content = NULL ) {
if ( NULL === $content ) return '';
return '<em>' . do_shortcode( $content ) . '</em>';
}
// Italics shortcode
function shortcode_underline( $atts = array(), $content = NULL ) {
if ( NULL === $content ) return '';
return '<span style="text-decoration:underline">' . do_shortcode( $content ) . '</span>';
}
// Italics shortcode
function shortcode_url( $atts = array(), $content = NULL ) {
$atts = $this->attributefix( $atts );
// [URL="http://www.google.com/"]Google[/URL]
if ( isset($atts[0]) ) {
$url = $atts[0];
$text = $content;
}
// [URL]http://www.google.com/[/URL]
else {
$url = $text = $content;
}
if ( empty($url) ) return '';
if ( empty($text) ) $text = $url;
return '<a href="' . $url . '">' . do_shortcode( $text ) . '</a>';
}
// Italics shortcode
function shortcode_image( $atts = array(), $content = NULL ) {
if ( NULL === $content ) return '';
return '<img src="' . $content . '" alt="" />';
}
// Italics shortcode
function shortcode_quote( $atts = array(), $content = NULL ) {
if ( NULL === $content ) return '';
return '<blockquote>' . do_shortcode( $content ) . '</blockquote>';
}
}
// Start this plugin once all other plugins are fully loaded
add_action( 'plugins_loaded', create_function( '', 'global $BBCode; $BBCode = new BBCode();' ) );
Alles anzeigen
Hat da jemand ne Idee?
Auserdem bräuchte ich noch ne Funtkion, das wenn jemand nur einen Direktlink postet, also z.B. nur
das Wordpress dann
draus macht. Kennt jemand sowas?
EDIT: Das Problem mit dem ist nun gelöst!
Habe aber wieder ein neues ;)
Uns wzar wenn ich habe:
Dann zeigt er mir nachher im Fertigen Beitrag den Link neben dem Bild an statt darunter.
Hat da einer noch eine Idee?
Hab WordpressVersion 3.0.1 und für den BBCODE das Plugin boingball-bbcode
EDIT2:
So nun sind alle Probleme gelöst! Trhead kann geschlossen werden.