aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-03-17 12:15:59 +0100
committerMichael Vogel <icarus@dabo.de>2012-03-17 12:15:59 +0100
commitf5db142d93906d9fd33ddcd75dfa56ec90ce3b9e (patch)
treee4c30f54f6844ccb55a4dac8dd7120175180afa1 /include/text.php
parent8a1f175df022e2fc2c2162aa314ea34454482d48 (diff)
downloadvolse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.tar.gz
volse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.tar.bz2
volse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.zip
Quotes with author are now having an "open/close" link
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index bcd567a15..049771949 100644
--- a/include/text.php
+++ b/include/text.php
@@ -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);