added the row 'nameblock' to the database (phpmyadmin, section table, add 1 - call it 'nameblock'
- - - - -
in admin/pages/sections.php
added
<input type="hidden" class="inputveldje" id="nameblock<?php echo $section['section_id']; ?>" name="nameblock<?php echo $section['section_id']; ?>" value="<?php foreach($block AS $number => $name) { if($number == $section['block']) { echo $name; } } ?>" style="width: 100px;" />
to the tablerow that displayes the info for each created section
- - - - -
in admin/pages/sections_save.php
added some lines to save the new values from the form to the database:
// update publ_start and publ_end, trying to make use of the strtotime()-features like "next week", "+1 month", ...
if(isset($_POST['start_date'.$section_id]) AND isset($_POST['end_date'.$section_id])) {
if(trim($_POST['start_date'.$section_id]) == '0' OR trim($_POST['start_date'.$section_id]) == '') {
$publ_start = 0;
$namesection = ($_POST['namesection'.$section_id]);
$nameblock = ($_POST['nameblock'.$section_id]);
} else {
$publ_start = jscalendar_to_timestamp($_POST['start_date'.$section_id]);
$namesection = ($_POST['namesection'.$section_id]);
$nameblock = ($_POST['nameblock'.$section_id]);
}
if(trim($_POST['end_date'.$section_id]) == '0' OR trim($_POST['end_date'.$section_id]) == '') {
$publ_end = 0;
$namesection = ($_POST['namesection'.$section_id]);
$nameblock = ($_POST['nameblock'.$section_id]);
} else {
$publ_end = jscalendar_to_timestamp($_POST['end_date'.$section_id], $publ_start);
$namesection = ($_POST['namesection'.$section_id]);
$nameblock = ($_POST['nameblock'.$section_id]);
}
if($sql != '')
$sql .= ",";
$sql .= " publ_start = '".$admin->add_slashes($publ_start)."'";
$sql .= ", publ_end = '".$admin->add_slashes($publ_end)."'";
$sql .= ", namesection = '".$admin->add_slashes($namesection)."'";
$sql .= ", nameblock = '".$admin->add_slashes($nameblock)."'";
}
alle stuff regarding namesection and nameblock are the new / extra lines
- - - -
at the bottom of the admin/pages/modify.php there is some code to display the sectionnumber...
I added some stuff there
// Get sections for this page
$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
$query_sections = $database->query("SELECT * FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
if($query_sections->numRows() > 0) {
while($section = $query_sections->fetchRow()) {
$section_id = $section['section_id'];
$module = $section['module'];
$namesection = $section['namesection'];
$nameblock = $section['nameblock'];
$block = $section['block'];
if (empty($nameblock)){
$nameblock = ' ';
}else{
$nameblock = 'Positie op de website : <span style="color:#239DCB; font-weight:bold;">'.$nameblock.'</span> | ';
}
//Have permission?
if(!is_numeric(array_search($module, $module_permissions))) {
// Include the modules editing script if it exists
if(file_exists(WB_PATH.'/modules/'.$module.'/modify.php')) {
echo '<div style="border-top: 1px solid #239DCB;margin-top:5px; padding-top:10px;"><a name="'.$section_id.'"></a>
<div style="color:#666;margin-bottom:5px;float:left; text-align:left;"><h2>'.$namesection.'</h2></div>
<div style="color:#666;margin-bottom:5px;float:right; text-align:right;">'.$nameblock.'modulesoort: <span style="color:#239DCB; font-weight:bold;">'.$module.$dop.'</span> | Pagina-onderdeelnummer:<span style="color:#239DCB; font-weight:bold;"> '.$section_id.' </span><br /><br />
</div>
</div><br />
<br />
';
require(WB_PATH.'/modules/'.$module.'/modify.php');
}
}
}
}
// Print admin footer
$admin->print_footer();
?>
sorry for the dutch language in the code, just change those words to your tongue..
- - - - -
why would you wanna do this:
to make the backend more clear!