Zeilen umbruch bei WBB 2.3.6 ? |
Highlander1206
Mitglied
Dabei seit: 08.03.09
Beiträge: 20
Forenversion: 2.3
|
|
Dies ist eine vorgefertigte Schablone.
Bitte fülle soviel aus, wie dir nur Möglich ist, du kannst auch gerne noch mehr Angaben machen.
Problembeschreibung:
Hallo Leute
Ich habe Folgendes Problem versuche einen Linkumwandler eizubauen für solche Links :
ajfsp://file|soundeffects.rar|4425e8a152495106707c41c4415fb293|218737267/
Die Links sind anscheinend zu lang beim Posten und das soll am Zeilen umbruch im WBB 2.3.6 liegen wie kann ich das ändern das kein Zeilen umbruch stadtfindet ? Beim erstellen eines Beitrags ?
Bzw ich die Zeichen erhöhen kann so das es ausreicht.
So sollte er aussehen :
soundeffects.rar(208,60MB)
MfG Highlander
|
|
07.04.09 12:53 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Bräke
Mitglied
Dabei seit: 01.01.04
Beiträge: 8.189
|
|
Nicht genau getestet.
acp/lib/class_parse.php
code: |
1:
|
function formaturl($url, $title = '', $maxwidth = 60, $width1 = 40, $width2 = -15) { |
|
$maxwidth = DEN Wert mal höher stellen.
|
|
07.04.09 13:09 |
Finden
Als Freund hinzufügen
|
|
Highlander1206
Mitglied
Dabei seit: 08.03.09
Beiträge: 20
Forenversion: 2.3
Themenstarter
|
|
Geht leider nicht
Habe folgendes versucht in der class_parse :
// ajfsp umwandlung-start
function ajfsp($name, $hash, $size) {
$mbsize = number_format(round(($size / 1024) / 1024, 2), 2, ',', '.');
return '<a href="ajfsp://file|'.$name.'|'.$hash.'|'.$size.'/">'.$name.'</a> ('.$mbsize.' MB)';
}
// ajfsp umwandlung-ende
function prepareimages() {
global $allowdynimg;
if ($allowdynimg == 1) $this->imgsearch = "/\[img]([^\"]+)\[\/img\]/siU";
else $this->imgsearch = "/\[img]([^\"\?\&]+\.(gif|jpg|jpeg|bmp|png))\[\/img\]/siU";
if ($this->showimages == 1) $this->imgreplace = "<img src=\"\\1\" alt=\"\" border=\"0\" class=\"resizeImage\" />";
else $this->imgreplace = "<a href=\"\\1\" target=\"_blank\">\\1</a>";
if ($allowdynimg == 1) $this->imgsearch2 = "/\[img]([^\"]+)\[\/img\]/esiU";
else $this->imgsearch2 = "/\[img]([^\"\?\&]+\.(gif|jpg|jpeg|bmp|png))\[\/img\]/esiU";
$this->imgreplace2 = "'$this->breakChar[img]$this->breakChar' . \$this->insertBreakChar('\\1') . '$this->breakChar[/img]$this->breakChar'";
}
function censor($post) {
if (count($this->censorsearch) == 0 || count($this->censorreplace) == 0) {
reset($this->censorwords);
while (list($key, $censor) = each($this->censorwords)) {
$censor = wbb_trim($censor);
if (!$censor) continue;
if (preg_match("/\{([^=]+)=([^=]*)\}/si", $censor, $exp)) {
$this->censorsearch[] = "/(^|\s|\]|>|\")(".$this->preg_quote($exp[1]).")(([,\.]{1}[\s[\"<$]+)|\s|\[
|\"|<|$)/i";
$this->censorreplace[] = "\\1".$exp[2]."\\3";
}
elseif (preg_match("/\{([^=]+)\}/si", $censor, $exp)) {
$this->censorsearch[] = "/(^|\s|\]|>|\")(".$this->preg_quote($exp[1]).")(([,\.]{1}[\s[\"<$]+)|\s|\[
|\"|<|$)/i";
$this->censorreplace[] = "\\1".str_repeat($this->censorcover, wbb_strlen($exp[1]))."\\3";
}
elseif (preg_match("/([^=]+)=([^=]*)/si", $censor, $exp)) {
$this->censorsearch[] = "/".$this->preg_quote($exp[1])."/i";
$this->censorreplace[] = $exp[2];
}
else {
$this->censorsearch[] = "/".$this->preg_quote($censor)."/i";
$this->censorreplace[] = str_repeat($this->censorcover, wbb_strlen($censor));
}
}
}
if (count($this->censorsearch) > 0 && count($this->censorreplace) > 0) return preg_replace($this->censorsearch, $this->censorreplace, $post);
else return $post;
}
function doparse($post, $allowsmilies, $allowhtml, $allowbbcode, $allowimages) {
// censorship
if ($this->docensor == 1) $post = $this->censor($post);
// cache code
if ($this->usecode == 1 && $allowbbcode == 1) {
$this->tempsave['php'] = array();
$this->tempsave['code'] = array();
$this->index['php'] = -1;
$this->index['code'] = -1;
$post = preg_replace("/(\[(php|code)\])(.*)(\[\/\\2\])/seiU", "\$this->cachecode('\\3','\\2')", $post);
}
// avoid bbcode wrapping
if ($allowbbcode == 1) {
if ($this->done['bbcode'] != 1) $this->getbbcode();
$post = preg_replace($this->search, $this->replace2, $post);
if ($allowimages != 0) $post = preg_replace($this->imgsearch2, $this->imgreplace2, $post);
}
// cache smilies
if ($allowsmilies == 1) {
if ($this->done['smilies'] != 1) $this->getsmilies();
$post = preg_replace($this->smilie_search, $this->smilie_replace, $post);
}
// wrap text
$post = $this->textwrap($post);
// remove break chars
if ($allowbbcode == 1) {
$post = str_replace($this->breakChar, '', $post);
}
// remove tab
$post = str_replace("\t", " ", $post);
// html
if ($allowhtml == 0) {
$post = htmlconverter($post);
$post = nl2br($post);
}
else $post = preg_replace("/<([\/]?)script([^>]*)>/i", "<\\1script\\2>", $post);
// bbcodes
if ($allowbbcode == 1) {
if ($this->done['bbcode'] != 1) $this->getbbcode();
$post = preg_replace($this->search, $this->replace, $post);
}
else {
$post = preg_replace("/java script:/i", "java script:", $post);
$post = preg_replace("/vb script:/i", "vb script:", $post);
}
// AJ
$post = preg_replace('`ajfsp://file\|([^"]+?)\|([0-9A-Fa-f]{32})\|(\d+)/?`e','$this
->ajfsp(\'\\1\', \'\\2\', \'\\3\')', $post);
// images
if ($allowimages != 0) $post = preg_replace($this->imgsearch, $this->imgreplace, $post);
// replace smilies
if ($allowsmilies == 1) $post = preg_replace($this->smilie_search2, $this->smilie_replace2, $post);
// insert code
if ($this->usecode == 1 && $allowbbcode == 1 && ($this->index['php'] != -1 || $this->index['code'] != -1)) $post = $this->replacecode($post);
return $post;
}
function textwrap($text) {
if ($text && wbb_strlen($text) > $this->wrapwidth) {
$text = preg_replace("/([^\n\r$this->breakChar ]{".$this->wrapwidth."})/i", " \\1\n", $text);
return $text;
}
else return $text;
}
Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von Highlander1206: 08.04.09 11:49.
|
|
08.04.09 11:49 |
E-Mail
Finden
Als Freund hinzufügen
|
|
audisline
Mitglied
Dabei seit: 01.04.12
Beiträge: 5
|
|
ich greife dieses Thema nochmal auf. Das Problem habe ich so gelöst. Im Thread.PHP nach der ersten Zahl (Bei mir) 75 suchen und erhöhen. Bei mir fand der Textumbruch nach 75 Zeichen statt
|
|
11.04.12 01:04 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Caelan
Mitglied
Dabei seit: 27.12.05
Beiträge: 6
Forenversion: 2.3
|
|
Ich habe beide Vorschläge ausprobiert aber bei mir zerhackt er noch immer die zu langen Links mit einem automatischen Zeilenumbruch. Bilder werden also im Thread nicht angezeigt.
Hat vielleicht noch jemand eine Idee?
|
|
07.06.12 17:10 |
E-Mail
Finden
Als Freund hinzufügen
|
|
|