1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| <?php
require_once('../includes/news.lib.php');
header('Content-type: text/javascript; charset=iso-8859-1');
$news = get_news($_GET['id']);
$news['title'] = quote_replace($news['title']);
$news['before_title'] = quote_replace($news['before_title']);
$news['category'] = quote_replace($news['category']);
$news['categoryr'] = quote_replace($news['categoryr']);
$news['category2'] = quote_replace($news['category2']);
$news['thumbnail'] = quote_replace($news['thumbnail']);
$news['author'] = quote_replace($news['author']);
$news['description'] = str_replace("\r\n", "\\r\\n", quote_replace($news['description']));
$news['meta'] = quote_replace($news['meta']);
$news['source'] = quote_replace($news['source']);
$news['news'] = str_replace("\r\n", "\\r\\n", quote_replace($news['news']));
$news['url'] = news_get_url_page_name($news['url']);
$news['tagg1'] = quote_replace($news['tagg1']);
$news['tagg2'] = quote_replace($news['tagg2']);
$news['tagg3'] = quote_replace($news['tagg3']);
$news['tagg4'] = quote_replace($news['tagg4']);
print <<<JS
function choose(name, value){
\$(name).value = value;
}
function chooseOther(name, value){
\$(name).value = value;
if ( false == \$(name).present() ){
\$(name).value = '';
\$(name + 'other').value = value;
}
}
choose('update', '{$_GET['id']}');
choose('title', '{$news['title']}');
$('bold{$news['bold']}').checked = 'checked';
choose('url', '{$news['url']}');
chooseOther('category', '{$news['category']}');
chooseOther('categoryr', '{$news['categoryr']}');
chooseOther('category2', '{$news['category2']}');
chooseOther('thumbnail', '{$news['thumbnail']}');
chooseOther('author', '{$news['author']}');
choose('date', '{$news['date']}');
choose('tagg1', '{$news['tagg1']}');
choose('tagg2', '{$news['tagg2']}');
choose('tagg3', '{$news['tagg3']}');
choose('tagg4', '{$news['tagg4']}');
choose('description', '{$news['description']}');
JS;
if ( ! empty($news['before_title']) ){
print <<<JS
choose('before_title', '{$news['before_title']}');
JS;
}
if ( ! empty($news['logo']) ){
print <<<JS
choose('logo', '{$news['logo']}');
JS;
}
if ( ! empty($news['meta']) ){
print <<<JS
choose('meta', '{$news['meta']}');
JS;
}
$images = explode(';', $news['images']);
array_pop($images);
$i = 1;
foreach ( $images as $image ){
if ( ! empty($image) ){
print <<<JS
choose('image$i', '$image');
JS;
}
$i++;
}
if ( ! empty($news['source']) ){
print <<<JS
choose('source', '{$news['source']}');
JS;
}
print <<<JS
$('news').value = '{$news['news']}';
FCKeditorAPI.GetInstance('news').SetHTML('{$news['news']}');
JS;
?> |
Partager