mirror of
https://github.com/friendica/friendica
synced 2025-05-03 22:24:11 +02:00
Quotes with author are now having an "open/close" link
This commit is contained in:
parent
8a1f175df0
commit
f5db142d93
2 changed files with 25 additions and 3 deletions
|
@ -968,12 +968,23 @@ function prepare_body($item,$attach = false) {
|
|||
|
||||
$pos = strpos($s, $spoilersearch);
|
||||
$rnd = random_string(8);
|
||||
$spoilerreplace = '<span id="spoiler-wrap-'.$rnd.'" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-'.$rnd.'\');">'.sprintf(t('Click to open/close')).'</span>'.
|
||||
$spoilerreplace = '<br /> <span id="spoiler-wrap-'.$rnd.'" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-'.$rnd.'\');">'.sprintf(t('Click to open/close')).'</span>'.
|
||||
'<blockquote class="spoiler" id="spoiler-'.$rnd.'" style="display: none;">';
|
||||
//$s = str_replace($spoilersearch, $spoilerreplace, $s);
|
||||
$s = substr($s, 0, $pos).$spoilerreplace.substr($s, $pos+strlen($spoilersearch));
|
||||
}
|
||||
|
||||
// Look for quote with author
|
||||
$authorsearch = '<blockquote class="author">';
|
||||
|
||||
while ((strpos($s, $authorsearch) !== false)) {
|
||||
|
||||
$pos = strpos($s, $authorsearch);
|
||||
$rnd = random_string(8);
|
||||
$authorreplace = '<br /> <span id="author-wrap-'.$rnd.'" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'author-'.$rnd.'\');">'.sprintf(t('Click to open/close')).'</span>'.
|
||||
'<blockquote class="author" id="author-'.$rnd.'" style="display: block;">';
|
||||
$s = substr($s, 0, $pos).$authorreplace.substr($s, $pos+strlen($authorsearch));
|
||||
}
|
||||
|
||||
$prep_arr = array('item' => $item, 'html' => $s);
|
||||
call_hooks('prepare_body_final', $prep_arr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue