Ahoy. ich hab mir das grad angeschaut, aber das öffnen des links geschieht nicht über html, sondern wird von flash ausgelöst. ich hab grad nachgeschaut, ob man das verhalten irgendwie über flash-attribute verändern kann, bin aber spontan nicht fündig geworden. insofern bleibt die einzige möglichkeit das ganze objekt-teil in nen link zu hüllen. Ich hab das eben mit ner statschen version von dem html hier probiert, und damit ging das. ich hoffe ich hab das plugin richtig verändert, kanns ja leider nicht ausprobieren.
|
PHP-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
<?php
require_once(WCF_DIR.'lib/data/message/bbcode/BBCodeParser.class.php');
require_once(WCF_DIR.'lib/data/message/bbcode/BBCode.class.php');
/**
* BBCode for [deviantart] Tag
*
* @author Torben Brodt
* @package com.woltlab.wcf.data.message.bbcode.deviantart
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>
*/
class DeviantArtBBCode implements BBCode {
protected $code = '<a href="%d" target="_blank"><object width="%d" height="%d"><param name="movie" value="http://backend.deviantart.com/embed/view.swf" /><param name="flashvars" value="id=%d" /><param name="allowScriptAccess" value="always" /><embed src="http://backend.deviantart.com/embed/view.swf" type="application/x-shockwave-flash" width="%d" height="%d" flashvars="id=%d" allowscriptaccess="always"></embed></object></a>';
protected $width=450, $height=450;
/**
* @see BBCode::getParsedTag()
*/
public function getParsedTag($openingTag, $content, $closingTag, BBCodeParser $parser) {
if(is_numeric($content)) {
// id as input
$id = intval($content);
} else if(strpos($content, 'http://') == 0 && preg_match('/-(\d+)$/', $content, $hits)){
// url as input
$id = intval($hits[1]);
} else if(strpos($content, '<object') !== false){
// html as input
if(preg_match('/^<object width\="(\d+)" height\="(\d+)">.+value\="id\=(\d+)/', $content, $hits)) {
$width = intval($hits[1]);
$height = intval($hits[2]);
$id = intval($hits[3]);
}
}
if(!isset($id)) return;
// overwrite width/height from attribute
if(isset($openingTag['attributes'][0])) {
list($width,$height) = explode("x", $openingTag['attributes'][0]);
}
$width = isset($width) ? $width : $this->width;
$height = isset($height) ? $height : $this->height;
$code = sprintf($this->code, $content, $width, $height, $id, $width, $height, $id);
if ($parser->getOutputType() == 'text/html') {
return $code;
}
else if ($parser->getOutputType() == 'text/plain') {
return $content;
}
}
}
?>
|
Übrigens: als ich mir eben den quelltext angeschaut hab, ist mir unheimlich viel kram aufgefallen der da eigentlich garnicht sein müsste. z.B. kommt vor jedem einzelnen post n riesiger css-block mit den gleichen regeln. Wenn die templates im wbb3 noch so heissen wie im wbb2, guck mal im post-view-template.