So wir hatten ja erst vor kurzem das Thema Selfpages.
Ich hab den Code davon mal mit drin gelassen. (bzgl der Kommentare)
In der include/admin/selfbp.php müsste die edit_text Funktion wie folgt geändert werden.
function edit_text($t, $add) {
//!add -> replace php_code with {_boxes_XXX}
if (!$add) {
$t = preg_replace('~<\?php echo selfp_get_boxcontent\("([a-z]+)"\); \?>~', '{_boxes_$1}', $t);
}
$erg = preg_match("/^\s*<\?php defined \('main'\) or die \('no direct access'\);.*\?>/s", $t);
if (!$erg && $add) {
$t = trim($t);
//remove PHP (or shorttags)
$options = is_string($add) ? '/* ' . $add . ' */' : '';
$t = preg_replace('/<\?.*(\?>|$)/', '', $t);
$t = '<?php defined (\'main\') or die (\'no direct access\'); ' . $options . '?>' . $t;
} elseif ($erg AND !$add) {
$t = preg_replace("/^\s*<\?php defined \('main'\) or die \('no direct access'\);.*\?>(.*)$/s", "\\1", $t);
}
//add -> replace {_boxes_XXX} with php code
if ($add) {
$t = preg_replace('~{_boxes_([a-z]+)}~', '<?php echo selfp_get_boxcontent("$1"); ?>', $t);
}
return $t;
}
Dann muss in der include/contents/self.php noch folgende Funktion zum Laden der Boxen eingefügt werden. (möglichst neben (vor oder nach) der get_properties Funktion)
function selfp_get_boxcontent ($box) {
global $lang, $allgAr, $menu,$ILCH_HEADER_ADDITIONS,$ILCH_BODYEND_ADDITIONS;
if (file_exists('include/boxes/' . $box . '.php')) {
$pfad = 'include/boxes/' . $box . '.php';
} elseif (file_exists('include/boxes/' . $box . '.htm')) {
$pfad = 'include/boxes/' . $box . '.htm';
} elseif (file_exists ('include/contents/selfbp/selfb/' . str_replace('self_', '', $box) . '.php')) {
$pfad = 'include/contents/selfbp/selfb/' . str_replace('self_', '', $box) . '.php';
} elseif (file_exists ('include/contents/selfbp/selfb/' . str_replace('self_', '', $box) . '.htm')) {
$pfad = 'include/contents/selfbp/selfb/' . str_replace('self_', '', $box) . '.htm';
} else {
return (false);
}
include $pfad;
}
Zuletzt modifiziert von Mairu am 08.12.2016 - 08:10:21