Revision 1875
Added by Dietmar over 11 years ago
save.php | ||
---|---|---|
37 | 37 |
$sMediaUrl = WB_URL.MEDIA_DIRECTORY; |
38 | 38 |
// Update the mod_wysiwygs table with the contents |
39 | 39 |
if(isset($_POST['content'.$section_id])) { |
40 |
$content = $_POST['content'.$section_id];
|
|
40 |
$content = $_POST['content'.$section_id];
|
|
41 | 41 |
if(ini_get('magic_quotes_gpc')==true) |
42 | 42 |
{ |
43 | 43 |
$content = $admin->strip_slashes($_POST['content'.$section_id]); |
44 |
} |
|
44 |
};
|
|
45 | 45 |
$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU'; |
46 |
$content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
|
|
46 |
$content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
|
|
47 | 47 |
// searching in $text will be much easier this way |
48 |
$content = WbDatabase::getInstance()->escapeString ($content);
|
|
48 |
$content = WbDatabase::getInstance()->escapeString ($content);
|
|
49 | 49 |
$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0); |
50 | 50 |
$sql = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` '; |
51 | 51 |
$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' '; |
52 | 52 |
$sql .= 'WHERE `section_id`='.(int)$section_id; |
53 |
if(!$database->query($sql)){
|
|
54 |
$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$database->get_error() : '');
|
|
53 |
if(!WbDatabase::getInstance()->query($sql)){
|
|
54 |
$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.WbDatabase::getInstance()->get_error() : '');
|
|
55 | 55 |
} |
56 | 56 |
} else { |
57 | 57 |
$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : ''); |
... | ... | |
59 | 59 |
|
60 | 60 |
$sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? SEC_ANCHOR.$section_id : 'section_'.$section_id ); |
61 | 61 |
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){ |
62 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
|
|
62 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
|
|
63 | 63 |
} else { |
64 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
|
|
64 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
|
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
// Check if there is a database error, otherwise say successful |
Also available in: Unified diff
! wysgwyg, now check exitings table entries, otherwise script stop loading content in editor
! typofix in groups
! change constant DB_NAME to $database->DbName