Revision 1918
Added by Dietmar about 11 years ago
save_post.php | ||
---|---|---|
4 | 4 |
* @category modules |
5 | 5 |
* @package news |
6 | 6 |
* @author WebsiteBaker Project |
7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
7 |
* @copyright 2009-2013, WebsiteBaker Org. e.V.
|
|
8 |
* @link http://www.websitebaker.org/
|
|
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
11 | 11 |
* @requirements PHP 5.2.2 and higher |
12 | 12 |
* @version $Id$ |
13 |
* @filesource $HeadURL$
|
|
13 |
* @filesource $HeadURL$
|
|
14 | 14 |
* @lastmodified $Date$ |
15 | 15 |
* |
16 | 16 |
*/ |
... | ... | |
65 | 65 |
} |
66 | 66 |
$admin->print_header(); |
67 | 67 |
|
68 |
// $sMediaUrl = WB_URL.MEDIA_DIRECTORY; |
|
69 |
// $searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU'; |
|
68 | 70 |
// Validate all fields |
71 |
$title = $admin->StripCodeFromText($admin->get_post('title')); |
|
72 |
$commenting = $admin->StripCodeFromText($admin->get_post('commenting')); |
|
73 |
$active = intval($admin->get_post('active')); |
|
74 |
$old_link = $admin->StripCodeFromText($admin->get_post('link')); |
|
75 |
$group_id = intval($admin->get_post('group')); |
|
76 |
|
|
69 | 77 |
if($admin->get_post('title') == '' AND $admin->get_post('url') == '') { |
70 |
$recallUrl = WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.
|
|
78 |
$recallUrl = WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.
|
|
71 | 79 |
'§ion_id='.$section_id.'&post_id='.$admin->getIDKEY($post_id); |
72 | 80 |
$admin->print_error($MESSAGE['GENERIC_FILL_IN_ALL'], $recallUrl); |
73 |
}else { |
|
74 |
$title = $admin->get_post_escaped('title'); |
|
75 |
$short = $admin->get_post_escaped('short'); |
|
76 |
$long = $admin->get_post_escaped('long'); |
|
77 |
$commenting = $admin->get_post_escaped('commenting'); |
|
78 |
$active = $admin->get_post_escaped('active'); |
|
79 |
$old_link = $admin->get_post_escaped('link'); |
|
80 |
$group_id = $admin->get_post_escaped('group'); |
|
81 |
} else { |
|
82 |
$short = $admin->get_post('short'); |
|
83 |
$long = $admin->get_post('long'); |
|
84 |
// if(ini_get('magic_quotes_gpc')==true) |
|
85 |
// { |
|
86 |
// $short = $admin->strip_slashes($short); |
|
87 |
// $long = $admin->strip_slashes($long); |
|
88 |
// } |
|
89 |
// $short = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $short ); |
|
90 |
// $long = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $long ); |
|
91 |
$short = $admin->ReplaceAbsoluteMediaUrl($short); |
|
92 |
$long = $admin->ReplaceAbsoluteMediaUrl($long); |
|
81 | 93 |
} |
94 |
|
|
82 | 95 |
// Get page link URL |
83 | 96 |
$sql = 'SELECT `link` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.(int)$page_id; |
84 | 97 |
$oldLink = $database->get_one($sql); |
Also available in: Unified diff
! /modules/news/ beginning beginning recoding
replacing absolute MediaUrl with place holder