Hallo,
ich habe in meinem Plugin diese wohl "alt" bewährte Methode eingesetzt. :-D
PHP
function mr_resplan_check_output($content) {
$text = '[mr_resplan ';
$pos = strpos($content, $text);
if ($pos !== FALSE) {
$tmptext = substr($content, $pos-1);
$pos = strpos($tmptext, ']');
if ($pos !== FALSE) {
$oid = (int)trim(substr($tmptext, strlen($text), $pos - strlen($text)));
if (strpos($content, $text.$oid.']') !== FALSE) {
$content = preg_replace('/<p>\s*[(.*)]\s*<\/p>/i', "[$1]", $content);
$test = tabelle_zeigen($oid);
$content = str_replace($text.$oid.']', $test, $content);
return $content;
}
}
}else{
return $content;
}
}
Alles anzeigen
Die Funktion "tabelle_zeigen()" erzeugt eine in <div> gehüllte Tabelle.
Ich möchte nun den Text der vor Aufruf [mr_resplan 1] im Content steht auch vor der Tabelle darstellen. Das gelingt mir nicht.
Der gesamte Content wird erst nach der Tabelle (also am Fuss) dargestellt.
Wie schaffe ich es das es so dargestellt wird:
Text (Content)
Tabelle (Funktion)
Text (Content)