WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?php $sql = 'SELECT `section_id`, `block`, `module` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.$page_id;$sect_set = $database->query($sql);$section_id = $sect_set->fetchRow(); ?>
Array ( => 8 [section_id] => 8 [1] => 1 [block] => 1 [2] => wysiwyg [module] => wysiwyg )
select `section_id`FROM `sections`WHERE `page_id`=$page_id
Mir ist nicht recht klar, warum das Pferd von dieser Seite her aufzäumst. Was bringt dir das?Jegliches Frontend-Edit muss vom Modul her kommen, es muss dafür vorbereitet sein. Über das Abfragen der Sections kommst du gerade dahin, dass du ein Modul zwar im Frontend aufrufen kannst, aber spätestens beim Speichern landest du (derzeit) ganz normal im Backend. Von vielen "Besonderheiten" der Module abgesehen.
Ändert das Teil irgendwas an WB?Ich habe hier sehr seltsame Effekte - auch nachdem ich das Modul wieder entfert habe.
<?php// prevent this file from being accessed directlyif (!defined('WB_PATH')) die(header('Location: ../../../index.php'));// TEMPLATE CODE STARTS BELOW?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo defined('DEFAULT_CHARSET') ? DEFAULT_CHARSET : 'utf-8'; ?>" /> <meta name="description" content="<?php page_description(); ?>" /> <meta name="keywords" content="<?php page_keywords(); ?>" /> <?php // automatically include optional WB module files (frontend.css, frontend.js) if (function_exists('register_frontend_modfiles')) { register_frontend_modfiles('css'); register_frontend_modfiles('jquery'); register_frontend_modfiles('js'); } ?> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR; ?>/template.css" media="screen,projection" /> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR; ?>/print.css" media="print" /> <title><?php page_title('', '[WEBSITE_TITLE]'); ?></title></head><body><table cellpadding="0" cellspacing="0" border="0" align="center" class="main" width="750"><tr>[...] <td class="content" width="600" rowspan="2"> <?php frontend_edit(); page_content(); ?> </td></tr></table></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="<?php page_description(); ?>" /> <meta name="keywords" content="<?php page_keywords(); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR; ?>/andreas00.css" media="screen,projection" /><link rel="stylesheet" type="text/css" href="<?php echo WB_URL; ?>/include/jquery/plugins/jquery-ui.css" media="screen,projection" /> <?phpif(function_exists('register_frontend_modfiles')) { register_frontend_modfiles('css');} ?> <title><?php page_title(); ?></title><script language="JavaScript" type="text/javascript">//<![CDATA[var URL = '<?php print WB_URL ?>';var WB_URL = '<?php print WB_URL ?>';var TEMPLATE_DIR = '<?php print TEMPLATE_DIR ?>';//]]></script><script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-min.js"></script><script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-ui-min.js"></script><script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-insert.js"></script> <?phpif(function_exists('register_frontend_modfiles')) { register_frontend_modfiles('js');} ?></head><body><div id="wrap">[...]<?php ob_start(); // start output bufferfrontend_edit();page_content(2); // call content$foo=ob_get_contents(); // put outputbuffer in $fooob_end_clean(); // clear outputbuffer[...]?> </div></body></html>
<?phpif (!function_exists('sections_on_page')) { function sections_on_page() { global $wb, $database, $HEADING; if ($wb->is_authenticated()) { $is_admin=false; $page_id =PAGE_ID == 0 ? $wb->default_page_id : PAGE_ID; $sql ='SELECT `section_id`, `block`, `module` FROM `' . TABLE_PREFIX . 'sections`'; $sql .='WHERE `page_id` = ' . $page_id . ' ORDER BY `position`'; $sect_set=$database->query($sql); while ($sections=$sect_set->fetchRow()) { $section_array[]=$sections['section_id']; } return $section_array; } } }if (!function_exists('fedit_jq_section_edit')) { function fedit_jq_section_edit() [...] { $fedit_jq=WB_PATH . '/modules/frontend_edit/frontend_snippet/fedit_jq_overlay.js'; }[...] if (file_exists($fedit_jq)) { $get_jq_file =get_fedit_file($fedit_jq); $feditget_section='<script type="text/javascript">' . $get_jq_file . '</script>'; $section_array =sections_on_page(); $fedit_section =$feditget_section; $store_modify =''; foreach ($section_array as &$value) { $store_modify = '<a href="' . ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '&wysiwyg=' . $value . '" class="fbox" title="' . $HEADING['MODIFY_PAGE'] . ': ' . $value . '"><img src="' . WB_URL . '/modules/frontend_edit/images/edit_16.png" alt="' . $HEADING['MODIFY_PAGE'] . '" /></a>'; unset ($value); } foreach ($section_array as &$value) { $fedit_replace = str_replace('replace', $store_modify, $fedit_section); return $fedit_replace; } } } } }?>
if (jQuery) { jQuery(document).ready(function() { if($(".section_anchor").length) { $(".section_anchor").after('replace'); // ++++ Das ist das Replace in der PHP Datei, das per str_replace ersetzt wird ++++ };[...] });};
$sql ='SELECT `section_id`, `block`, `module` FROM `' . TABLE_PREFIX . 'sections`'; $sql .='WHERE `page_id` = ' . $page_id . ' ORDER BY `position`';
Meine rudimentären SQL Kenntnisse sagen mir, dass nach SELECT auch position stehen muss und dass bei ORDER BY `position` die Gänsefüßchen weg müssen.