Revision 5
Added by stefan about 20 years ago
| view.php | ||
|---|---|---|
| 27 | 27 |
$get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'");
|
| 28 | 28 |
$fetch_content = $get_content->fetchRow(); |
| 29 | 29 |
$content = stripslashes($fetch_content['content']); |
| 30 |
// Replace [wblink--PAGE_ID--] with real link |
|
| 31 |
$pattern = '/\[wblink(.+?)\]/s'; |
|
| 32 |
preg_match_all($pattern,$content,$ids); |
|
| 33 |
foreach($ids[1] AS $page_id) {
|
|
| 34 |
$pattern = '/\[wblink'.$page_id.'\]/s'; |
|
| 35 |
// Get page link |
|
| 36 |
$get_link = $database->query("SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id' LIMIT 1");
|
|
| 37 |
$fetch_link = $get_link->fetchRow(); |
|
| 38 |
$link = page_link($fetch_link['link']); |
|
| 39 |
$content = preg_replace($pattern,$link,$content); |
|
| 40 |
} |
|
| 30 |
|
|
| 31 |
$this->preprocess($content); |
|
| 32 |
|
|
| 41 | 33 |
echo $content; |
| 42 | 34 |
|
| 43 |
?> |
|
| 35 |
?> |
|
Also available in: Unified diff
Restructured frontend code and fixed various bugs