Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if( !defined( 'DATALIFEENGINE') ) {
- die( 'Hacking attempt!');
- }
- if( !$user_group[$member_id['user_group']]['admin_rss'] ) {msg( 'error',$lang['index_denied'],$lang['index_denied'] );}
- @include(ENGINE_DIR.'/data/rss_config.php');
- if(intval($config_rss['memory_limit'])!=0)@ini_set ('memory_limit',$config_rss['memory_limit']);
- else @ini_set ('memory_limit','128M');
- @set_time_limit (0);
- @ini_set ('max_input_time',864000);
- @ini_set ('post_max_size','20M');
- @ini_set ('upload_max_filesize','20M');
- @ini_set ('max_execution_time',864000);
- @ini_set ('output_buffering','off');
- @ob_end_clean ();
- clearstatcache ();
- ob_implicit_flush (TRUE);
- $dle_plugins = ENGINE_DIR .'/classes/';
- $rss_plugins = ENGINE_DIR .'/inc/plugins/';
- $selected_language = $config['langs'];
- if (isset( $_COOKIE['selected_language'] )) {
- $_COOKIE['selected_language'] = totranslit( $_COOKIE['selected_language'],false,false );
- if (@is_dir ( ROOT_DIR .'/language/'.$_COOKIE['selected_language'] )) {
- $selected_language = $_COOKIE['selected_language'];
- $config['langs'] = $selected_language;
- }
- }
- if ( file_exists( ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng') ) {
- require_once ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng';
- }else {
- if ( file_exists( ROOT_DIR .'/language/Russian/grabber.lng') ) {
- require_once ROOT_DIR .'/language/Russian/grabber.lng';
- require_once $rss_plugins.'core.php';
- require_once $rss_plugins.'rss.classes.php';
- require_once $rss_plugins.'rss.functions.php';
- require_once $rss_plugins.'rss.parser.php';
- $file = ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng';
- $d_lang = substr(strtolower($config['langs']),0,2);
- $n=count($lang_grabber);
- $i=0;
- $text = translate_google('Подождите идёт локализация модуля ...','ru',$d_lang);
- echoheader ('','');
- opentable ($text);
- ob_flush();flush();
- foreach ($lang_grabber as $key=>$value){
- $i++;
- echo "<script> storyes($i, $n, '$text'); </script>";
- ob_flush();flush();
- $value = str_replace( '&#','<hw',$value );
- $value = str_replace( '<','lt;',$value );
- $value = str_replace( '>','gt;',$value );
- $value = translate_google($value,'ru',$d_lang);
- $value = str_replace( "\n",'<br />',$value );
- $value = str_replace( ' /','/',$value );
- $value = str_replace( '/ ','/',$value );
- $value = str_replace( '"','',$value );
- $value = str_replace( 'lt;','<',$value );
- $value = str_replace( 'gt;','>',$value );
- $value = str_replace( '<hw','&#',$value );
- $lang_grabber[$key]=$value;
- }
- echo 'Локализация завершена!!!';
- closetable ();
- echofooter ();
- $handler = fopen($file,'w+');
- fwrite($handler,"<?php\n\n");
- fwrite($handler,"\$lang_grabber = ".var_export ($lang_grabber,true).';'."\n?".'>');
- fclose($handler);
- exit();
- }else{die('Language file not found');}
- }
- $module_info = array ('name'=>'RSS Grabber','version'=>'3.6.9','build'=>'1007');
- $dle_plugins = ENGINE_DIR .'/classes/';
- require_once $dle_plugins.'templates.class.php';
- require_once $dle_plugins.'parse.class.php';
- $parse = new ParseFilter (array (),array (),1,1);
- $key_iframe = array_search('iframe',$parse->tagBlacklist);
- unset ($parse->tagBlacklist[$key_iframe]);
- $key_script = array_search('script',$parse->tagBlacklist);
- unset ($parse->tagBlacklist[$key_script]);
- $tpl = new dle_template ();
- $rss_plugins = ENGINE_DIR .'/inc/plugins/';
- require_once $rss_plugins.'core.php';
- require_once $rss_plugins.'strip_tags_smart.php';
- require_once $rss_plugins.'backup.php';
- $tpl->dir = $rss_plugins.'templates/';
- require_once $rss_plugins.'rss.classes.php';
- require_once $rss_plugins.'rss.functions.php';
- require_once $rss_plugins.'rss.parser.php';
- require_once $rss_plugins.'classes.file.php';
- require_once $rss_plugins.'channel.php';
- if ($_REQUEST['action'] != '')
- {
- $action = $_REQUEST['action'];
- }
- else
- {
- $action = '';
- }
- if ($_REQUEST['subaction'] != '')
- {
- $subaction = $_REQUEST['subaction'];
- }
- else
- {
- $subaction = '';
- }
- if ($_REQUEST['id'] != '')
- {
- $id = intval ($_REQUEST['id']);
- }
- else
- {
- $id = '';
- }
- $add_bb = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
- <div> </div><div id="skip" style="padding:5px 0 0 2px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'skip\')" ><b>{skip}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="get" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'get\')"><b>{get}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="num" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'num\')"><b>{num}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="link" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'link\')"><b>{link}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- </div>
- </div>
- ';
- $add_bbz = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
- <div> </div><div id="skip" style="padding:5px 0 0 2px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'skip\')" ><b>{skip}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="get" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'get\')"><b>{get}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="num" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'num\')"><b>{num}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="frag" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'frag\')"><b>{frag}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="zagolovok" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'zagolovok\')"><b>{zagolovok}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="link" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'link\')"><b>{link}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- </div>';
- $add_bbzz = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
- <div> </div>
- <div id="frag" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'frag\')"><b>{frag}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- <div id="zagolovok" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'zagolovok\')"><b>{zagolovok}</b>
- </div>
- <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
- </div>';
- if (($action == 'channel') and ($subaction == 'add'))
- {
- echoheader ('','');
- opentable ($lang_grabber['new_channel']);
- $channel_inf = array();
- $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
- $run[0] = '';
- while ($channel_info = $db->get_row($sql_result)) {
- if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] = $channel_info['title'];
- else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
- }
- foreach($channel_inf as $value)
- {
- if (count($value) != '0'){
- foreach($value as $kkey=>$key)
- {
- $run[$kkey] = $key;
- }
- }
- }
- $tpl->load_template ('rss_addchannel.tpl');
- $tpl->set ('{rss-priv}',sel ($run,''));
- $tpl->set ('{title}','');
- $tpl->set ('{category}',categorynewsselection (1,0));
- $tpl->set ('{address}','');
- $tpl->set ('{date-format}',gen_date_format ($config_rss['date']));
- $tpl->set ('{charsets}','');
- $tpl->set ('{load-img}',server_host($config_rss['img_host'] ));
- $tpl->set ('{dubl-host}','');
- $tpl->set ('{rss-parse}',sel (array ('0'=>$lang_grabber['no_thumb'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full'],'3'=>$lang_grabber['thumb_shortfull']),''));
- $tpl->set ('{cache-link}','');
- $tpl->set ('{one-serv}','');
- $tpl->set ('{image-align}',gen_x ($config_rss['image_align'],4));
- $tpl->set ('{image-align-full}',gen_x ($config_rss['image_align_full'],4));
- $tpl->set ('{image-align-post}',gen_x ($config_rss['image_align_full'],4));
- $tpl->set ('{hide}',($config_rss['hide'] == 'yes'?'checked': ''));
- $tpl->set ('{leech}',($config_rss['leech']== 'yes'?'checked': ''));
- $tpl->set ('{leech-dop}',($config_rss['leech_dop']== 'yes'?'checked': ''));;
- $tpl->set ('{leech-shab}','');
- $tpl->set ('{thumb-images}',($config_rss['cat']== 'yes'?'checked': ''));
- $tpl->set ('{cat-nul}','');
- $tpl->set ('{cat-sp}','');
- $tpl->set ('{kategory}','');
- $tpl->set ('{kol-short}','');
- $tpl->set ('{sim-short}','');
- $tpl->set ('{starter-page}','');
- $tpl->set ('{page-break}','');
- $tpl->set ('{data-deap}','');
- $tpl->set ('{max-image}','');
- $tpl->set ('{deap}',deap ());
- $tpl->set ('{log-pas}','');
- $tpl->set ('{log-cookies}','checked');
- $tpl->set ('{wat-host}','');
- $tpl->set ('{tags-auto}',($config_rss['tags_auto']== 'yes'?'checked': ''));
- $tpl->set ('{tags-zag}','');
- $tpl->set ('{allow-mod}',($config_rss['allow-mod']== 'yes'?'checked': ''));
- $tpl->set ('{allow-main}',($config_rss['allow-main']== 'yes'?'checked': ''));
- $tpl->set ('{allow-comm}',($config_rss['allow-rate']== 'yes'?'checked': ''));
- $tpl->set ('{allow-rate}',($config_rss['allow-comm']== 'yes'?'checked': ''));
- $tpl->set ('{allow-full}',($config_rss['allow-full']== 'yes'?'checked': ''));
- $tpl->set ('{allow-auto}',($config_rss['allow-auto']== 'yes'?'checked': ''));
- $tpl->set ('{allow-water}',($config_rss['allow-water']== 'yes'?'checked': ''));
- $tpl->set ('{rewrite-news}',($config_rss['rewrite-news']== 'yes'?'checked': ''));
- $tpl->set ('{rewrite-data}','');
- $tpl->set ('{rewrite-no}','');
- $tpl->set ('{rewrite-con}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),'0'));
- $tpl->set ('{clear-short}',($config_rss['clear-short']== 'yes'?'checked': ''));
- $tpl->set ('{clear-full}','');
- $tpl->set ('{short-images}',($config_rss['short-images']== 'yes'?'checked': ''));
- $tpl->set ('{short-images-p}',sel (array(0 =>$lang_grabber['sel_lu'],1 =>$lang['upload_t_seite_2'],2 =>$lang['upload_t_seite_3']),$config_rss['short-images-p']));
- $tpl->set ('{kol-image-short}','');
- $tpl->set ('{zip-image}','');
- $tpl->set ('{short-full}',($config_rss['short-full']== 'yes'?'checked': ''));
- $tpl->set ('{dop-watermark}',($config_rss['dop-watermark']== 'yes'?'checked': ''));
- $tpl->set ('{watermark-image-light}',$config_rss['watermark_image_light']);
- $tpl->set ('{watermark-image-dark}',$config_rss['watermark_image_dark']);
- $tpl->set ('{null}',($config_rss['null']== 'yes'?'checked': ''));
- $tpl->set ('{grab-pause}','');
- $tpl->set ('{add-pause}','');
- $tpl->set ('{cron-auto}','');
- $tpl->set ('{min-image}','');
- $tpl->set ('{text-html}','');
- $tpl->set ('{dim-date}','');
- $tpl->set ('{dim-sait}','');
- $tpl->set ('{dim-cat}','');
- $tpl->set ('{dim-week}','');
- $tpl->set ('{file-atach}','');
- $tpl->set ('{tor-torrage}','');
- $tpl->set ('{file-name}','');
- $tpl->set ('{file-video}','');
- $tpl->set ('{file-rar}','');
- $tpl->set ('{file-zip}','');
- $tpl->set ('{file-doc}','');
- $tpl->set ('{file-txt}','');
- $tpl->set ('{file-dle}','');
- $tpl->set ('{file-tor}','');
- $tpl->set ('{url-video}','');
- $tpl->set ('{url-rar}','');
- $tpl->set ('{url-zip}','');
- $tpl->set ('{url-doc}','');
- $tpl->set ('{url-txt}','');
- $tpl->set ('{url-dle}','');
- $tpl->set ('{url-tor}','');
- $tpl->set ('{tit-video}','');
- $tpl->set ('{tit-rar}','');
- $tpl->set ('{tit-zip}','');
- $tpl->set ('{tit-doc}','');
- $tpl->set ('{tit-txt}','');
- $tpl->set ('{tit-dle}','');
- $tpl->set ('{tit-tor}','');
- $tpl->set ('{pap-video}','');
- $tpl->set ('{pap-rar}','');
- $tpl->set ('{pap-zip}','');
- $tpl->set ('{pap-doc}','');
- $tpl->set ('{pap-txt}','');
- $tpl->set ('{pap-dle}','');
- $tpl->set ('{pap-tor}','');
- $tpl->set ('{full-url-and}','');
- $tpl->set ('{text-url-sel}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$config_rss['url-sel']));
- $tpl->set ('{parse-url-sel}',sel (array ('0'=>$lang_grabber['no_thumb'],'1'=>$lang_grabber['thumb_full'],'2'=>$lang_grabber['thumb_short'],'3'=>$lang_grabber['thumb_shortfull']),$config_rss['parse-url-sel']));
- $tpl->set ('{keyw-sel}',sel (array(0 =>$lang_grabber['sel_shortfull'],1 =>$lang_grabber['sel_short'],2 =>$lang_grabber['sel_full'],3 =>$lang_grabber['sel_short_full'],4 =>$lang_grabber['sel_no_gener'],5 =>$lang_grabber['sel_don']),$config_rss['keyw-sel']));
- $tpl->set ('{descr-sel}',sel (array(0 =>$lang_grabber['sel_shortfull'],1 =>$lang_grabber['sel_short'],2 =>$lang_grabber['sel_full'],3 =>$lang_grabber['sel_short_full'],4 =>$lang_grabber['sel_no_gener'],5 =>$lang_grabber['sel_don']),$config_rss['descr-sel']));
- $tpl->set ('{text-url}',sel (array(0 =>$lang_grabber['no_izm'],1 =>$lang_grabber['url_klik'],2 =>$lang_grabber['url_no_donw'],3 =>$lang_grabber['url_no_donor']),$config_rss['text-url']));
- $template = '
- <div class="title_spoiler"><center><img id="image-full_1" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" /> <a href="javascript:ShowOrHide(\'full_1\')">'.$lang_grabber['add_new_dop'].'</a></center></div>
- <div id="full_1" style="display:none">
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr>
- <td colspan="4" style="padding:4px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4" ><center>'.$lang_grabber['rss_xfields_template'].'</center></td>
- </tr>
- <tr>
- <td style="padding:4px" align="center">'.$lang_grabber['rss_xfields'].'
- <select name="rss_xfields_1" class="load_img">
- '.sel (rss_xfields('1'),'').'
- </select><br>
- '.$lang_grabber['use_po_get'].'
- <input type="checkbox" value="1" name="ret_xf_1" />
- '.$lang_grabber['take_short-story'].'
- <input type="checkbox" value="1" name="sh_fl_1"/>
- '.$lang_grabber['img_size'].'
- <input name="rs_sm_1" class="load_img" type="text" size="3" value="0"> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
- <br />
- '.$lang_grabber['pole_img'].'
- <input type="checkbox" value="1" name="sh_im_1" />
- '.$lang_grabber['img_size'].'
- <input name="rs_im_1" class="load_img" type="text" size="10" value="0"> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
- <br />
- '.$lang_grabber['kod_ost'].'
- <input type="checkbox" value="1" name="sh_nw_1" />
- </td>
- </tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" ></td>
- <td width="83%" style="padding:4px">'.$add_bb.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:100px" name="xfields_template_1"></textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr>
- <td colspan="4" align="center" style="padding:6px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4"><center>'.$lang_grabber['templates_search_regular'].' '.$lang_grabber['in_dop_pol'].'</center></td>
- </tr>
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['expression'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:100px" name="xfields_delete_1"></textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['paste'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:100px" name="xfields_insert_1"></textarea>
- </td></tr>
- </table>
- </div>
- <a style="padding:10px" href="'.$PHP_SELF .'?mod=xfields&xfieldsaction=configure" target="_blank">'.$lang_grabber['list_dop_pole'].'</a><br /><br />';
- $tpl->set ('{xfields-template}',$template);
- $tpl->set ('{x}',gen_x ($config_rss['x']));
- $tpl->set ('{y}',gen_y ($config_rss['y']));
- $tpl->set ('{margin}',$config_rss['margin']);
- if (@file_exists ($rss_plugins.'sinonims.php') )
- {
- $sin = '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['sinonims'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="sinonim" value="1" '.($config_rss['sinonim'] == 'no'?'': 'checked').'/>
- <select name="sinonim_sel" class="load_img">'.
- sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$config_rss['sinonim-sel']).'
- </select>
- </td>
- </tr>';
- }
- if(@file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
- {
- $sin .= '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['crosspost'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="cross_post" value="1" />
- </td>
- </tr>';
- }
- if((@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
- {
- $sin .= '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['twitter'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="twitter_post" value="1" />
- </td>
- </tr>';
- }
- $tpl->set ('{sinonim}',$sin);
- $tpl->set ('{title-prob}','');
- $tpl->set ('{title-gener}','');
- $tpl->set ('{convert-utf}',($config_rss['convert']== 'yes'?'checked': ''));
- $tpl->set ('{no-prow}',dubl_news ($config_rss['no_prow']));
- $tpl->set ('{pings}',($config_rss['allow_post']));
- $tpl->set ('{show_autor}',($config_rss['show_autor']== 'yes'?'checked': ''));
- $tpl->set ('{show_tegs}',($config_rss['show_tegs']== 'yes'?'checked': ''));
- $tpl->set ('{show_date}',($config_rss['show_date']== 'yes'?'checked': ''));
- $tpl->set ('{show_code}',($config_rss['show_code']== 'yes'?'checked': ''));;
- $tpl->set ('{show_date}',($config_rss['show_date']== 'yes'?'checked': ''));
- $tpl->set ('{show_code}',($config_rss['show_code']== 'yes'?'checked': ''));
- $tpl->set ('{show_down}',($config_rss['show_down']== 'yes'?'checked': ''));
- $tpl->set ('{show_f}',($config_rss['show_f']== 'yes'?'checked': ''));
- $tpl->set ('{show_symbol}',($config_rss['show_symbol']== 'yes'?'checked': ''));
- $tpl->set ('{show-url}',($config_rss['show_url']== 'yes'?'checked': ''));
- $tpl->set ('{show_date_expires}',($config_rss['show_date_expires']== 'yes'?'checked': ''));
- $tpl->set ('{show_metatitle}',($config_rss['show_metatitle']== 'yes'?'checked': ''));
- $tpl->set ('{show_metadescr}',($config_rss['show_metadescr']== 'yes'?'checked': ''));
- $tpl->set ('{show_keywords}',($config_rss['show_keywords']== 'yes'?'checked': ''));
- $tpl->set ('{symbol}','');
- $tpl->set ('{end-template}','');
- $tpl->set ('{auto-symbol}','');
- $tpl->set ('{auto-numer}',sel (array(1 =>'1',2 =>'2',3 =>'3'),''));
- $tpl->set ('{tags}','');
- $tpl->set ('{teg-fix}','');
- $tpl->set ('{meta-title}','');
- $tpl->set ('{auto-metatitle}',($config_rss['auto_metatitle']== 'yes'?'checked': ''));
- $tpl->set ('{meta-descr}','');
- $tpl->set ('{key-words}','');
- $tpl->set ('{prox}','');
- $tpl->set ('{start-template}','<div id={skip}news-id-{skip}>{get}</div>');
- $tpl->set ('{delate}','');
- $tpl->set ('{inser}','');
- $tpl->set ('{cookies}','');
- $tpl->set ('{keywords}','');
- $tpl->set ('{xdescr}','');
- $tpl->set ('{stkeywords}','');
- $tpl->set ('{date}','');
- $tpl->set ('{start}','');
- $tpl->set ('{finish}','');
- $tpl->set ('{kol-cron}','');
- $tpl->set ('{tags-kol}','');
- $tpl->set ('{dop-full}','');
- $tpl->set ('{groups}',get_groups(explode(',',$config_rss['reg_group'])));
- $tpl->set ('{Autors}','');
- $tpl->set ('{link-start-del}','');
- $tpl->set ('{link-finish-del}','');
- $tpl->set ('{ful-start}','');
- $tpl->set ('{start-title}','');
- $tpl->set ('{start-title-f}','');
- $tpl->set ('{s-title}','');
- $tpl->set ('{end-title}','');
- $tpl->set ('{sfr-short}','');
- $tpl->set ('{efr-short}','');
- $tpl->set ('{sfr-full}','');
- $tpl->set ('{efr-full}','');
- $tpl->set ('{s-del}','');
- $tpl->set ('{end-del}','');
- $tpl->set ('{start-short}','<div id={skip}news-id-{skip}>{get}</div>');
- $tpl->set ('{end-short}','');
- $tpl->set ('{sart-link}','');
- $tpl->set ('{step-page}','');
- $tpl->set ('{end-link}','');
- $tpl->set ('{sart-cat}','');
- $tpl->set ('{shab-data}','');
- $tpl->set ('{full-link}','');
- $tpl->set ('{so}','');
- $tpl->set ('{po}','');
- $tpl->set ('{zhv-code}','');
- $tpl->set ('{lang-title}','checked');
- $tpl->set ('{lang-title-komb}','');
- $tpl->set ('{lang-on}','');
- $tpl->set ('{lang-in}',slected_lang ('ru'));
- $tpl->set ('{lang-out}',slected_lang ('en'));
- $tpl->set ('{lang-outf}',slected_lang (''));
- $tpl->set ('{add-full}','');
- include_once ($rss_plugins.'inserttag.php');
- $tpl->set ('{inserttag}',$bb_js);
- $form .= "
- <script>
- $(function(){
- $('#tags').autocomplete({
- serviceUrl:'engine/ajax/tags_rss.php',
- minChars:3,
- delimiter: /(,|;)\s*/,
- maxHeight:400,
- width:348,
- deferRequestBy: 300
- });
- });
- </script>
- <script language=\"javascript\" type=\"text/javascript\">
- var skip = 0;
- var get = 0;
- var frag = 0;
- var zagolovok = 0;
- function simpletags(thetag)
- {
- doInsert(\"{\"+thetag+\"}\", \"\", false);
- }
- function ShowOrHideg( id ) {
- var item = document.getElementById(id);
- if ( document.getElementById('image-'+ id) ) {
- var image = document.getElementById('image-'+ id);
- } else {
- var image = null;
- }
- if (!item) {
- retun;
- } else {
- if (item.style) {
- if (item.style.display == \"none\") {
- item.style.display = \"\";
- image.src = './engine/inc/plugins/images/minus.gif';
- } else {
- item.style.display = \"none\";
- image.src = './engine/inc/plugins/images/plus.gif';
- }
- } else{ item.visibility = \"show\"; }
- }
- };
- </script>
- ";
- $tpl->set ('{opt_sys_yes}',$lang['opt_sys_yes']);
- $tpl->set ('{opt_sys_no}',$lang['opt_sys_no']);
- $tpl->set ('{BB_code}',$add_bb);
- $tpl->set ('{BB_codez}',$add_bbz);
- $tpl->set ('{BB_codezz}',$add_bbzz);
- foreach ($lang_grabber as $key =>$value)$tpl->set ('{'.$key.'}',$value);
- $tpl->copy_template = '<form method="post"><input type="hidden" name="action" value="channel" /><input type="hidden" name="subaction" value="doadd" />'.$tpl->copy_template .$form.'
- <input align="left" class="btn btn-success" type="submit" value=" '.$lang_grabber['save'].' " >
- <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" /></form>';
- $tpl->compile ('rss');
- echo $tpl->result['rss'];
- closetable ();
- echofooter ();$db->close;return 1;}
- if ($config_rss['get_proxy'] == 'yes') get_proxy();
- $config_rss['get_prox'] = $tab_id;
- if (($action == 'channel') and ($subaction == 'doadd')){
- $stop = false;
- $rss_url = stripslashes ($_POST['rss_url']);
- if ($_POST['category'] != ''){
- $category_post = $db->safesql( implode( ',',$_POST['category']));
- }else{$category_post = '0';}
- $category = $category_post.'='.intval ($_POST['rss_priv']);
- $allow_more = intval ($_POST['allow_more']);
- $allow_mod = intval ($_POST['allow_mod']);
- $allow_main = intval ($_POST['allow_main']);
- $allow_comm = intval ($_POST['allow_comm']);
- $allow_rate = intval ($_POST['allow_rate']);
- $auto = intval ($_POST['auto']);
- $load_images = $db->safesql ($_POST['load_img']);
- $thumb_images = intval ($_POST['thumb_img']);
- $allow_watermark = intval ($_POST['allow_watermark']);
- $date_format = intval ($_POST['news_date']);
- $ctp = intval ($_POST['so']).'='.intval ($_POST['po']);
- $dnast = intval ($_POST['image_align']).'='.intval ($_POST['image_align_full']).'='.intval ($_POST['show_symbol']).'='.intval ($_POST['show_metatitle']).'='.intval ($_POST['show_metadescr']).'='.intval ($_POST['show_keywords']).'='.intval ($_POST['show_url']).'='.intval ($_POST['rss_parse']).'='.intval ($_POST['tags_auto']).'='.intval ($_POST['auto_metatitle']).'='.intval ($_POST['data_deap']).'='.intval ($_POST['deap']).'='.intval ($_POST['auto_symbol']).'='.intval ($_POST['auto_numer']).'='.intval ($_POST['show_date_expires']).'='.intval ($_POST['wat_host']).'='.intval ($_POST['cron_auto']).'='.intval ($_POST['rewrite_data']).'='.intval ($_POST['ret_xf']).'='.intval ($_POST['kol_cron']).'='.$db->safesql ($_POST['tags_kol']).'='.intval ($_POST['tags_zag']).'='.intval ($_POST['start_title_f']).'='.$db->safesql ($_POST['watermark_image_light']).'='.$db->safesql ($_POST['watermark_image_dark']).'='.$db->safesql ($_POST['leech_shab']).'='.intval ($_POST['cross_post']).'='.intval ($_POST['cache_link']).'='.intval ($_POST['twitter_post']).'='.intval ($_POST['rewrite_con']).'='.intval ($_POST['rewrite_no']).'='.intval ($_POST['leech_dop']).'='.intval ($_POST['convert_utf']).'='.intval ($_POST['title_gener']).'='.(intval ($_POST['lang_title']) == 0 ?'1': '0').'='.intval ($_POST['lang_title_komb']).'='.intval ($_POST['image_align_post']).'='.intval ($_POST['max_image']).'='.intval ($_POST['min_image']).'='.$db->safesql ($_POST['kol_image_short']).'='.intval ($_POST['zip_image']);
- $full_link = stripslashes ($_POST['full_link']);
- $short_story = intval ($_POST['clear_short']).'='.intval ($_POST['short_img']).'='.intval ($_POST['short_full']).'='.intval ($_POST['sinonim']).'='.intval ($_POST['pings']).'='.$db->safesql ($_POST['teg_fix']).'='.intval ($_POST['cat_nul']).'='.intval ($_POST['keyw_sel']).'='.intval ($_POST['log_pas']).'='.intval ($_POST['text_html']).'='.intval ($_POST['descr_sel']).'='.intval ($_POST['title_prob']).'='.intval ($_POST['no_prow']).'='.intval ($_POST['lang_no']).'='.$db->safesql ($_POST['lang_in']).'='.$db->safesql ($_POST['lang_out']).'='.intval ($_POST['cat_sp']).'='.intval ($_POST['clear_full']).'='.$db->safesql ($_POST['lang_outf']).'='.intval ($_POST['sinonim_sel']).'='.intval ($_POST['add_full']).'='.(intval ($_POST['log_cookies']) == 0 ?'1': '0').'='.intval ($_POST['short_img_p']);
- $start_template = $db->safesql ($_POST['start_template']);
- $finish_template = $db->safesql (str_replace ('
- ','|||',$_POST['finish_template']));
- $dop_full = $db->safesql ($_POST['dop_full']);
- $start = $db->safesql (str_replace ('
- ','|||',$_POST['start']));
- $finish = $db->safesql (str_replace ('
- ','|||',$_POST['finish']));
- $delate = $db->safesql (str_replace ('
- ','|||',$_POST['delate']));
- $inser = $db->safesql (str_replace ('
- ','|||',$_POST['inser']));
- $symbol = $db->safesql ($_POST['symbols']);
- $ftags = $db->safesql ($_POST['tags']);
- $metatitle = $db->safesql ($_POST['meta_title']);
- $meta_descr = $db->safesql ($_POST['meta_descr']);
- $key_words = $db->safesql ($_POST['key_words']);
- $ful_start = $db->safesql ($_POST['ful_start']);
- $ful_end = $db->safesql ($_POST['ful_end']);
- $start_title = $db->safesql ($_POST['start_title']);
- $stitles = $db->safesql (str_replace ('
- ','|||',$_POST['s_del']));
- $ftitles = $db->safesql (str_replace ('
- ','|||',$_POST['end_del']));
- $end_title = $db->safesql ($_POST['s_title']).'=='.$db->safesql ($_POST['end_title']).'=='.$stitles.'=='.$ftitles.'=='.$db->safesql ($_POST['link_start_del']).'=='.$db->safesql ($_POST['link_finish_del']);
- $start_short = $db->safesql ($_POST['start_short']);
- $end_short = intval ($_POST['end_short']).'='.intval ($_POST['hide']).'='.intval ($_POST['leech']).'='.intval ($_POST['rewrite_news']);
- $sart_link = $db->safesql ($_POST['sart_link']);
- $end_link = intval ($_POST['end_link']);
- $sart_cat = $db->safesql ($_POST['sart_cat']).'|||'.$db->safesql ($_POST['shab_data']).'|||'.$db->safesql (str_replace ('
- ','===',$_POST['zhv_code']));
- $end_cat = $db->safesql ($_POST['end_cat']);
- $xdescr = $db->safesql($_POST['rss_xdescr']);
- $date = $db->safesql(trim($_POST['date'])).'='.intval ($_POST['dim_week']).'='.intval ($_POST['dim_date']).'='.intval ($_POST['dim_sait']).'='.intval ($_POST['dim_cat']);
- $cookies = $db->safesql (str_replace ('
- ','|||',$_POST['cookies']));
- $keywords = $db->safesql(str_replace ('
- ','|||',$_POST['keywords'])).'==='.$db->safesql($_POST['sfr_short']).'==='.$db->safesql($_POST['sfr_full']);
- $stkeywords = $db->safesql (str_replace ('
- ','|||',$_POST['stkeywords'])).'==='.$db->safesql($_POST['efr_short']).'==='.$db->safesql($_POST['efr_full']);
- if ($_POST['groups'] != '')$autor_grups = implode( ',',$_POST['groups']);
- $Autors = $db->safesql (str_replace ('
- ','|||',$_POST['Autors'])).'='.$autor_grups;
- $proxy = '';
- $kategory = $db->safesql (str_replace ('
- ','|||',$_POST['kategory']));
- if(trim($_POST['xfields_template_1']) != ''and $_POST['rss_xfields_1'] != '0')$xfields_template = $db->safesql ($_POST['rss_xfields_1']).'=='.$db->safesql ($_POST['xfields_template_1']).'=='.intval ($_POST['ret_xf_1']).'=='.intval ($_POST['sh_fl_1']).'=='.intval ($_POST['sh_im_1']).'=='.$db->safesql ($_POST['xfields_delete_1']).'=='.$db->safesql ($_POST['xfields_insert_1']).'=='.$db->safesql ($_POST['rs_im_1']).'=='.intval ($_POST['rs_sm_1']).'=='.intval ($_POST['sh_nw_1']);
- if (trim ($rss_url) == '')
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url'],'javascript:history.go(-1)');
- return 1;
- }
- if (!(ereg ('http://',$rss_url)) or reset_url($rss_url) == '')
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url_msg'],'javascript:history.go(-1)');
- return 1;
- }
- $rss_url = $db->safesql ($rss_url);
- $inf = $db->super_query ('SELECT id,title FROM '.PREFIX ."_rss WHERE url = '".trim($rss_url)."'");
- $rss_result = get_rss_channel_info ($rss_url,intval ($_POST['proxy']),$_POST['charset']);
- if ($rss_result['title'] != '')
- {
- $channel_title = $rss_result['title'];
- $channel_descr = $rss_result['description'];
- $rss = '1';
- }
- else
- {
- $channel_title = $rss_result['html'];
- $channel_descr = $rss_result['html'];
- $rss = '0';
- }
- if ($rss_result['charset'] != '') $_POST['charset'] = $rss_result['charset'];
- if ($rss == '1'){
- $start_short = '';
- $sart_link = '';
- $ctp = '';
- }
- $dop_nast = intval ($_POST['dop_watermark']).'='.intval ($_POST['text_url']).'='.intval ($_POST['proxy']).'='.intval ($_POST['x']).'='.intval ($_POST['y']).'='.intval ($_POST['show_autor']).'='.$db->safesql ($_POST['show_tegs']).'='.intval ($_POST['show_date']).'='.intval ($_POST['show_code']).'='.intval ($_POST['show_f']).'='.intval ($_POST['null']).'='.intval ($_POST['one_serv']).'='.intval ($_POST['margin']).'='.intval ($_POST['show_down']).'='.$_POST['charset'].'='.intval ($_POST['dubl_host']).'='.intval ($_POST['text_url_sel']).'='.intval ($_POST['parse_url_sel']).'='.intval ($_POST['full_url_and']).'='.intval ($_POST['grab_pause']).'='.intval ($_POST['step_page']).'='.intval ($_POST['add_pause']).'='.intval ($_POST['kol_short']).'='.intval ($_POST['page_break']).'='.$db->safesql ($_POST['sim_short']).'='.intval ($_POST['starter_page']);
- $files = intval($_POST['files_video']).'=='.$db->safesql ($_POST['pap_video']).'=='.intval($_POST['files_rar']).'=='.$db->safesql ($_POST['rar_video']).'=='.intval($_POST['files_zip']).'=='.$db->safesql ($_POST['pap_zip']).'=='.intval($_POST['files_doc']).'=='.$db->safesql ($_POST['pap_doc']).'=='.intval($_POST['files_txt']).'=='.$db->safesql ($_POST['pap_txt']).'=='.intval($_POST['files_dle']).'=='.$db->safesql ($_POST['pap_dle']).'=='.intval($_POST['url_video']).'=='.intval($_POST['url_rar']).'=='.intval($_POST['url_zip']).'=='.intval($_POST['url_doc']).'=='.intval($_POST['url_txt']).'=='.intval($_POST['url_dle']).'=='.intval($_POST['tit_video']).'=='.intval($_POST['tit_rar']).'=='.intval($_POST['tit_zip']).'=='.intval($_POST['tit_doc']).'=='.intval($_POST['tit_txt']).'=='.intval($_POST['tit_dle']).'=='.intval($_POST['files_atach']).'=='.$db->safesql($_POST['file_name']).'=='.intval($_POST['files_tor']).'=='.intval($_POST['url_tor']).'=='.intval($_POST['tit_tor']).'=='.$db->safesql ($_POST['pap_tor']).'=='.intval($_POST['tor_torrage']);
- if ($stop == false)
- {
- $sql_result = $db->query ('SELECT url FROM '.PREFIX .'_rss');
- $pnum = $db->num_rows ($sql_result) +1;
- $channel_title = $db->safesql ($channel_title);
- $channel_descr = $db->safesql ($channel_descr);
- $sql_query = 'INSERT INTO '.PREFIX ."_rss (url, title, descr, category, allow_main, allow_comm, allow_rate, allow_auto, load_img, allow_more, start_template, finish_template, cookies, allow_watermark, date_format, keywords, Autors, thumb_img, allow_mod, stkeywords, rss, ful_start, start_title, start_short, end_short, sart_link, end_link, sart_cat, xdescr, xpos, delate, inser, start, finish, end_title, short_story, dop_nast, ctp, full_link, date, dnast, symbol, ftags, metatitle, meta_descr, key_words, kategory, xfields_template, dop_full, files) VALUES ('$rss_url', '$channel_title', '$channel_descr', '$category', '$allow_main', '$allow_comm', '$allow_rate', '$auto', '$load_images', '$allow_more', '$start_template', '$finish_template', '$cookies', '$allow_watermark', '$date_format', '$keywords', '$Autors', '$thumb_images', '$allow_mod', '$stkeywords', '$rss', '$ful_start', '$start_title', '$start_short', '$end_short', '$sart_link', '$end_link', '$sart_cat', '$xdescr', '$pnum', '$delate', '$inser', '$start', '$finish', '$end_title', '$short_story', '$dop_nast', '$ctp', '$full_link', '$date', '$dnast', '$symbol', '$ftags', '$metatitle', '$meta_descr', '$key_words', '$kategory', '$xfields_template' ,'$dop_full', '$files')";
- $db->query ($sql_query);
- $rss_id = $db->insert_id();
- if (trim ($channel_title) != '')
- {
- $title = stripslashes (strip_tags_smart ($channel_title));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- if ($rss == 1){
- $mgs = $lang_grabber['channel'].' №'.$pnum.' <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['add_msg_rss'].'</font><br />';
- msg ($lang_grabber['info'],$lang_grabber['add_channel_ms'],$mgs.((count($inf)!=0)?'<br />* * *<br /><b style="color:#ff0000;">'.$lang_grabber['add_msg_er'].'</b><br /><br /><a class="list" href="admin.php?mod=rssaction=channel&subaction=edit&id='.$inf['id'].'"><b style="color:blue;">'.$inf['title'].'</b></a>':''),$PHP_SELF .'?mod=rss');
- return 1;
- }else{
- $mgs = $lang_grabber['channel'].' № <b>'.$pnum.'</b> => <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['add_msg_html'].'</font><br />';
- msg ($lang_grabber['info'],$lang_grabber['add_channel_ms'],$mgs.((count($inf)!=0)?'<br />* * *<br /><b style="color:#ff0000;">'.$lang_grabber['add_msg_er'].'</b><br /><br /><a class="list" href="admin.php?mod=rss&action=channel&subaction=edit&id='.$inf['id'].'"><b style="color:blue;">'.$inf['title'].'</b></a>':''),$PHP_SELF .'?mod=rss');
- $db->close;
- return 1;
- }
- }
- }
- if (($action == 'channel') and ($subaction == 'do_change')){
- if (isset ($id))
- {
- $stop = false;
- if (!((!(trim ($id) == '') AND !($id == 0))))
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['channel_msg_id'],'javascript:history.go(-1)');
- return 1;
- }
- $row = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$id'");
- if ($_POST['category'] != ''){
- $category_post = $db->safesql( implode( ',',$_POST['category']));
- }else{$category_post = '0';}
- $category = $category_post.'='.intval ($_POST['rss_priv']);
- $allow_main = intval ($_POST['allow_main']);
- $allow_mod = intval ($_POST['allow_mod']);
- $allow_comm = intval ($_POST['allow_comm']);
- $allow_load = $db->safesql ($_POST['load_img']);
- $thumb_images = intval ($_POST['thumb_img']);
- $allow_rate = intval ($_POST['allow_rate']);
- $allow_auto = intval ($_POST['auto']);
- $allow_more = intval ($_POST['allow_more']);
- $allow_water = intval ($_POST['allow_watermark']);
- $date_format = intval ($_POST['news_date']);
- $symbol = $db->safesql ($_POST['symbols']);
- $ftags = $db->safesql ($_POST['tags']);
- $metatitle = $db->safesql ($_POST['meta_title']);
- $meta_descr = $db->safesql ($_POST['meta_descr']);
- $key_words = $db->safesql ($_POST['key_words']);
- $dnast = intval ($_POST['image_align']).'='.intval ($_POST['image_align_full']).'='.intval ($_POST['show_symbol']).'='.intval ($_POST['show_metatitle']).'='.intval ($_POST['show_metadescr']).'='.intval ($_POST['show_keywords']).'='.intval ($_POST['show_url']).'='.intval ($_POST['rss_parse']).'='.intval ($_POST['tags_auto']).'='.intval ($_POST['auto_metatitle']).'='.intval ($_POST['data_deap']).'='.intval ($_POST['deap']).'='.intval ($_POST['auto_symbol']).'='.intval ($_POST['auto_numer']).'='.intval ($_POST['show_date_expires']).'='.intval ($_POST['wat_host']).'='.intval ($_POST['cron_auto']).'='.intval ($_POST['rewrite_data']).'='.intval ($_POST['ret_xf']).'='.intval ($_POST['kol_cron']).'='.$db->safesql ($_POST['tags_kol']).'='.intval ($_POST['tags_zag']).'='.intval ($_POST['start_title_f']).'='.$db->safesql ($_POST['watermark_image_light']).'='.$db->safesql ($_POST['watermark_image_dark']).'='.$db->safesql ($_POST['leech_shab']).'='.intval ($_POST['cross_post']).'='.intval ($_POST['cache_link']).'='.intval ($_POST['twitter_post']).'='.intval ($_POST['rewrite_con']).'='.intval ($_POST['rewrite_no']).'='.intval ($_POST['leech_dop']).'='.intval ($_POST['convert_utf']).'='.intval ($_POST['title_gener']).'='.(intval ($_POST['lang_title']) == 0 ?'1': '0').'='.intval ($_POST['lang_title_komb']).'='.intval ($_POST['image_align_post']).'='.intval ($_POST['max_image']).'='.intval ($_POST['min_image']).'='.$db->safesql ($_POST['kol_image_short']).'='.intval($_POST['zip_image']);
- $short_story = intval ($_POST['clear_short']).'='.intval ($_POST['short_img']).'='.intval ($_POST['short_full']).'='.intval ($_POST['sinonim']).'='.intval ($_POST['pings']).'='.$db->safesql ($_POST['teg_fix']).'='.intval ($_POST['cat_nul']).'='.intval ($_POST['keyw_sel']).'='.intval ($_POST['log_pas']).'='.intval ($_POST['text_html']).'='.intval ($_POST['descr_sel']).'='.intval ($_POST['title_prob']).'='.intval ($_POST['no_prow']).'='.intval ($_POST['lang_on']).'='.$db->safesql ($_POST['lang_in']).'='.$db->safesql ($_POST['lang_out']).'='.intval ($_POST['cat_sp']).'='.intval ($_POST['clear_full']).'='.$db->safesql ($_POST['lang_outf']).'='.intval ($_POST['sinonim_sel']).'='.intval ($_POST['add_full']).'='.(intval ($_POST['log_cookies']) == 0 ?'1': '0').'='.intval ($_POST['short_img_p']);
- $ctp = intval ($_POST['so']).'='.intval ($_POST['po']);
- $full_link = stripslashes ($_POST['full_link']);
- $date = $db->safesql(trim($_POST['date'])).'='.intval ($_POST['dim_week']).'='.intval ($_POST['dim_date']).'='.intval ($_POST['dim_sait']).'='.intval ($_POST['dim_cat']);
- $original_rss_url = $row['url'];
- $rss_url = $db->safesql ($_POST['rss_url']);
- $rss = intval ($_POST['rss_html']);
- if (trim ($rss_url) == '')
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url'],'javascript:history.go(-1)');
- return 1;
- }
- if (!(ereg ('http://',$rss_url)) or reset_url($rss_url) == '')
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url_msg'],'javascript:history.go(-1)');
- return 1;
- }
- if ($original_rss_url != $rss_url)
- {
- $inf = $db->super_query ('SELECT title FROM '.PREFIX ."_rss WHERE url = '".trim($rss_url)."'");
- $rss_result = get_rss_channel_info ($rss_url,intval ($_POST['proxy']),$_POST['charset']);
- if ($rss_result['title'] != '')
- {
- $channel_title = $rss_result['title'];
- $channel_descr = $rss_result['description'];
- $rss = '1';
- }
- else
- {
- $channel_title = $rss_result['html'];
- $channel_descr = $rss_result['html'];
- $rss = '0';
- }
- }
- else
- {
- $channel_title = $db->safesql($_POST['rss_title']);
- }
- if ($stop == false)
- {
- $cookies = $db->safesql (str_replace ('
- ','|||',$_POST['cookies']));
- $keywords = $db->safesql(str_replace ('
- ','|||',$_POST['keywords'])).'==='.$db->safesql($_POST['sfr_short']).'==='.$db->safesql($_POST['sfr_full']);
- $stkeywords = $db->safesql (str_replace ('
- ','|||',$_POST['stkeywords'])).'==='.$db->safesql($_POST['efr_short']).'==='.$db->safesql($_POST['efr_full']);
- if ($_POST['groups'] != '')$autor_grups = implode( ',',$_POST['groups']);
- $Autors = $db->safesql (str_replace ('
- ','|||',$_POST['Autors'])).'='.$autor_grups;
- $xdescr = $db->safesql ($_POST['rss_xdescr']);
- $start_template = $db->safesql ($_POST['start_template']);
- $finish_template = $db->safesql (str_replace ('
- ','|||',$_POST['finish_template']));
- $delate = $db->safesql (str_replace ('
- ','|||',$_POST['delate']));
- $inser = $db->safesql (str_replace ('
- ','|||',$_POST['inser']));
- $start = $db->safesql(str_replace ('
- ','|||',$_POST['start']));
- $finish = $db->safesql( str_replace ('
- ','|||',$_POST['finish']));
- $ful_start = $db->safesql ($_POST['ful_start']);
- $ful_end = $db->safesql ($_POST['ful_end']);
- $start_title = $db->safesql ($_POST['start_title']);
- $stitles = $db->safesql (str_replace ('
- ','|||',$_POST['s_del']));
- $ftitles = $db->safesql (str_replace ('
- ','|||',$_POST['end_del']));
- $kategory = $db->safesql (str_replace ('
- ','|||',$_POST['kategory']));
- if ($rss_result['charset'] != '') $_POST['charset'] = $rss_result['charset'];
- $dop_nast = intval ($_POST['dop_watermark']).'='.intval ($_POST['text_url']).'='.intval ($_POST['proxy']).'='.intval ($_POST['x']).'='.intval ($_POST['y']).'='.intval ($_POST['show_autor']).'='.intval ($_POST['show_tegs']).'='.intval ($_POST['show_date']).'='.intval ($_POST['show_code']).'='.intval ($_POST['show_f']).'='.intval ($_POST['null']).'='.intval ($_POST['one_serv']).'='.intval ($_POST['margin']).'='.intval ($_POST['show_down']).'='.$_POST['charset'].'='.intval ($_POST['dubl_host']).'='.intval ($_POST['text_url_sel']).'='.intval ($_POST['parse_url_sel']).'='.intval ($_POST['full_url_and']).'='.intval ($_POST['grab_pause']).'='.intval ($_POST['step_page']).'='.intval ($_POST['add_pause']).'='.intval ($_POST['kol_short']).'='.intval ($_POST['page_break']).'='.$db->safesql ($_POST['sim_short']).'='.intval ($_POST['starter_page']);;
- $end_title = $db->safesql ($_POST['s_title']).'=='.$db->safesql ($_POST['end_title']).'=='.$stitles.'=='.$ftitles.'=='.$db->safesql ($_POST['link_start_del']).'=='.$db->safesql ($_POST['link_finish_del']);
- $start_short = $db->safesql ($_POST['start_short']);
- $end_short = intval ($_POST['end_short']).'='.intval ($_POST['hide']).'='.intval ($_POST['leech']).'='.intval ($_POST['rewrite_news']);
- $sart_link = $db->safesql ($_POST['sart_link']);
- $end_link = intval ($_POST['end_link']);
- $sart_cat = $db->safesql ($_POST['sart_cat']).'|||'.$db->safesql ($_POST['shab_data']).'|||'.$db->safesql (str_replace ('
- ','===',$_POST['zhv_code']));
- $end_cat = $db->safesql ($_POST['end_cat']);
- $dop_full = $db->safesql ($_POST['dop_full']);
- if ($rss == '1'){
- $start_short = '';
- $sart_link = '';
- $ctp = '';
- }
- for ($x=0;$x++<$_POST['kol_xfields'];){
- if (trim($_POST['xfields_template_'.$x]) != ''and $_POST['rss_xfields_'.$x] != '0'){$templ[] = $xfields_template = $db->safesql ($_POST['rss_xfields_'.$x]).'=='.$db->safesql ($_POST['xfields_template_'.$x]).'=='.intval ($_POST['ret_xf_'.$x]).'=='.intval ($_POST['sh_fl_'.$x]).'=='.intval ($_POST['sh_im_'.$x]).'=='.$db->safesql ($_POST['xfields_delete_'.$x]).'=='.$db->safesql ($_POST['xfields_insert_'.$x]).'=='.$db->safesql ($_POST['rs_im_'.$x]).'=='.intval ($_POST['rs_sm_'.$x]).'=='.intval ($_POST['sh_nw_'.$x]);
- }
- }
- if($templ)$xfields_template = implode ('|||',$templ);
- else $xfields_template = '';
- $files = intval($_POST['files_video']).'=='.$db->safesql ($_POST['pap_video']).'=='.intval($_POST['files_rar']).'=='.$db->safesql ($_POST['rar_video']).'=='.intval($_POST['files_zip']).'=='.$db->safesql ($_POST['pap_zip']).'=='.intval($_POST['files_doc']).'=='.$db->safesql ($_POST['pap_doc']).'=='.intval($_POST['files_txt']).'=='.$db->safesql ($_POST['pap_txt']).'=='.intval($_POST['files_dle']).'=='.$db->safesql ($_POST['pap_dle']).'=='.intval($_POST['url_video']).'=='.intval($_POST['url_rar']).'=='.intval($_POST['url_zip']).'=='.intval($_POST['url_doc']).'=='.intval($_POST['url_txt']).'=='.intval($_POST['url_dle']).'=='.intval($_POST['tit_video']).'=='.intval($_POST['tit_rar']).'=='.intval($_POST['tit_zip']).'=='.intval($_POST['tit_doc']).'=='.intval($_POST['tit_txt']).'=='.intval($_POST['tit_dle']).'=='.intval($_POST['files_atach']).'=='.$db->safesql($_POST['file_name']).'=='.intval($_POST['files_tor']).'=='.intval($_POST['url_tor']).'=='.intval($_POST['tit_tor']).'=='.$db->safesql ($_POST['pap_tor']).'=='.intval($_POST['tor_torrage']);
- $channel_title = $db->safesql ($channel_title);
- $channel_descr = $db->safesql ($channel_descr);
- $db->query( 'UPDATE '.PREFIX ."_rss SET title = '$channel_title', descr = '$channel_descr', rss = '$rss',category='$category', allow_main = '$allow_main', allow_comm = '$allow_comm', allow_auto = '$allow_auto', allow_more ='$allow_more', allow_rate ='$allow_rate', cookies ='$cookies', start_template ='$start_template', finish_template ='$finish_template', delate = '$delate', load_img ='$allow_load', url ='$rss_url', allow_watermark ='$allow_water', date_format ='$date_format', keywords ='$keywords', Autors ='$Autors', thumb_img ='$thumb_images', allow_mod ='$allow_mod', stkeywords ='$stkeywords', ful_start='$ful_start', start_title='$start_title', start_short='$start_short', end_short='$end_short', sart_link='$sart_link', sart_cat='$sart_cat', xdescr='$xdescr', inser='$inser', start='$start', finish='$finish', end_title = '$end_title', end_link = '$end_link', short_story='$short_story', dop_nast='$dop_nast', full_link='$full_link', ctp='$ctp', date= '$date', dnast='$dnast', symbol='$symbol', ftags='$ftags', metatitle='$metatitle', meta_descr='$meta_descr', key_words='$key_words', kategory='$kategory', xfields_template='$xfields_template', dop_full='$dop_full', files='$files' WHERE id ='$id'");
- if (!$inf)header('Status: 204 ');
- if (trim ($channel_title) != '')
- {
- $title = stripslashes (strip_tags_smart ($channel_title));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs = $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['edit_channel_ok'].'</font><br />';
- msg ($lang_grabber['info'],$lang_grabber['change_channel'],$mgs.($inf?'<br />* * *<br /><b style="color:#ff0000;">'.$lang_grabber['add_msg_er'].'</b><br /><br /><a class="list" href="admin.php?mod=rss&action=channel&subaction=edit&id='.$inf['id'].'"><b style="color:blue;">'.$inf['title'].'</b></a>':'').'<br> <a href="'.$PHP_SELF .'?mod=rss" class="btn btn-success" style="text-decoration: none;color:#fff;">'.$lang_grabber['go_index'].'</a> <a style="text-decoration: none;color:#fff;" class="btn btn-warning" href="javascript:history.go(-1)">'.$lang_grabber['back'].'</a>');
- $db->close;
- return 1;
- }
- }
- }
- if (($action == 'channel') and ($subaction == 'edit')){
- if (isset ($id))
- {
- if (!((!(trim ($id) == '') AND !($id == 0))))
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['channel_msg_id'],'javascript:history.go(-1)');
- return 1;
- }
- $rss_channel_info = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$id'");
- $cookies = str_replace ('|||','
- ',stripslashes($rss_channel_info['cookies']));
- $keywordsd = explode('===',$rss_channel_info['keywords']);
- $keywords = str_replace ('|||','
- ',stripslashes ($keywordsd[0]));
- $stkeywordsd = explode('===',$rss_channel_info['stkeywords']);
- $stkeywords = str_replace ('|||','
- ',stripslashes ($stkeywordsd[0]));
- $Autor = explode('=',$rss_channel_info['Autors']);
- $Autors = str_replace ('|||','
- ',stripslashes ($Autor['0']));
- $short_story = explode('=',$rss_channel_info['short_story']);
- $date = explode('=',$rss_channel_info['date']);
- $delate = str_replace ('|||','
- ',stripslashes ($rss_channel_info['delate']));
- $inser = str_replace ('|||','
- ',stripslashes ($rss_channel_info['inser']));
- $start = str_replace ('|||','
- ',$rss_channel_info['start']);
- $finish = str_replace ('|||','
- ',$rss_channel_info['finish']);
- $end_title = explode ('==',$rss_channel_info['end_title']);
- $hide_leech = explode('=',$rss_channel_info['end_short']);
- $ctp = explode ('=',$rss_channel_info['ctp']);
- $dop_nast = explode ('=',$rss_channel_info['dop_nast']);
- $dnast = explode ('=',$rss_channel_info['dnast']);
- $categoryes = explode ('=',$rss_channel_info['category']);
- $stitles = str_replace ('|||','
- ',$end_title[2]);
- $ftitles = str_replace ('|||','
- ',$end_title[3]);
- $kategory = str_replace ('|||','
- ',$rss_channel_info['kategory']);
- if(strlen(stripslashes ($date[0])) == 10) $date[0] = '';
- $files = explode('==',$rss_channel_info['files']);
- echoheader ('','');
- if (trim ($rss_channel_info['title']) != '')
- {
- $channel_name = '</br> <font color=green> №'.$rss_channel_info['xpos'].' - '.stripslashes ($rss_channel_info['title']) .'</font> (<font color=red>'.stripslashes ($rss_channel_info['url']) .'</font>) <a href="'.$rss_channel_info['url'] .'" target="_blank">[i]</a>';
- }
- $channel_inf = array();
- $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
- $run[0] = '';
- while ($channel_info = $db->get_row($sql_result)) {
- if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] = $channel_info['title'];
- else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
- }
- foreach($channel_inf as $value)
- {
- if (count($value) != '0'){
- foreach($value as $kkey=>$key)
- {
- $run[$kkey] = $key;
- }
- }
- }
- opentable ('<a href='.$PHP_SELF .'?mod=rss>'.$lang_grabber['index_page'] .$lang_grabber['change_channel'] .$channel_name);
- $tpl->load_template ('rss_addchannel.tpl');
- $tpl->set ('{file-video}',($files[0] == 0 ?'': 'checked'));
- $tpl->set ('{file-rar}',($files[2] == 0 ?'': 'checked'));
- $tpl->set ('{file-zip}',($files[4] == 0 ?'': 'checked'));
- $tpl->set ('{file-doc}',($files[6] == 0 ?'': 'checked'));
- $tpl->set ('{file-txt}',($files[8] == 0 ?'': 'checked'));
- $tpl->set ('{file-dle}',($files[10] == 0 ?'': 'checked'));
- $tpl->set ('{file-tor}',($files[26] == 0 ?'': 'checked'));
- $tpl->set ('{url-video}',($files[12] == 0 ?'': 'checked'));
- $tpl->set ('{url-rar}',($files[13] == 0 ?'': 'checked'));
- $tpl->set ('{url-zip}',($files[14] == 0 ?'': 'checked'));
- $tpl->set ('{url-doc}',($files[15] == 0 ?'': 'checked'));
- $tpl->set ('{url-txt}',($files[16] == 0 ?'': 'checked'));
- $tpl->set ('{url-dle}',($files[17] == 0 ?'': 'checked'));
- $tpl->set ('{url-tor}',($files[27] == 0 ?'': 'checked'));
- $tpl->set ('{tit-video}',($files[18] == 0 ?'': 'checked'));
- $tpl->set ('{tit-rar}',($files[19] == 0 ?'': 'checked'));
- $tpl->set ('{tit-zip}',($files[20] == 0 ?'': 'checked'));
- $tpl->set ('{tit-doc}',($files[21] == 0 ?'': 'checked'));
- $tpl->set ('{tit-txt}',($files[22] == 0 ?'': 'checked'));
- $tpl->set ('{tit-dle}',($files[23] == 0 ?'': 'checked'));
- $tpl->set ('{tit-tor}',($files[28] == 0 ?'': 'checked'));
- $tpl->set ('{file-atach}',($files[24] == 0 ?'': 'checked'));
- $tpl->set ('{file-name}',$files[25]);
- $tpl->set ('{tor-torrage}',($files[30] == 0 ?'': 'checked'));
- $tpl->set ('{pap-video}',$files[1]);
- $tpl->set ('{pap-rar}',$files[3]);
- $tpl->set ('{pap-zip}',$files[5]);
- $tpl->set ('{pap-doc}',$files[7]);
- $tpl->set ('{pap-txt}',$files[9]);
- $tpl->set ('{pap-dle}',$files[11]);
- $tpl->set ('{pap-tor}',$files[29]);
- $tpl->set ('{rss_html}',($rss_channel_info['rss'] == 0 ?'': 'checked'));
- $tpl->set ('{stkeywords}',$stkeywords);
- $tpl->set ('{charsets}',$dop_nast[14]);
- $tpl->set ('{dubl-host}',($dop_nast[15] == 0 ?'': 'checked'));
- $tpl->set ('{cache-link}',($dnast[27] == 0 ?'': 'checked'));
- $tpl->set ('{one-serv}',($dop_nast[11] == 0 ?'': 'checked'));
- $tpl->set ('{title}',$rss_channel_info['title']);
- $tpl->set ('{discr}',stripslashes ($rss_channel_info['descr']));
- $tpl->set ('{address}',stripslashes ($rss_channel_info['url']));
- $tpl->set ('{date-format}',gen_date_format ($rss_channel_info['date_format']));
- $tpl->set ('{category}',categorynewsselection (explode(',',$categoryes[0]),0));
- $tpl->set ('{rss-priv}',sel ($run,$categoryes[1]));
- $tpl->set ('{groups}',get_groups(explode(',',$Autor['1'])));
- $tpl->set ('{load-images}',($rss_channel_info['load_img'] == 0 ?'': 'checked'));
- $tpl->set ('{thumb-images}',($rss_channel_info['thumb_img'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-main}',($rss_channel_info['allow_main'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-mod}',($rss_channel_info['allow_mod'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-comm}',($rss_channel_info['allow_comm'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-rate}',($rss_channel_info['allow_rate'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-full}',($rss_channel_info['allow_more'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-auto}',($rss_channel_info['allow_auto'] == 0 ?'': 'checked'));
- $tpl->set ('{allow-water}',($rss_channel_info['allow_watermark'] == 0 ?'': 'checked'));
- $tpl->set ('{show_autor}',($dop_nast[5] == 0 ?'': 'checked'));
- $tpl->set ('{show_tegs}',($dop_nast[6] == 0 ?'': 'checked'));
- $tpl->set ('{show_date}',($dop_nast[7] == 0 ?'': 'checked'));
- $tpl->set ('{show_code}',($dop_nast[8] == 0 ?'': 'checked'));
- $tpl->set ('{show_down}',($dop_nast[13] == 0 ?'': 'checked'));
- $tpl->set ('{show_f}',($dop_nast[9] == 0 ?'': 'checked'));
- $tpl->set ('{show_symbol}',($dnast[2] == 0 ?'': 'checked'));
- $tpl->set ('{show_metatitle}',($dnast[3] == 0 ?'': 'checked'));
- $tpl->set ('{show_metadescr}',($dnast[4] == 0 ?'': 'checked'));
- $tpl->set ('{show_keywords}',($dnast[5] == 0 ?'': 'checked'));
- $tpl->set ('{wat-host}',($dnast[15] == 0 ?'': 'checked'));
- $tpl->set ('{rewrite-data}',($dnast[17] == 0 ?'': 'checked'));
- $tpl->set ('{show-url}',($dnast[6] == 0 ?'': 'checked'));
- $tpl->set ('{cron-auto}',$dnast[16]);
- $tpl->set ('{kol-cron}',$dnast[19]);
- $tpl->set ('{tags-kol}',$dnast[20]);
- $tpl->set ('{rss-parse}',sel (array ('0'=>$lang_grabber['no_thumb'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full'],'3'=>$lang_grabber['thumb_shortfull']),$dnast[7]));
- $tpl->set ('{tags-auto}',($dnast[8] == 0 ?'': 'checked'));
- $tpl->set ('{tags-zag}',($dnast[21] == 0 ?'': 'checked'));
- $tpl->set ('{auto-metatitle}',($dnast[9] == 0 ?'': 'checked'));
- $tpl->set ('{data-deap}',$dnast[10]);
- $tpl->set ('{max-image}',$dnast[37]);
- $tpl->set ('{deap}',deap ($dnast[11] == 0 ?'yes': 'no'));
- $tpl->set ('{symbol}',$rss_channel_info['symbol']);
- $tpl->set ('{auto-symbol}',($dnast[12] == 0 ?'': 'checked'));
- $tpl->set ('{auto-numer}',sel (array(1 =>'1',2 =>'2',3 =>'3'),$dnast[13] ));
- $tpl->set ('{show_date_expires}',($dnast[14] == 0 ?'': 'checked'));
- $tpl->set ('{tags}',$rss_channel_info['ftags']);
- $tpl->set ('{meta-title}',$rss_channel_info['metatitle']);
- $tpl->set ('{meta-descr}',$rss_channel_info['meta_descr']);
- $tpl->set ('{key-words}',$rss_channel_info['key_words']);
- $tpl->set ('{hide}',($hide_leech[1] == 0 ?'': 'checked'));
- $tpl->set ('{leech}',($hide_leech[2] == 0 ?'': 'checked'));
- $tpl->set ('{leech-shab}',stripslashes ($dnast[25]));
- $tpl->set ('{rewrite-news}',($hide_leech[3] == 0 ?'': 'checked'));
- $tpl->set ('{rewrite-con}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$dnast[29]));
- $tpl->set ('{rewrite-no}',($dnast[30] == 0 ?'': 'checked'));
- $tpl->set ('{leech-dop}',($dnast[31] == 0 ?'': 'checked'));
- $tpl->set ('{convert-utf}',($dnast[32] == 0 ?'': 'checked'));
- $tpl->set ('{title-gener}',($dnast[33] == 0 ?'': 'checked'));
- $tpl->set ('{clear-short}',($short_story[0] == 0 ?'': 'checked'));
- $tpl->set ('{clear-full}',($short_story[17] == 0 ?'': 'checked'));
- $tpl->set ('{short-images}',($short_story[1] == 0 ?'': 'checked'));
- $tpl->set ('{short-images-p}',sel (array(0 =>$lang_grabber['sel_lu'],1 =>$lang['upload_t_seite_2'],2 =>$lang['upload_t_seite_3']),$short_story[22]));
- $tpl->set ('{kol-image-short}',$dnast[39]);
- $tpl->set ('{zip-image}',($dnast[40] == 0 ?'': 'checked'));
- $tpl->set ('{min-image}',$dnast[38]);
- $tpl->set ('{short-full}',($short_story[2] == 0 ?'': 'checked'));
- $tpl->set ('{pings}',($short_story[4] == 0 ?'': 'checked'));
- $tpl->set ('{teg-fix}',stripslashes ($short_story[5]));
- $tpl->set ('{cat-nul}',($short_story[6] == 0 ?'': 'checked'));
- $tpl->set ('{text-html}',($short_story[9] == 0 ?'': 'checked'));
- $tpl->set ('{dim-week}',($date[1] == 0 ?'': 'checked'));
- $tpl->set ('{dim-date}',($date[2] == 0 ?'': 'checked'));
- $tpl->set ('{dim-sait}',($date[3] == 0 ?'': 'checked'));
- $tpl->set ('{dim-cat}',($date[4] == 0 ?'': 'checked'));
- $tpl->set ('{title-prob}',($short_story[11] == 0 ?'': 'checked'));
- $tpl->set ('{no-prow}',dubl_news ($short_story[12]));
- $tpl->set ('{grab-pause}',$dop_nast[19]);
- $tpl->set ('{add-pause}',$dop_nast[21]);
- $tpl->set ('{kol-short}',$dop_nast[22]);
- $tpl->set ('{sim-short}',$dop_nast[24]);
- $tpl->set ('{starter-page}',$dop_nast[25]);
- $tpl->set ('{page-break}',$dop_nast[23]);
- $tpl->set ('{image-align}',gen_x ($dnast[0],4));
- $tpl->set ('{image-align-full}',gen_x ($dnast[1],4));
- $tpl->set ('{image-align-post}',gen_x ($dnast[36] == ''?$dnast[1]:$dnast[36],4));
- $tpl->set ('{start-template}',str_replace ('&','&',stripslashes ($rss_channel_info['start_template'])));
- $tpl->set ('{end-template}',str_replace ('&','&',stripslashes (str_replace ('|||','
- ',$rss_channel_info['finish_template']))));
- $finish = str_replace ('|||','
- ',$rss_channel_info['finish']);
- $tpl->set ('{x}',gen_x ($dop_nast[3]));
- $tpl->set ('{y}',gen_y ($dop_nast[4]));
- $tpl->set ('{delate}',stripslashes (@htmlspecialchars($delate,ENT_QUOTES )));
- $tpl->set ('{inser}',stripslashes (@htmlspecialchars($inser,ENT_QUOTES )));
- $tpl->set ('{start}',stripslashes (@htmlspecialchars($start,ENT_QUOTES )));
- $tpl->set ('{finish}',stripslashes (@htmlspecialchars($finish,ENT_QUOTES )));
- $tpl->set ('{full-link}',stripslashes (@htmlspecialchars($rss_channel_info['full_link'],ENT_QUOTES )));
- $tpl->set ('{dop-full}',stripslashes (@htmlspecialchars($rss_channel_info['dop_full'],ENT_QUOTES )));
- $tpl->set ('{so}',$ctp[0]);
- $tpl->set ('{po}',$ctp[1]);
- $tpl->set ('{dop-watermark}',($dop_nast[0] == 0 ?'': 'checked'));
- $tpl->set ('{watermark-image-light}',stripslashes ($dnast[23]));
- $tpl->set ('{watermark-image-dark}',stripslashes ($dnast[24]));
- $tpl->set ('{add-full}',($short_story[20] == 0 ?'': 'checked'));
- $tpl->set ('{lang-title}',($dnast[34] == 1 ?'': 'checked'));
- $tpl->set ('{lang-title-komb}',($dnast[35] == 0 ?'': 'checked'));
- $tpl->set ('{lang-on}',($short_story[13] == 0 ?'': 'checked'));
- $tpl->set ('{lang-in}',slected_lang($short_story[14] == ''?'ru': $short_story[14]));
- $tpl->set ('{lang-out}',slected_lang ($short_story[15] == ''?'en': $short_story[15]));
- $tpl->set ('{lang-in}',slected_lang($short_story[14] == ''?'ru': $short_story[14]));
- $tpl->set ('{lang-outf}',slected_lang ($short_story[18] == ''?'': $short_story[18]));
- $tpl->set ('{cat-sp}',($short_story[16] == 0 ?'': 'checked'));
- $tpl->set ('{text-url-sel}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$dop_nast[16]));
- $tpl->set ('{full-url-and}',($dop_nast[18] == 0 ?'': 'checked'));
- $tpl->set ('{parse-url-sel}',sel (array ('0'=>$lang_grabber['no_thumb'],'1'=>$lang_grabber['thumb_full'],'2'=>$lang_grabber['thumb_short'],'3'=>$lang_grabber['thumb_shortfull']),$dop_nast[17]));
- $tpl->set ('{log-pas}',($short_story[8] == 0 ?'': 'checked'));
- $tpl->set ('{log-cookies}',($short_story[21] == 1 ?'': 'checked'));
- $tpl->set ('{keyw-sel}',sel (array(0 =>$lang_grabber['sel_shortfull'],1 =>$lang_grabber['sel_short'],2 =>$lang_grabber['sel_full'],3 =>$lang_grabber['sel_short_full'],4 =>$lang_grabber['sel_no_gener'],5 =>$lang_grabber['sel_don']),$short_story[7]));
- $tpl->set ('{descr-sel}',sel (array(0 =>$lang_grabber['sel_shortfull'],1 =>$lang_grabber['sel_short'],2 =>$lang_grabber['sel_full'],3 =>$lang_grabber['sel_short_full'],4 =>$lang_grabber['sel_no_gener'],5 =>$lang_grabber['sel_don']),$short_story[10]));
- $tpl->set ('{text-url}',sel (array(0 =>$lang_grabber['no_izm'],1 =>$lang_grabber['url_klik'],2 =>$lang_grabber['url_no_donw'],3 =>$lang_grabber['url_no_donor']),$dop_nast[1]));
- $tpl->set ('{prox}',($dop_nast[2] == 0 ?'': 'checked'));
- $tpl->set ('{null}',($dop_nast[10] == 0 ?'': 'checked'));
- $tpl->set ('{load-img}',server_host($rss_channel_info['load_img']));
- $tpl->set ('{margin}',intval($dop_nast[12]));
- $tpl->set ('{xdescr}',htmlspecialchars($rss_channel_info['xdescr'],ENT_QUOTES));
- $tpl->set ('{ful-start}',stripslashes ($rss_channel_info['ful_start']));
- $tpl->set ('{ful-end}',stripslashes ($rss_channel_info['ful_end']));
- $tpl->set ('{start-title}',stripslashes ($rss_channel_info['start_title']));
- $tpl->set ('{start-title-f}',($dnast[22] == 0 ?'': 'checked'));
- $tpl->set ('{end-title}',stripslashes ($end_title[1]));
- $tpl->set ('{s-title}',stripslashes ($end_title[0]));
- $tpl->set ('{link-start-del}',stripslashes ($end_title[4]));
- $tpl->set ('{link-finish-del}',stripslashes ($end_title[5]));
- $tpl->set ('{sfr-short}',stripslashes ($keywordsd[1]));
- $tpl->set ('{efr-short}',stripslashes ($stkeywordsd[1]));
- $tpl->set ('{sfr-full}',stripslashes ($keywordsd[2]));
- $tpl->set ('{efr-full}',stripslashes ($stkeywordsd[2]));
- $tpl->set ('{end-del}',stripslashes ($ftitles));
- $tpl->set ('{s-del}',stripslashes ($stitles));
- $tpl->set ('{start-short}',stripslashes ($rss_channel_info['start_short']));
- $tpl->set ('{end-short}',($hide_leech[0] == 0 ?'': 'checked'));
- $tpl->set ('{sart-link}',stripslashes ($rss_channel_info['sart_link']));
- $tpl->set ('{step-page}',$dop_nast[20]);
- $tpl->set ('{end-link}',($rss_channel_info['end_link'] == 0 ?'': 'checked'));
- $sart_cat = explode('|||',$rss_channel_info['sart_cat']);
- $tpl->set ('{sart-cat}',stripslashes ($sart_cat[0]));
- $tpl->set ('{shab-data}',stripslashes ($sart_cat[1]));
- $tpl->set ('{zhv-code}',stripslashes (@htmlspecialchars(str_replace ('===','
- ',$sart_cat[2]),ENT_QUOTES)));
- $tpl->set ('{end-cat}',stripslashes ($rss_channel_info['end_cat']));
- $tpl->set ('{date}',stripslashes ($date[0]));
- $tpl->set ('{cookies}',$cookies);
- $tpl->set ('{keywords}',$keywords);
- $tpl->set ('{Autors}',$Autors);
- $tpl->set ('{kategory}',$kategory);
- $xfields_template = explode ('|||',$rss_channel_info['xfields_template']);
- $list = rss_xfields(1);
- $template = '';
- $x= 1;
- foreach ($xfields_template as $value){
- if ($value != ''){
- $key = explode ('==',$value);
- if ($list[$key[0]] == '')$list[$key[0]] = $lang_grabber['list_dop_pole'];
- $template .= '
- <div class="title_spoiler"><center><img id="image-full_'.$x.'" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" /> <a href="javascript:ShowOrHideg(\'full_'.$x.'\')"><b>'.$list[$key[0]].' ['.$key[0].']</b></a></center></div>
- <div id="full_'.$x.'" style="display:none">
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <!-- <tr>
- <td colspan="4" style="padding:4px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4" ><center><b>'.$lang_grabber['list_dop_pole'].' ['.$list[$key[0]].']</b></center></td>
- </tr> -->
- <tr>
- <td style="padding:4px" align="center">'.$lang_grabber['rss_xfields'].'
- <select name="rss_xfields_'.$x.'" class="load_img">
- '.sel (rss_xfields('1'),$key[0]).'
- </select><br>
- '.$lang_grabber['use_po_get'].'
- <input type="checkbox" name="ret_xf_'.$x.'" value="1" '.($key[2] == 0 ?'': 'checked').' />
- '.$lang_grabber['take_short-story'].'
- <input type="checkbox" name="sh_fl_'.$x.'" value="1" '.($key[3] == 0 ?'': 'checked').' />
- '.$lang_grabber['kol-vo'].'
- <input name="rs_sm_'.$x.'" class="load_img" type="text" size="3" value="'.$key[8].'"> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
- <br />
- '.$lang_grabber['pole_img'].'
- <input type="checkbox" name="sh_im_'.$x.'" value="1" '.($key[4] == 0 ?'no': 'checked').' />
- '.$lang_grabber['img_size'].'
- <input name="rs_im_'.$x.'" class="load_img" type="text" size="10" value="'.$key[7].'"> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
- <br>
- '.$lang_grabber['kod_ost'].'
- <input type="checkbox" name="sh_nw_'.$x.'" value="1" '.($key[9] == 0 ?'': 'checked').' />
- </td>
- </tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" ></td>
- <td width="83%" style="padding:4px">'.$add_bb.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:100px" name="xfields_template_'.$x.'">'.stripslashes($key[1]).'</textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr>
- <td colspan="4" align="center" style="padding:6px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4"><center>'.$lang_grabber['templates_search_regular'].' '.$lang_grabber['in_dop_pol'].'</center></td>
- </tr>
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['expression'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:50px" name="xfields_delete_'.$x.'">'.stripslashes($key[5]).'</textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['paste'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:50px" name="xfields_insert_'.$x.'">'.stripslashes($key[6]).'</textarea>
- </td></tr>
- </table>
- </div>
- ';
- $x++;
- }
- }
- $template .= '
- <!-- <div><a href="javascript:ShowOrHide(\'full_'.$x.'\');"><center>'.$lang_grabber['add_new_dop'].'</center></a></div> -->
- <div class="title_spoiler"><center><img id="image-full_'.$x.'" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" /> <a href="javascript:ShowOrHideg(\'full_'.$x.'\')">'.$lang_grabber['add_new_dop'].'</a></center></div>
- <div id="full_'.$x.'" style="display:none">
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <!-- <tr>
- <td colspan="4" style="padding:4px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4" ><center><b>'.$lang_grabber['list_dop_pole'].' </b></center></td>
- </tr> -->
- <tr>
- <td style="padding:4px" align="center">'.$lang_grabber['rss_xfields'].'
- <select name="rss_xfields_'.$x.'" class="load_img">
- '.sel (rss_xfields('1'),'').'
- </select><br>
- '.$lang_grabber['use_po_get'].'
- <input type="checkbox" name="ret_xf_'.$x.'" value="1"/>
- '.$lang_grabber['take_short-story'].'
- <input type="checkbox" name="sh_fl_'.$x.'" value="1"/>
- '.$lang_grabber['kol-vo'].'
- <input name="rs_sm_'.$x.'" class="load_img" type="text" size="3" value="0"> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
- <br />
- '.$lang_grabber['pole_img'].'
- <input type="checkbox" name="sh_im_'.$x.'" value="1"/>
- <br>
- '.$lang_grabber['img_size'].'
- <input name="rs_im_'.$x.'" class="load_img" type="text" size="10" value=""> <a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
- '.$lang_grabber['kod_ost'].'
- <input type="checkbox" name="sh_nw_'.$x.'" value="1"/>
- </select>
- </td>
- </tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" ></td>
- <td width="83%" style="padding:4px">'.$add_bb.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:100px" name="xfields_template_'.$x.'"></textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr>
- <td colspan="4" align="center" style="padding:6px; border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4"><center>'.$lang_grabber['templates_search_regular'].' '.$lang_grabber['in_dop_pol'].'</center></td>
- </tr>
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['expression'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:50px" name="xfields_delete_'.$x.'"></textarea>
- </td></tr>
- </table>
- <table cellpadding="" cellspacing="0" width="98%" align="center">
- <tr align="left">
- <td width="17%" align="center" valign="middle" style="padding:4px" >'.$lang_grabber['paste'].'</td>
- <td width="83%" style="padding:4px">'.$add_bbz.'<textarea onclick="setFieldName(this.name)" class="load_img" style="width:79%; height:50px" name="xfields_insert_'.$x.'"></textarea>
- </td></tr>
- </table>
- </div>
- <a style="padding:10px" href="'.$PHP_SELF .'?mod=xfields&xfieldsaction=configure" target="_blank">'.$lang_grabber['list_dop_pole'].'</a><br /><br />';
- $tpl->set ('{kol-xfields}',$x);
- $tpl->set ('{xfields-template}',$template);
- if (@file_exists ($rss_plugins.'sinonims.php') )
- {
- $sin = '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['sinonims'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="sinonim" value="1" '.($short_story[3] == 0 ?'': 'checked').' value="1"/>
- <select name="sinonim_sel" class="load_img">'.
- sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$short_story[19]).'
- </select>
- </td>
- </tr>';
- }
- if(@file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
- {
- $sin .= '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['crosspost'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="cross_post" '.($dnast[26] == 0 ?'': 'checked').' value="1"/>
- </td>
- </tr>';
- }
- if((@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
- {
- $sin .= '
- <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
- <td style="padding:4px" width="304">'.$lang_grabber['twitter'].':</td>
- <td width="768" style="padding:4px">
- <input type="checkbox" name="twitter_post" '.($dnast[28] == 0 ?'': 'checked').' value="1"/>
- </td>
- </tr>';
- }
- $tpl->set ('{sinonim}',$sin);
- $tpl->set ('{opt_sys_yes}',$lang['opt_sys_yes']);
- $tpl->set ('{opt_sys_no}',$lang['opt_sys_no']);
- foreach ($lang_grabber as $key =>$value){$tpl->set ('{'.$key.'}',$value);}
- $form = ' <form method="post" >
- <input type="hidden" name="id" value="'.$id .'" />
- <input type="hidden" name="action" value="channel" />
- <input type="hidden" name="subaction" value="do_change" />';
- include_once ($rss_plugins.'inserttag.php');
- $tpl->set ('{inserttag}',$bb_js);
- $form .= "
- <script>
- $(function(){
- $('#tags').autocomplete({
- serviceUrl:'engine/ajax/tags_rss.php',
- minChars:3,
- delimiter: /(,|;)\s*/,
- maxHeight:400,
- width:348,
- deferRequestBy: 300
- });
- });
- function simpletags(thetag)
- {
- doInsert(\"{\"+thetag+\"}\", \"\", false);
- }
- function ShowOrHideg( id ) {
- var item = document.getElementById(id);
- if ( document.getElementById('image-'+ id) ) {
- var image = document.getElementById('image-'+ id);
- } else {
- var image = null;
- }
- if (!item) {
- retun;
- } else {
- if (item.style) {
- if (item.style.display == \"none\") {
- item.style.display = \"\";
- image.src = './engine/inc/plugins/images/minus.gif';
- } else {
- item.style.display = \"none\";
- image.src = './engine/inc/plugins/images/plus.gif';
- }
- } else{ item.visibility = \"show\"; }
- }
- };
- </script>
- ";
- $tpl->set ('{BB_code}',$add_bb);
- $tpl->set ('{BB_codez}',$add_bbz);
- $tpl->set ('{BB_codezz}',$add_bbzz);
- $tpl->copy_template = $form .$tpl->copy_template .'
- <input align="left" class="btn btn-success" type="submit" OnClick="alert(\''.$lang_grabber['channel'].' '.$lang_grabber['edit_channel_ok'].'\')" value=" '.$lang_grabber['save'].' " >
- <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" /></form>';
- $tpl->compile ('rss');
- echo $tpl->result['rss'];
- closetable ();
- echofooter ();
- $db->close;
- return 1;
- }
- }
- if ($action == 'doaddnews')
- {
- echoheader ('','');
- opentable ($lang_grabber['add_news']);
- if ($_POST['channels'])
- {
- foreach ($_POST['channels'] as $ckey=>$channel_id)
- {
- $xfield = array();
- $xdoe_channel = array();
- $news_per_channel = intval ($_POST['news-per-channel-'.$channel_id]);
- $channel_info = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$channel_id'");
- if (trim ($channel_info['title']) != '')
- {
- $tit = stripslashes (strip_tags_smart ($channel_info['title']));
- if (50 <strlen ($tit))
- {
- $tit = substr ($tit,0,50) .'...';
- }
- }
- else
- {
- $URL = get_urls(trim($channel_info['url']));
- $tit = $URL['host'];
- }
- echo '<b style="color:green;align:left;"> №'.$channel_info['xpos'].' - '.$tit.'</b><br>';
- $dop_nast = explode ('=',$channel_info['dop_nast']);
- $dates = explode ('=',$channel_info['date']);
- $dnast = explode ('=',$channel_info['dnast']);
- $dop_sort = explode ('=',$channel_info['short_story']);
- $rss_files = explode('==',$channel_info['files']);
- if ($news_per_channel == 0){
- $firt = array();
- foreach ($_POST as $key_con =>$dsfa)if (preg_match('#mod#i',$key_con))$firt[] = 1;
- $news_per_channel = count($firt)+1;
- }
- $n = $news_per_channel -1;
- $nn = 0;
- for ($di = 1;$di <$news_per_channel;++$di)
- {
- $cp_output = '';
- $xdoe_files = array();
- $xdoe = array();
- if (intval($dop_nast[21]) != 0) sleep ($dop_nast[21]);
- $news_selected = $_POST['sel_'.$di.$channel_id];
- if ($news_selected == 1)
- {
- $tegs =$_POST['tags_'.$di.$channel_id];
- if ( count($_POST['category'.$di.$channel_id.'_']))
- {
- $category_list = $db->safesql( implode( ',',$_POST['category'.$di.$channel_id.'_'] ) );
- }else{$category_list = '0';}
- $title = trim ($_POST['title_'.$di.$channel_id]);
- $_POST['title'] = html_entity_decode($title);
- $alt_name = totranslit ($title);
- $short_story = $_POST['short_'.$di.$channel_id];
- $full_story = $_POST['full_'.$di.$channel_id];
- $sinonims_val = ($_POST['sinonims_'.$di.$channel_id] == 1 ?1 : 0);
- $crosspost_val = ($_POST['crosspost_'.$di.$channel_id] == 1 ?1 : 0);
- $twitter_val = ($_POST['twitter_'.$di.$channel_id] == 1 ?1 : 0);
- $rewrite = ($_POST['rewrite_'.$di.$channel_id] == 1 ?1 : 0);
- $approve = ($_POST['mod_'.$di.$channel_id] == 1 ?1 : 0);
- $allow_comm = ($_POST['comm_'.$di.$channel_id] == 1 ?1 : 0);
- $allow_main = ($_POST['main_'.$di.$channel_id] == 1 ?1 : 0);
- $allow_rate = intval ($channel_info['allow_rate']);
- $allow_more = intval ($channel_info['allow_more']);
- $thistime = $_POST['date-from-channel_'.$di.$channel_id];
- $news_full_link = $_POST['news-full-link_'.$di.$channel_id];
- $serv = $_POST['serv_'.$di.$channel_id];
- $full_news_link = $_POST['news_link_'.$di.$channel_id];
- $radikal = ($_POST['radikal_'.$di.$channel_id]== 1 ?1 : 0);
- $xfield = $_POST['xfield'.$di.$channel_id.'_'];
- $author = $db->safesql ($_POST['autor_'.$di.$channel_id]);
- $meta_title = $db->safesql ($_POST['meta_title'.$di.$channel_id]);
- $descr = $db->safesql ($_POST['descr'.$di.$channel_id]);
- $keywords = $db->safesql ($_POST['keywords'.$di.$channel_id]);
- $mets = ($_POST['met_'.$di.$channel_id] == 1 ?1 : 0);
- $expires = $_POST['expires_'.$di.$channel_id];
- $dimages = '';
- if ($mets == 1)$meta_title = $db->safesql (trim($meta_title.' '.$title));else $meta_title = $db->safesql (trim($meta_title));
- $alt_name = $db->safesql (totranslit( stripslashes( $title ),true,false ));
- $catalog_url = $db->safesql( substr( htmlspecialchars( strip_tags_smart( stripslashes( trim( $_POST['symbol'.$di.$channel_id] ) ) ) ),0,3 ) );
- $stop = false;
- if ($category_list =='0'and $dop_sort[6] == 0) $stop = true;
- if ($title != ''and !$stop){
- $safeTitle = $db->safesql ($title);
- if ($dop_sort[12] == 0) {$where = " WHERE title like '%".$safeTitle."%'";}
- elseif ($dop_sort[12] == 1 and $full_news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($full_news_link)."%'";}
- elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
- elseif ($dop_sort[12] == 3 and $full_news_link != '') {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."' or xfields like '%".$db->safesql ($full_news_link)."%'";}
- else {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
- $sql_Title = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
- if ($db->num_rows ($sql_Title) == 0 or $rewrite == 1 or $dop_sort[12] == 0)
- {
- $xfields = '';
- $filecontents = array();
- if( !empty( $xfield )) {
- ob_implicit_flush();
- foreach ( $xfield as $xfielddataname =>$xfielddatavalue ) {
- if( $xfielddatavalue == '') {
- continue;
- }
- $xfields_im = false;
- $xfte = array();
- $xfte = explode ('|||',$channel_info['xfields_template']);
- foreach($xfte as $value)
- {
- $key = explode ('==',$value);
- if ($key[0] == $xfielddataname and $key[4] == 1){
- $xfields_im = true;
- break;
- }
- }
- $xfielddatavalue = stripslashes($xfielddatavalue);
- if ($serv != '0')
- {
- $full_images = array();
- $di_control = new image_controller ();
- $di_control->post = '';
- if ($xfields_im == true)$xfielddatavalue='[img]'.$xfielddatavalue.'[/img]';
- $di_control->short_story = $xfielddatavalue;
- $di_control->proxy = $dop_nast[2];
- $di_control->dubl =$dop_nast[15];
- if ($dates[0] != ''and strlen($dates[0]) != 10){
- $di_control->post = '/'.$dates[0] ;
- }
- if (intval($key[7]) != 0)$di_control->post .= '/th_post';
- if ($dates[1] == 1 or $config_rss['alt_name'] == 'yes')$di_control->dim_week = $alt_name;
- $di_control->dim_date =$dates[2];
- $di_control->dim_sait =$dates[3];
- $di_control->dim_cat =$dates[4];
- $di_control->wat_h =$dnast[15];
- if (intval($key[7]) != 0)$di_control->max_up_side = $key[7];
- else $di_control->max_up_side = $config['max_up_side'];
- if (intval($dnast[37]) != 0)$di_control->max_image = $dnast[37];
- else $di_control->max_image = $config['max_image'];
- $di_control->min_image = $dnast[38];
- if ( count($_POST['category'.$di.$channel_id.'_'])) $di_control_cat = $db->super_query ('SELECT alt_name FROM '.PREFIX ."_category WHERE id ='".$_POST['category'.$di.$channel_id.'_'][0]."'");
- $di_control->cat = $di_control_cat ['alt_name'];
- if ($channel_info['allow_watermark'] == 1)
- {
- $di_control->allow_watermark = true;
- if ($dop_nast[0] == 1)
- {
- if (trim($dnast[23]) != '')$config_rss ['watermark_image_light']=$dnast[23];
- if (trim($dnast[24]) != '')$config_rss['watermark_image_dark']=$dnast[24];
- $di_control->watermark_image_light = ROOT_DIR .$config_rss ['watermark_image_light'];
- $di_control->watermark_image_dark = ROOT_DIR .$config_rss['watermark_image_dark'];
- }
- }
- $di_control->x = $dop_nast[3];
- $di_control->y = $dop_nast[4];
- $di_control->margin = $dop_nast[12];
- if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
- $di_control->rewrite = $rewrite;
- }
- if ($dop_nast[11] == 1)$di_control->shs = true;
- $db->close;
- $pro = $di_control->process($serv);
- if (count($pro) != 0) {
- $xdoe[] = implode('<br />',$pro);
- }
- if (count ($di_control->upload_images) != 0)
- {
- $folder_prefix = trim($di_control->post.$di_control->pap_data,'/');
- $dim = '|||'.$folder_prefix.'/';
- $dimage = implode ($dim,$di_control->upload_images);
- $dimages = $db->safesql ($folder_prefix.'/'.$dimage);
- }
- $xfielddatavalue = $di_control->short_story;
- if (count($di_control->upload_image ) != 0 and intval($key[7]) == 0){
- $short_story=strtr ($short_story,$di_control->upload_image);
- $full_story=strtr ($full_story,$di_control->upload_image);
- }
- if ($xfields_im == true){
- $xfielddatavalue=str_replace( '[thumb]','',$xfielddatavalue );
- $xfielddatavalue=str_replace( '[/thumb]','',$xfielddatavalue );
- $xfielddatavalue=str_replace( '[img]','',$xfielddatavalue );
- $xfielddatavalue=str_replace( '[/img]','',$xfielddatavalue );
- }
- }
- $config_code_bb = explode (',',$config_rss['code_bb'] );
- if (in_array ($xfielddataname ,$config_code_bb) and @file_exists ($rss_plugins.'sinonims.php'))
- {
- include_once($rss_plugins.'sinonims.php');
- preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#i",$xfielddatavalue,$nosinonims);
- foreach ($nosinonims[1] as $key =>$value){
- $noss['nosinonims_'.$key] = $value;
- }
- if (count($noss) != '')$xfielddatavalue=strtr ($xfielddatavalue,array_flip($noss));
- if (preg_match('/\[sin\]/',$xfielddatavalue)){
- $xfielddatavalue =preg_replace ("#\[sin\](.+?)\[\/sin\]#ie","sinonims('\\1')",$xfielddatavalue);
- }else{$xfielddatavalue = sinonims ($xfielddatavalue);}
- if (count($noss) != '')$xfielddatavalue=strtr ($xfielddatavalue,$noss);
- }
- $xfielddatavalue = $db->safesql( $parse->BB_Parse( $parse->process( $xfielddatavalue ),false ) );
- $xfielddataname = $db->safesql( $xfielddataname );
- $xfielddataname = str_replace( '|','|',$xfielddataname );
- $xfielddataname = str_replace( "\r\n",'__NEWL__',$xfielddataname );
- $xfielddatavalue = str_replace( '|','|',$xfielddatavalue );
- $xfielddatavalue = str_replace( "\r\n",'__NEWL__',$xfielddatavalue );
- $filecontents[] = "$xfielddataname|$xfielddatavalue";
- }
- if (count($filecontents) != 0) $xfields = implode( '||',$filecontents );
- }
- else
- {
- $xfields = '';
- }
- if ($channel_info['allow_more'] == 1 or $dop_sort[12] == 1 or $dop_sort[12] == 3)
- {
- if ($dnast[31] == 1)$xfields .='||source_leech|'.$db->safesql( $parse->BB_Parse( $parse->process( '[leech='.$full_news_link.']'.$channel_info['title'].'[/leech]'),false ) );
- $xfields .= '||source_name|'.$channel_info['title'] .'||source_link|'.$full_news_link;
- }
- $xfields = $filecontents = trim($xfields,'||');
- $news_id = '';
- $date_time = strtotime ($thistime);
- if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
- $word = addcslashes(stripslashes($full_news_link),'"[]!-.#?*%\\()|/');
- while ( $row = $db->get_row($sql_Title) ) {
- if ($dop_sort[12] == 1 or $dop_sort[12] == 3)$xfi=true;
- if(preg_match('#'.$word.'#i',$row['xfields']) or !$xfi or trim($row['xfields']) == ''){
- if (parse_date($thistime) >parse_date ($row['date']) or $dnast[17] == 0){
- $news_id = $row['id'];
- $author = $row['autor'];
- }else{$rewrite = 0;}
- break;
- }
- }
- if ($rewrite == 0)continue;
- }
- if ($db->num_rows ($sql_Title) >0 and $rewrite == 1 and $news_id == '')continue;
- if ($serv != '0'or $dop_nast[11] == 1)
- {
- $di_control = new image_controller ();
- $di_control->post = '';
- $di_control->short_story = $short_story;
- $di_control->full_story = $full_story;
- $di_control->proxy = $dop_nast[2];
- $di_control->dubl =$dop_nast[15];
- if ($dates[0] != ''and strlen($dates[0]) != 10){$di_control->post = '/'.$dates[0] ;}
- if ($dates[1] == 1 or $config_rss['alt_name'] == 'yes')$di_control->dim_week = $alt_name;
- $di_control->dim_date =$dates[2];
- $di_control->dim_sait =$dates[3];
- $di_control->dim_cat =$dates[4];
- $di_control->wat_h =$dnast[15];
- if (intval($dnast[37]) != 0)$di_control->max_image = $dnast[37];
- else $di_control->max_image = $config['max_image'];
- $di_control->max_up_side = $config['max_up_side'];
- $di_control->min_image = $dnast[38];
- if ( count($_POST['category'.$di.$channel_id.'_'])) $di_control_cat = $db->super_query ('SELECT alt_name FROM '.PREFIX ."_category WHERE id ='".$_POST['category'.$di.$channel_id.'_'][0]."'");
- $di_control->cat = $di_control_cat ['alt_name'];
- if ($channel_info['allow_watermark'] == 1)
- {
- $di_control->allow_watermark = true;
- if ($dop_nast[0] == 1)
- {
- if (trim($dnast[23]) != '')$config_rss ['watermark_image_light']=$dnast[23];
- if (trim($dnast[24]) != '')$config_rss['watermark_image_dark']=$dnast[24];
- $di_control->watermark_image_light = ROOT_DIR .$config_rss ['watermark_image_light'];
- $di_control->watermark_image_dark = ROOT_DIR .$config_rss['watermark_image_dark'];
- }
- }
- $di_control->x = $dop_nast[3];
- $di_control->y = $dop_nast[4];
- $di_control->margin = $dop_nast[12];
- if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
- $di_control->rewrite = $rewrite;
- }
- if ($dop_nast[11] == 1)$di_control->shs = true;
- $db->close;
- $pro = $di_control->process($serv);
- if (count($pro) != 0) {
- $xdoe[] = implode('<br />',$pro);
- }
- $short_story = $di_control->short_story;
- $full_story = $di_control->full_story;
- if (count ($di_control->upload_images) != 0)
- {
- $folder_prefix = trim($di_control->post.$di_control->pap_data,'/');
- $dim = '|||'.$folder_prefix.'/';
- $dimage = implode ($dim,$di_control->upload_images);
- $dimages .= '|||'.$db->safesql ($folder_prefix.'/'.$dimage);
- }
- }
- $dimages = trim($dimages ,'|||');
- $short_story = add_short ($short_story);
- $full_story = add_full ($full_story);
- $f_d = array();
- $f_u = array();
- $down_files1 = array();
- $down_files2 = array();
- $down_erors1 = array();
- $down_erors2 = array();
- $s_story = array();
- $f_story = array();
- if ($rss_files[0] == 1){$f_d['video']['pap'] = $rss_files[1];$f_d['video']['name'] = $rss_files[12].'='.$rss_files[18];}
- if ($rss_files[2] == 1){$f_d['rar']['pap'] = $rss_files[3];$f_d['rar']['name'] = $rss_files[13].'='.$rss_files[19];}
- if ($rss_files[4] == 1){$f_d['zip']['pap'] = $rss_files[5];$f_d['zip']['name'] = $rss_files[14].'='.$rss_files[20];}
- if ($rss_files[6] == 1){$f_d['doc']['pap'] = $rss_files[7];$f_d['doc']['name'] = $rss_files[15].'='.$rss_files[21];}
- if ($rss_files[8] == 1){$f_d['txt']['pap'] = $rss_files[9];$f_d['txt']['name'] = $rss_files[16].'='.$rss_files[22];}
- if ($rss_files[10] == 1){$f_d['dle']['pap'] = $rss_files[11];$f_d['dle']['name'] = $rss_files[17].'='.$rss_files[23];}
- if ($rss_files[26] == 1){$f_d['tor']['pap'] = $rss_files[29];$f_d['tor']['name'] = $rss_files[27].'='.$rss_files[28];}
- if (count($f_d) !=0 ){
- $file_down = new file_down;
- $file_down->short_story = $short_story;
- $file_down->full_story = $full_story;
- $file_down->alt_name = $alt_name;
- $file_down->torrage = $rss_files[30];
- $file_down->file_process($f_d);
- $short_story = $file_down->short_story;
- $full_story = $file_down->full_story;
- $down_files1 = $file_down->down_files;
- $down_erors1 = $file_down->eror;
- }
- $s_story = relace_news_don ($short_story,$alt_name,$rss_files[30]);
- $f_story = relace_news_don ($full_story,$alt_name,$rss_files[30]);
- $short_story = $s_story['story'];
- $full_story = $f_story['story'];
- $down_files2 = array_merge ($s_story['files'],$f_story['files']);
- $down_erors2 = array_merge ($s_story['erors'],$f_story['erors']);
- $down_files = array_diff(array_merge ($down_files1,$down_files2),array(''));
- $down_erors = array_diff(array_merge ($down_erors1,$down_erors2),array(''));
- if (count($down_erors)!=0)$xdoe_files[] = implode('<br />',$down_erors);
- echo "
- <div id=\"progressbar\"></div>
- <script>
- storyes($di, $n, '$title' );
- </script>";
- ob_flush();
- flush();
- if (@file_exists ($rss_plugins.'sinonims.php') )
- {
- include_once($rss_plugins.'sinonims.php');
- preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#is",$short_story,$nosinonimsshort_story);
- foreach ($nosinonimsshort_story[1] as $key =>$value){
- $nossshort_story['nosinonims_'.$key] = $value;
- }
- if (count($nossshort_story) != '')$short_story=strtr ($short_story,array_flip($nossshort_story));
- if (preg_match('/\[sin\]/',$short_story)){
- $short_story =preg_replace ("#\[sin\](.+?)\[\/sin\]#ise","sinonims('\\1')",$short_story);
- }else{
- if ($dop_sort[3] == 1 and $sinonims_val == 1 and ($dop_sort[19] == 0 or $dop_sort[19] == 1 ))$short_story = sinonims ($short_story);
- }
- if (count($nossshort_story) != '')$short_story=strtr ($short_story,$nossshort_story);
- preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#is",$full_story,$nosinonimsfull_story);
- foreach ($nosinonimsfull_story[1] as $key =>$value){
- $nossfull_story['nosinonims_'.$key] = $value;
- }
- if (count($nossfull_story) != '')$full_story=strtr ($full_story,array_flip($nossfull_story));
- if (preg_match('/\[sin\]/',$full_story)){
- $full_story =preg_replace ("#\[sin\](.+?)\[\/sin\]#ise","sinonims('\\1')",$full_story);
- }else{
- if ($dop_sort[3] == 1 and $sinonims_val == 1 and ($dop_sort[19] == 0 or $dop_sort[19] == 2 ))$full_story = sinonims ($full_story);
- }
- if (count($nossfull_story) != '')$full_story=strtr ($full_story,$nossfull_story);
- }
- if ($dop_sort[17] == 1 or intval($dop_sort[20]) == 1 or trim($full_story) != ''){
- if ((trim($short_story) != ''or $dop_sort[0] == 1) and trim($title) != '') {
- $short_story=strtr($short_story,array('[sin]'=>'','[/sin]'=>'','[nosin]'=>'','[/nosin]'=>'','biggrab '=>''));
- $full_story =strtr($full_story,array('[sin]'=>'','[/sin]'=>'','[nosin]'=>'','[/nosin]'=>'','biggrab '=>''));
- $title = stripslashes($title);
- $short_story = stripslashes($short_story);
- $full_story = stripslashes($full_story);
- $title = $db->safesql($parse->process($title));
- if (count($down_files) != 0)
- {
- if(@file_exists(ENGINE_DIR .'/inc/xbt.php'))preg_match("#version.*['\"](.*)['\"]#i",@file_get_contents(ENGINE_DIR .'/inc/xbt.php'),$ver_xbt);
- foreach ($down_files as $name=>$image_name)
- {
- $id = '';
- $word = addcslashes(stripslashes(($config_rss['http_url'] != ''?$config_rss['http_url']:$config['http_home_url']).'uploads/files/'.$image_name),'"[]!-.#?*%\\()|/');
- if(substr($image_name,-8) == '.torrent'and @file_exists(ENGINE_DIR.'/modules/tracker/upload.php'))
- {
- if ($config_rss['xbt'] == 'no')
- {
- $short_story = preg_replace("#\[(url|leech)=".$word."\].*\[\/(url|leech)\]#iUs",'',$short_story);
- $full_story = preg_replace("#\[(url|leech)=".$word."\].*\[\/(url|leech)\]#iUs",'',$full_story);
- }
- if($ver_xbt[1]=='2.6')$db->query( 'DELETE FROM '.PREFIX ."_files WHERE name='torrent.deleted'");
- define('STANDART_UPL',true);
- include ENGINE_DIR.'/modules/tracker/upload.php';
- }else {
- $tr_fild = $tr_info = '';
- $onserver = $image_name;
- }
- if($ver_xbt[1]!='2.6'){
- $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
- $db->query( 'INSERT INTO '.PREFIX ."_files (news_id, name, onserver, author, date{$tr_fild}) values ('0', '$name', '$onserver', '$author', '$date_time'{$tr_info})");
- $id = $db->insert_id();
- }
- if ($rss_files[25] != '')$name = ':'.$rss_files[25];
- else $name = '';
- $name = str_replace('{zagolovok}',$title,$name);
- if($_GET['x'] == 1){
- echo $onserver.'<br>';
- echo '<textarea style="width:100%;height:240px;">'.@htmlspecialchars( $full_story,ENT_QUOTES ).'</textarea><br>';
- }
- if($rss_files[24] == 1 or $config_rss['xbt'] == 'yes')
- {
- $short_story = preg_replace("#\[(url|leech)=".$word."\].*?\[\/(url|leech)\]#is","[attachment=$id$name]",$short_story);
- $full_story =preg_replace ("#\[(url|leech)=".$word."\].*?\[\/(url|leech)\]#is","[attachment=$id$name]",$full_story);
- $full_story =str_replace ('[url='.stripslashes($word).']',"[attachment=$id$name]",$full_story);
- }
- }
- }
- if($dnast[40] == 1 and $dimages != ''){
- $rss_archive = 0;
- require_once $rss_plugins.'pclzip.php';
- $ar_file = 'uploads/files/'.$alt_name.'_img.zip';
- $ar_mages= 'uploads/posts/'.str_replace('|||',',uploads/posts/',$dimages);
- classCreator::createPclZip();
- $ar_archive = new PclZip($ar_file);
- $ar_list = $ar_archive->create($ar_mages,PCLZIP_OPT_REMOVE_ALL_PATH);
- if ($ar_list != 0){
- $db->query( 'INSERT INTO '.PREFIX ."_files (news_id, name, onserver, author, date) values ('0', '".basename($ar_file)."', '".basename($ar_file)."', '$author', '$date_time')");
- $rss_archive = $db->insert_id();
- @rename (ROOT_DIR.'/'.$ar_file,ROOT_DIR.'/uploads/files/'.$rss_archive.'.zip');
- $db->query('UPDATE '.PREFIX."_files set onserver='".$rss_archive.".zip' WHERE id='$rss_archive'");
- if($rss_files[24] == 1){
- if ($rss_files[25] != '')$name = ':'.$rss_files[25];
- else $name = '{zagolovok}';
- $full_story = $full_story."<br /><br />[attachment=$rss_archive$name]";
- }else{
- if ($rss_files[25] != '')$name = $rss_files[25];
- else $name = '';
- $full_story = $full_story.'<br /><br />[url='.$ar_file.']'.$name.'[/url]';
- }
- $full_story = str_replace('{zagolovok}',$title,$full_story);
- }
- }
- if($_GET['x'] == 1){
- echo stripslashes($word).'<br>';
- echo '<textarea style="width:100%;height:240px;">'.@htmlspecialchars( $full_story,ENT_QUOTES ).'</textarea><br>';
- }
- $key_iframe = array_search('iframe',$parse->tagBlacklist);
- unset ($parse->tagBlacklist[$key_iframe]);
- $key_script = array_search('script',$parse->tagBlacklist);
- unset ($parse->tagBlacklist[$key_script]);
- if (($config_rss['create_images'] == 1 or $config_rss['create_images'] == 3) and intval( $config_rss['maxWidth'] ) !='0'){
- $short_story = $db->safesql($parse->BB_Parse(create_images($parse->process($short_story) ,$title) ,false));
- }else{
- $short_story = $db->safesql($parse->BB_Parse($parse->process($short_story) ,false));
- }
- if (($config_rss['create_images'] == 2 or $config_rss['create_images'] == 3) and intval( $config_rss['maxWidth'] ) !='0'){
- $full_story = $db->safesql($parse->BB_Parse(create_images($parse->process($full_story) ,$title) ,false));
- }else{
- $full_story = $db->safesql($parse->BB_Parse($parse->process($full_story) ,false));
- }
- $news_read = rand(intval($config_rss['rate_start']),intval($config_rss['rate_finish']));
- if($allow_rate == 1){$vote_num = rand(0,$news_read);
- $rating = rand($vote_num*(intval($config_rss['rate_bal'])-2),$vote_num*intval($config_rss['rate_bal']));
- }
- $rating = intval ($rating);
- $short_story = unhtmlentities(str_replace ('%20',' ',str_replace ('o','o',$short_story ) ));
- $full_story = unhtmlentities(str_replace ('%20',' ',str_replace ('o','o',$full_story ) ));
- $safet = $parse->decodeBBCodes($_POST['title']);
- $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
- $full_story = preg_replace ("#<script(.+?)>(.+?)<\/script>#ies","script_br('\\1','\\2')",$full_story);
- if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
- if ($config['version_id'] >='7.2')$tes = ", tags='".$db->safesql($tegs)."'";
- if ($config['version_id'] >'8.0')$fgs = ", metatitle='$meta_title', symbol='$catalog_url'";
- if ($dnast[29] == 1)$shfu_re = "short_story='$short_story'";
- elseif ($dnast[29] == 2)$shfu_re = "full_story='$full_story'";
- else $shfu_re = "short_story='$short_story', full_story='$full_story'";
- $result = $db->query( 'UPDATE '.PREFIX ."_post set date='$thistime', title='$title', $shfu_re , descr='$descr', keywords='$keywords', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', xfields='$xfields' $tes $fgs WHERE id='$news_id'");
- $db->query ('UPDATE '.PREFIX ."_users SET lastdate = '$date_time' WHERE name ='$author'");
- $db->query('UPDATE '.PREFIX ."_images SET images='$dimages', date='$date_time' WHERE news_id ='$news_id'");
- }else{
- if ($config['version_id'] >='7.2'){$te =", '".$db->safesql($tegs)."'";$tes = ', tags';}
- if ($config['version_id'] >'8.0'){$fgrs = ", '$meta_title', '$catalog_url'";$fgs = ', metatitle, symbol';}
- if ($config['version_id'] <'9.6'){
- $db->query ( 'INSERT INTO '.PREFIX ."_post (autor, category, date, title, alt_name, short_story, full_story, xfields, allow_main, approve, allow_comm, allow_rate, allow_br, rating, vote_num, news_read, fixed, descr, keywords $tes $fgs) VALUES ('$author', '$category_list', '$thistime', '$title', '$alt_name', '$short_story', '$full_story', '$xfields', '$allow_main', '$approve', '$allow_comm', '$allow_rate', '1', '$rating', '$vote_num', '$news_read', '0', '$descr', '$keywords' $te $fgrs)");
- $news_id = $db->insert_id();
- }else{
- $db->query ( 'INSERT INTO '.PREFIX ."_post (autor, category, date, title, alt_name, short_story, full_story, xfields, allow_main, approve, allow_comm, allow_br, fixed, descr, keywords $tes $fgs) VALUES ('$author', '$category_list', '$thistime', '$title', '$alt_name', '$short_story', '$full_story', '$xfields', '$allow_main', '$approve', '$allow_comm', '1', '0', '$descr', '$keywords' $te $fgrs)");
- $news_id = $row = $db->insert_id();
- $author_id = $db->super_query ('SELECT * FROM '.PREFIX ."_users WHERE name ='$author'");
- $db->query( 'INSERT INTO '.PREFIX ."_post_extras (news_id, allow_rate, news_read, vote_num, rating, user_id) VALUES('$news_id', '$allow_rate', '$news_read', '$vote_num', '$rating', '{$author_id['user_id']}')");
- }
- if( $approve == '1'and $crosspost_val == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php')) {
- $_POST['crosspost_approve'] = true;
- include ENGINE_DIR .'/inc/crosspost.addnews.php';
- }
- if($approve == '1'and $twitter_val == 1 and @file_exists(ENGINE_DIR.'/modules/twitter.php')) include ENGINE_DIR.'/modules/twitter.php';
- $db->query ('UPDATE '.PREFIX ."_users SET news_num = news_num + 1, lastdate = '$date_time' WHERE name ='$author'");
- }
- $xdoe_channel[] = $news_id;
- $nn++;
- $safeT[] = '<b>'.$nn.'</b> . <b style="color:green;">'.$tit.'</b> ► <a class="list" href="index.php?newsid='.$news_id.'" target="_blank"><b style="color:blue;">'.$safet.'</b></a> '.$ping_msg ;
- if ($tegs != ''and $db->num_rows ($sql_Title) == 0) {
- $tags = array();
- $tegs = explode (',',$tegs);
- $res = $db->super_query('SELECT * FROM '.PREFIX.'_tags LIMIT 1');
- foreach ($tegs as $value) {
- if (isset($res['alt_tag'])){
- if (trim($value) != '') $tags[] = "('$news_id', '".$db->safesql(trim($value))."', '".$db->safesql(trim(totranslit($value)))."')";
- }else{
- if (trim($value) != '') $tags[] = "('$news_id', '".$db->safesql(trim($value))."')";
- }
- }
- $tags = implode(', ',$tags);
- if (isset($res['alt_tag']))$db->query('INSERT INTO '.PREFIX.'_tags (news_id, tag, alt_tag) VALUES '.$tags);
- else $db->query('INSERT INTO '.PREFIX.'_tags (news_id, tag) VALUES '.$tags);
- }
- if (trim ($dimages) != ''and ($db->num_rows ($sql_Title) == 0 or $dop_sort[12] == 0))
- {
- $db->query('INSERT INTO '.PREFIX ."_images (images, news_id, author, date) VALUES ('$dimages', '$news_id', '$author', '$date_time')");
- }
- $db->close;
- $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
- if (count($down_files) != 0 or $rss_archive != 0)
- {
- $db->query('UPDATE '.PREFIX."_files set news_id = '$news_id', author = '$author' WHERE news_id='0'");
- }
- if (intval($dnast[10]) != 0){
- if ($expires != ''){$datede = strtotime ($expires);}else
- {$datede = strtotime ($thistime) +$dnast[10] * 86400;}
- $db->query( 'INSERT INTO '.PREFIX ."_post_log (news_id, expires, action) VALUES('$news_id', '$datede', '{$dnast[11]}')");
- }
- if($twitter_val == 1 and @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')) include ENGINE_DIR.'/modules/socialposting/posting.php';
- if (sizeof($xdoe) or sizeof($xdoe_files)){
- echo $nn.'. <a class="list" href="index.php?newsid='.$news_id.'" target="_blank"><b style="color:#9933FF;">'.$safet.'</b></a> '.$ping_msg.' <a class="list" href="'.$full_news_link.'" target="_blank">[link]</a><br />'.(sizeof($xdoe)?'<b style="padding-left:15px;">'.$lang_grabber['post_msg_pics'].'</b><br />'.preg_replace( "#(^|\s|>)((http://|https://|ftp://)\w+[^<\s\[\]]+)#i",'\\1<a style="padding-left:15px;" class="list" href="\\2" target="_blank">\\2</a>',implode('<br />',$xdoe)).'<br />':'').(sizeof($xdoe_files)?'<b>'.$lang_grabber['post_msg_files'].'</b><br />'.implode('<br />',$xdoe_files):'').'<br />';
- }else{
- echo $nn.'. <a class="list" href="index.php?newsid='.$news_id.'" target="_blank"><b style="color:blue;">'.$safet.'</b></a> '.$ping_msg.'<br>';
- }
- if($cp_output != '')echo $cp_output.'<br>';
- ob_flush();
- flush();
- }}}}}}
- echo ((sizeof($xdoe_channel))?'':'<b style="color:red;">'.$lang_grabber['post_msg_no'].'</b><br /><br />');
- }
- $db->close;
- if( $approve == '1'and $dop_sort[4] == 1 and @file_exists($rss_plugins.'ping/pingsite.txt')) {
- $rss_lenta = new image_controller ();
- $rss_lenta->download_host ($config['http_home_url'].'engine/ajax/rss_lenta.php','nn='.$nn);
- include ( $rss_plugins.'ping/grabberping.php');
- }
- if($config_rss['sitemap'] == 'yes'and @file_exists($rss_plugins.'ping/sitemap.php')) {
- include ( $rss_plugins.'ping/sitemap.php');
- }
- echo '<br /><a class=main href="'.$PHP_SELF .'?mod=rss">'.$lang_grabber['back'].'</a><br /><br /></center>';
- closetable ();
- echofooter ();
- $db->free();
- $db->close;
- clear_cache ();
- }else{
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- }
- return 1;
- }
- if (preg_match('/scan/i',$action))
- {
- $channel = $_POST['channel'];
- $_POST['str_url'] = array_diff($_POST['str_url'],array(''));
- $count_str_url = count($_POST['str_url']);
- if ($count_str_url >'0'){
- $_POST['str_news']=1;
- $_POST['str_newf']=$count_str_url;
- if (count ($channel) == 0)
- {
- $ur_keys=array();
- foreach ($_POST['str_url'] as $ur_key)
- {
- $U = get_urls(trim($ur_key));
- if (!in_array ($ur_keys,$sql_u['id']))$ur_keys[] = $U;
- else continue;
- $sql_u = $db->super_query ('SELECT id FROM '.PREFIX ."_rss WHERE url like '%".$db->safesql ($U['host'])."%'");
- if ($sql_u['id'] != ''and !in_array ($channel,$sql_u['id']))$channel[]=$sql_u['id'];
- }
- }
- }
- if (intval($_POST['str_news']) != 0){define('Y_GRAB_LIMIT',intval($_POST['str_news'])-1);
- }else{define('Y_GRAB_LIMIT',0);}
- if (intval($_POST['str_newf']) != 0)define('X_GRAB_LIMIT',intval($_POST['str_newf']));
- else define('X_GRAB_LIMIT',strlen($action)>4?str_replace('scan','',$action):false);
- if (count ($channel) == 0)
- {
- if ($count_str_url == '0')msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- else msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['no_grab_url'],'javascript:history.go(-1)');
- return 1;
- }
- $channel_list = @implode (',',$channel);
- $rss_parser = new rss_parser ();
- $sql = $db->query ('SELECT * FROM '.PREFIX .('_rss WHERE id IN ('.$channel_list .') ORDER BY xpos,title ASC'));
- $db->close;
- $news_count = 1;
- echoheader ('','');
- echo '<form method=post name="news_form" id="news_form">';
- if ($config_rss['button_nw'] == 'yes') $button_nw = '<button align="right" type="submit" class="btn" id="checkss" disabled> - '.$lang_grabber['no_news_selected'].' - </button>';
- opentable ($lang_grabber['grab_msg'],$button_nw);
- if ($config_rss['get_proxy'] == 'yes') get_proxy();
- $config_rss['get_prox'] = $tab_id;
- echo $bb_js."<script type=\"text/javascript\">
- var sin_open = 0;
- var nosin_open = 0;
- function find_relates ( id )
- {
- var ajax = new dle_ajax();
- ajax.onShow ('');
- var title = ajax.encodeVAR( document.getElementById('title_' + id).value);
- var varsString = 'title=' + title;
- ajax.requestFile ='engine/ajax/find_relates.php';
- ajax.element = 'related_news' + id;
- ajax.sendAJAX(varsString);
- return false;
- }
- function start_sinonims (key, id )
- {
- var ajax = new dle_ajax();
- ajax.onShow ('');
- if (key == 1)var title = ajax.encodeVAR( document.getElementById('short_' + id).value);
- else var title = ajax.encodeVAR( document.getElementById('full' + id).value);
- var varsString = 'story=' + title;
- ajax.setVar(\"id\", id);
- ajax.setVar(\"key\", key);
- ajax.requestFile ='engine/ajax/start_sinonims.php';
- if (key == 1)ajax.element = 'sinonim_short' + id;
- else ajax.element = 'sinonim_full' + id;
- ajax.method = 'POST';
- ajax.sendAJAX(varsString);
- return false;
- }
- function auto_keywords ( key, id )
- {
- var ajax = new dle_ajax();
- ajax.onShow ('');
- var wysiwyg = '{$config['allow_admin_wysiwyg']}';
- var short_txt = ajax.encodeVAR( document.getElementById('short_' + id).value );
- var varsString = \"short_txt=\" + short_txt;
- ajax.setVar(\"full_txt\", ajax.encodeVAR( document.getElementById('full' + id).value ));
- ajax.setVar(\"key\", key);
- ajax.requestFile = \"engine/ajax/keywords.php\";
- if (key == 1) { ajax.element = 'autodescr' + id; }
- else { ajax.element = 'keywords' + id;}
- ajax.method = 'POST';
- ajax.sendAJAX(varsString);
- return false;
- };
- </script>
- ";
- echo '
- <input type="hidden" name="action" value="doaddnews" />
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <script>
- var form = document.getElementById(\'news_form\');
- // ---------------------------------
- // Check column
- // ---------------------------------
- function check_all ( permtype , master_box) {
- var ajax = new dle_ajax();
- ajax.onShow (\'\');
- var checkboxes = form.getElementsByTagName(\'input\');
- for (var i = 0; i < checkboxes.length; i++)
- {
- var element = checkboxes[i];
- if ( element && (element.id != \'mod\') && (element.id != \'main\') && (element.id != \'comm\') ) {
- var element_id = element.id;
- var a = element_id.replace( /^(.+?)_.+?$/, "$1" );
- if (a == permtype)
- {
- element.checked = master_box;
- }
- }
- }
- ajax.onHide (\'\');
- return false;
- }
- // ---------------------------------
- // Check all categories
- // ---------------------------------
- function check_cat() {
- var select_list = form.getElementsByTagName(\'select\');
- var value = form.category.value;
- for (var i = 0; i < select_list.length; i++)
- {
- var element = select_list[i];
- element.value = value;
- }
- return false;
- }
- function checkAll(field){
- nb_checked=0;
- for(n=0;n<field.length;n++)
- if(field[n].checked)nb_checked++;
- if(nb_checked==field.length){
- for(j=0;j<field.length;j++){
- field[j].checked=!field[j].checked;
- field[j].parentNode.parentNode.style.backgroundColor
- =field[j].backgroundColor==\'\'?\'#E8F9E6\':\'\';
- }
- }else{
- for(j=0;j<field.length;j++){
- field[j].checked = true;
- field[j].parentNode.parentNode.style.backgroundColor
- =\'#E8F9E6\';
- }document.news_form.select_all.checked=true;
- }
- }
- function selectRow(evnt,elmnt){
- var ch=elmnt.getElementsByTagName("TD")[10].firstChild;
- tg = document.all?evnt.srcElement:evnt.target;
- //if(tg.tagName!=\'INPUT\')ch.checked=!ch.checked;
- elmnt.style.backgroundColor=ch.checked?\'#E8F9E6\':\'\';
- }
- function preview( id )
- {
- dd=window.open(\'\',\'prv\',\'height=400,width=750,resizable=1,scrollbars=1\');
- document.addnews.target=\'prv\';
- document.addnews.title.value = document.getElementById(\'title_\' + id).value;
- document.addnews.short_story.value = document.getElementById(\'short_\' + id).value;
- if (document.getElementById(\'full\' + id)) {
- document.addnews.full_story.value = document.getElementById(\'full\' + id).value;
- } else {
- document.addnews.full_story.value = "";
- }
- document.addnews.allow_br.value = 1;
- document.addnews.submit();
- }
- function ShowOrHideEx(id, show) {
- var item = null;
- if (document.getElementById) {
- item = document.getElementById(id);
- } else if (document.all) {
- item = document.all[id];
- } else if (document.layers){
- item = document.layers[id];
- }
- if (item && item.style) {
- item.style.display = show ? "" : "none";
- }
- }
- function xfInsertText(text, element_id) {
- var item = null;
- if (document.getElementById) {
- item = document.getElementById(element_id);
- } else if (document.all) {
- item = document.all[element_id];
- } else if (document.layers){
- item = document.layers[element_id];
- }
- if (item) {
- item.focus();
- item.value = item.value + " " + text;
- item.focus();
- }
- }
- </script>
- <link rel="stylesheet" type="text/css" media="all" href="engine/skins/calendar-blue.css" title="win2k-cold-1" />
- <script type="text/javascript" src="engine/skins/calendar.js"></script>
- <script type="text/javascript" src="engine/skins/calendar-en.js"></script>
- <script type="text/javascript" src="engine/skins/calendar-setup.js"></script>
- ';
- echo "
- <script>
- $(document).ready(function(e){
- $('#news_form').submit(function() {
- $(this).ajaxSubmit(options);
- // !!! Важно !!!
- // всегда возвращаем false, чтобы предупредить стандартные
- // действия браузера (переход на страницу form.php)
- return false;
- });
- function countChecked() {
- var n = $(\".sel:checked\").length;
- $(\"#checks\").text(n == 0 ? '- ".$lang_grabber['no_news_selected']." -' : \"".$lang_grabber['add_database']." \" + n + (n%10 == 1 ? \" ".$lang_grabber['post_one']."\" : (n <= 4 ? \" ".$lang_grabber['post_sm']."\" : \" ".$lang_grabber['post_big']."\")));
- $('button').attr('disabled', n == 0 ? true : false);
- if (n ==0 ){
- $(\"#checks\").toggleClass('btn-danger', true);
- $(\"#checks\").toggleClass('btn-success', false);
- }else{
- $(\"#checks\").toggleClass('btn-danger',false);
- $(\"#checks\").toggleClass('btn-success', true);
- }
- }
- countChecked();
- $(\":checkbox\").click(countChecked);
- function countCheckeds() {
- var n = $(\".sel:checked\").length;
- $(\"#checkss\").text(n == 0 ? '- ".$lang_grabber['no_news_selected']." -' : \"".$lang_grabber['add_database']." \" + n + (n%10 == 1 ? \" ".$lang_grabber['post_one']."\" : (n <= 4 ? \" ".$lang_grabber['post_sm']."\" : \" ".$lang_grabber['post_big']."\")));
- $('button').attr('disabled', n == 0 ? true : false);
- if (n ==0 ){
- $(\"#checkss\").toggleClass('btn-danger', true);
- $(\"#checkss\").toggleClass('btn-success', false);
- }else{
- $(\"#checkss\").toggleClass('btn-danger',false);
- $(\"#checkss\").toggleClass('btn-success', true);
- }
- }
- countCheckeds();
- $(\":checkbox\").click(countCheckeds);
- });
- function ShowOrHideg( id ) {
- var item = document.getElementById(id);
- if ( document.getElementById('image-'+ id) ) {
- var image = document.getElementById('image-'+ id);
- } else {
- var image = null;
- }
- if (!item) {
- retun;
- } else {
- if (item.style) {
- if (item.style.display == \"none\") {
- item.style.display = \"\";
- image.src = './engine/inc/plugins/images/minus.gif';
- } else {
- item.style.display = \"none\";
- image.src = './engine/inc/plugins/images/plus.gif';
- }
- } else{ item.visibility = \"show\"; }
- }
- };
- </script>
- ";
- include ($rss_plugins.'inserttag.php');
- echo $bb_js;
- while ($row = $db->get_row ($sql))
- {
- $str_urls = array();
- $i = 1;
- $end_title = explode ('==',$row['end_title']);
- $dop_sort = explode ('=',$row['short_story']);
- $dop_nast = explode ('=',$row['dop_nast']);
- $ctp = explode ('=',$row['ctp']);
- $start_template = stripslashes ($row['start_template']);
- $finish_template = explode ('|||',stripslashes ($row['finish_template']));
- $dnast = explode ('=',$row['dnast']);
- $sart_cat = explode('|||',$row['sart_cat']);
- $cookies = str_replace('|||','; ',str_replace("\r",'',stripslashes(rtrim($row['cookies']))));
- $allow_mod = ($row['allow_mod'] == 0 ?'checked': '');
- $allow_main = ($row['allow_main'] == 1 ?'checked': '');
- $allow_comm = ($row['allow_comm'] == 1 ?'checked': '');
- $channel_id = $row['id'];
- $hide_leech = explode('=',$row['end_short']);
- $rewrite = ($hide_leech[3] == 1 ?'checked': '');
- $met = ($dnast[9] == 1 ?'checked': '');
- $config_rss['convert'] = (intval($dnast[32]) == 1 ?'yes': 'no');
- $rss = $row['rss'];
- $charsets = '';
- $leech_shab = $dnast[25];
- if (trim($dop_nast[14]) != ''or $dop_nast[14] != '0')$charsets = explode('/',$dop_nast[14]);
- if (count ($ctp) == 0 and $rss == 1){$ctp[0] = 0;$ctp[1] = 0;}
- if ($_POST['str_kans'] and $_POST['str_kanf'] and $rss != 1){
- $ctp[0] = $_POST['str_kans'];
- $ctp[1] = $_POST['str_kanf'];
- }
- $URL = get_urls(trim($row['url']));
- if ($count_str_url >'0'){
- foreach ($_POST['str_url'] as $kk=>$str_url){
- if ($str_url ==''){unset ($_POST['str_url'][$kk]);continue;}
- if (preg_match ('#'.str_replace('www.','','http://'.$URL['host']).'#i',str_replace('www.','',$str_url)))
- {if (!(in_array ($str_url,$str_urls)))$str_urls[] = $str_url;
- unset ($_POST['str_url'][$kk]);
- }
- }
- $_POST['str_newf'] = count ($str_urls);
- }
- if (intval($_POST['str_news']) != 0)$text_str = '<br><font color="green"> '.$lang_grabber['s_news'].' '.$_POST['str_news'].' '.$lang_grabber['po_news'].' '.$_POST['str_newf'].' '.$lang_grabber['post_one'].'</font>';
- echo ' <input type="hidden" name="channels[]" value="'.$channel_id .'" />
- <fieldset style="border:1px dashed #c4c4c4;">
- <legend><font color="#C0C0C0">№'.$row['xpos'].' - </font>'.$row['title'].'<br /><a href="http://'.$URL['host'].'" target="_blank"><font color="blue">http://'.$URL['host'].'</font></a>'.$text_str.'</legend>'.'';
- $cron_job = ENGINE_DIR.'/cache/cron_job.txt';
- if (@file_exists($cron_job))
- {
- $job = file($cron_job);
- if ($job[0] == $row['id'])
- {
- $lang_grabber['no_news'] = $lang_grabber['job_on_cron'];
- echo '
- <table cellpadding="4" cellspacing="0">
- <tr><td class="navigation" style="padding:4px">
- <b>'.$lang_grabber['job_on_cron'].'</b>
- </td></tr>
- </table>
- </fieldset>';
- continue;
- }
- }
- $news_per_channel = 1;
- if ($ctp[1] >0 and intval($ctp[0]) == 0 ) $ctp[0] = '1';
- for ($cv=$ctp[0];$cv<=$ctp[1];$cv++)
- {
- if (intval($dop_nast[20]) != '0'and intval($dop_nast[20]) != '1'){
- if (intval($dop_nast[25]) == 0)$dop_nast[25] = '1';
- $cvp = abs($cv * $dop_nast[20] -($dop_nast[20] -intval($dop_nast[25])));
- }else{$cvp = abs($cv);}
- if (count ($str_urls) == '0')
- {
- if ($cvp != 0 and $rss == 0)
- {
- if ($row['full_link'] == ''){
- $rows = $row['url'].'/page/'.$cvp.'/';
- }else {
- $rows = str_replace ('{num}',$cvp,$row['full_link']);
- }
- if ($cvp == 0 or $cvp == 1 ) $pg = $lang_grabber['pst_st'];else $pg = $lang_grabber['pst'].$cvp;
- echo '<table width="100%">
- <tr>
- <td ><a href="'.$rows.'" target="_blank"><b><font color="orange">'.$pg.'</font></b></a></td>
- </tr>
- </table>';
- $URL = get_urls(trim($rows));
- }
- if ($rss == 1){
- $rss_parser->default_cp = $dop_nast[14];
- $rss_result = $rss_parser->Get ($row['url'],$dop_nast[2]);
- }else{
- $URLitems = get_full ($URL[scheme],$URL['host'],$URL['path'],$URL['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
- if (trim($dop_nast[14]) == ''or $dop_nast[14] == '0')$chariks = charset($URLitems);else $chariks = $charsets[0];
- if ($row['ful_start'] != ''){
- $row_ful_start = explode("\r\n",$row['ful_start']);
- if ($row_ful_start[1] != ''){$URLitems = get_page ($URLitems,$row_ful_start[1]);
- $URLitems = $URLitems[0];
- }
- $rss_result = get_page ($URLitems,$row_ful_start[0]);
- }else{
- $rss_result = get_dle($URLitems);
- }
- }
- $time_stamp = time () +$config['date_adjust'] * 60;
- $time = date ('Y-m-d H:i:s',$time_stamp);
- }else {$rss_result = $str_urls;$rss = 0;}
- if ($rss_result)
- {
- if ($rss == 1){
- if (X_GRAB_LIMIT) {
- if ($rss_result['items_count'] >X_GRAB_LIMIT) $grab_lis = X_GRAB_LIMIT -$rss_result['items_count'];
- else $grab_lis = X_GRAB_LIMIT;
- $rss_result['items'] = array_slice($rss_result['items'],Y_GRAB_LIMIT,$grab_lis);
- }
- $rss_result = $rss_result['items'];
- }else{
- if (X_GRAB_LIMIT&&count($rss_result)>X_GRAB_LIMIT) {
- if (count($rss_result) >X_GRAB_LIMIT) $grab_lis = X_GRAB_LIMIT -count($rss_result);
- else $grab_lis = X_GRAB_LIMIT;
- $rss_result = array_slice($rss_result,Y_GRAB_LIMIT,$grab_lis);
- }
- }
- $news_str_channel = 1;
- $result = count($rss_result);
- echo ' <input type="hidden" name="news-per-result-'.$channel_id .'" value="'.$result.'" />';
- if($config_rss['reverse'] == 'no')$rss_result = array_reverse($rss_result,true);
- foreach ($rss_result as $skey=>$item)
- {
- echo ' <input type="hidden" name="news-result" value="1" />';
- $skey = $skey +1;
- $tags_tmp = '';
- $charik = '';
- if (intval($dop_nast[19]) != 0)sleep ($dop_nast[19]);
- unset ($news_link);
- unset ($news_tit);
- unset ($short_story);
- unset ($full_story);
- unset ($xfields_array);
- if (count($str_urls) == '0')
- {
- if ($rss == 1){
- $news_tit = rss_strip ($item['title']);
- $short_story = rss_strip($item['description']);
- $news_link = stripslashes (rss_strip($item['link']));
- $tags_tmp = rss_strip ($item['category']);
- }else{
- if ($chariks != strtolower($config['charset']) AND $item!= '') $item = convert($chariks,strtolower($config['charset']),$item);
- if (trim($row['start_title']) != ''and $dnast[22] != 1)$news_tit = strip_tags_smart(get_full_news($item,$row['start_title']));
- if ($row['end_link'] != 1){
- $short_story = rss_strip (get_short_news ($item,$row['start_short']));
- }else{
- $short_story = rss_strip (get_full_news ($item,$row['start_short']));
- }
- if (trim($row['sart_link'])==''){
- $tu_link = get_link ($item);
- $news_link = 'http://'.$URL['host'].'/index.php?newsid='.$tu_link;
- }else{
- $news_lin = get_full_news($item,$row['sart_link']);
- $news_link = full_path_build ($news_lin,$URL['host'],$URL['path']);
- }
- }
- if ($rss == 1){
- if (trim ($news_link) == '')
- {
- $news_link = stripslashes (rss_strip($item['guid']));
- }
- }
- }else {$news_link = $item;}
- if (trim($news_tit) != ''){
- echo"
- <div id=\"progressbar\"></div>
- <script> storyes($skey, $result,'".trim($news_tit)."');</script>";
- }
- ob_flush();
- flush();
- if ($dnast[27] == 1){
- $link_cachefile = array_map('trim',@file(ENGINE_DIR.'/inc/plugins/files/cachefile.txt'));
- if (!in_array ($news_link,$link_cachefile))openz(ENGINE_DIR.'/inc/plugins/files/cachefile.txt',$news_link."\n",'a');
- else continue;
- }
- if (trim($end_title[2]) != ''and trim($news_tit) != '') $news_tit =rss_strip( relace_news ($news_tit,$end_title[2],$end_title[3]));
- $alt_name = $db->safesql (totranslit( stripslashes( $news_tit ),true,false ));
- $safeTitle = $db->safesql($news_tit);
- $link = 'get_url'.$story;
- $news_link = full_path_build ($news_link,$URL['host'],$URL['path']);
- if ($dop_sort[12] == 0) {$where = ' LIMIT 1';}
- elseif ($dop_sort[12] == 1 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%'";}
- elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
- elseif ($dop_sort[12] == 3 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%' OR title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
- else {if ($safeTitle != ''and $alt_name != '')$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";
- else $where = ' LIMIT 1';
- }
- $sql_result = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
- if ($db->num_rows ($sql_result) == 0 or $news_tit ==''or $hide_leech[3] == 1 or $dop_sort[12] == 0)
- {
- $full_story = '';
- if (trim($end_title[4]) != ''and trim($news_link) != '') $news_lik = relace_news ($news_link,$end_title[4],$end_title[5]);
- else $news_lik = $news_link;
- $news_li=$link;
- for ($j=1;$j <= 20;$j++){
- $stoped = false;
- if (trim($row['dop_full']) == ''and $j != '1'and $full_story != '')$stoped = true;
- if ((trim ($start_template) != ''or trim($sart_cat[2]) != '') and !$stoped)
- {
- if ($dop_nast[18] == 0 ){
- if (trim($row['dop_full'])!= ''and $j >= 2){
- $news_link = str_replace('http://','',$news_lik);
- $fl = explode('/',$news_link);
- $news_linke = '';
- for ($k=0;$k<(count($fl)-1);$k++){
- $news_linke .= $fl[$k].'/';
- }
- $news_linke .= str_replace('{num}',$j,$row['dop_full']);
- $news_link = 'http://'.$news_linke.end($fl);
- }
- }
- else{
- if ($j >= 2) $news_link = $news_lik.$row['dop_full'];
- $news_link= preg_replace('#\.html(.*){num}#i','\\1{num}.html',$news_link);
- $news_link= str_replace('.html.html','.html',$news_link);
- $news_link= str_replace('{num}',$j,$news_link);
- }
- if (trim($end_title[4]) != ''and trim($news_link) != '') $news_link = relace_news ($news_link,$end_title[4],$end_title[5]);
- $link = replace_url($news_li(trim(rss_strip($news_link))));
- $full = get_full ($link[scheme],$link['host'],$link['path'],$link['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
- $link = '';
- }
- else
- {
- break;
- }
- if (trim ($full) != ''){
- if (trim($dop_nast[14]) == ''or $dop_nast[14] == '0')$charik = charset($full);else $charik = strtolower($charsets[1] != ''?$charsets[1]:$charsets[0]);
- if (trim($row['start_title']) != ''and $dnast[22] == 1){
- $news_tit = strip_tags_smart(get_full_news($full,$row['start_title']));
- if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
- }
- if (trim ($start_template) != '')
- {
- $tags_tty = '';
- if ($charik != strtolower($config['charset']) and trim ($charik) != '') {$tags_tty = convert($charik,strtolower($config['charset']),$full);}
- if ($hide_leech[0] != 1){
- $full_storys = get_short_news ($full,$start_template);
- }else{
- $full_storys = get_full_news ($full,$start_template);
- }
- if (sizeof($finish_template) and trim ($full_storys) == '')
- {
- foreach ($finish_template as $shabz){
- $full_storys = get_full_news ($full,$shabz);
- if (trim($full_storys) != '')break;
- }
- }
- if ( ($full_storys) == ''){
- list($start_temp,$finish_temp) = explode('{get}',$start_template,2);
- $full_storys = get_news($full,$start_temp,$finish_temp);
- }
- if ($full_storys == '')break;
- if ($j == '1')$full_story1 = $full_storys;
- if ($full_storys != $full_story1 or $j == '1'or $full_story == '')
- {
- $full_story .= $full_storys;
- }else{break;}
- }else{break;}
- }
- if ($full_story == '')break;
- }
- if (preg_match('#<script>#i',$dop_sort[5]))
- {
- preg_match_all ("#(<script.+?>.+?<\/script>)#is",$full_story,$scrip);
- if (count($scrip[0])){
- foreach ($scrip[0] as $k_s=>$s_v){
- $template = addcslashes(stripslashes($s_v),"[]!-.#?*%+\\()|");
- $full_story = preg_replace('#'.$template.'#is','[skpipt'.$k_s.']',$full_story);
- }
- }
- }
- $news_link = $news_lik;
- if ($charik != strtolower($config['charset']) and trim ($full_story) != ''and trim ($charik) != '') {$full_story = convert($charik,strtolower($config['charset']),$full_story);}
- if (trim($row['start']) != ''){
- $row_finish = str_replace('{link}',$news_link,$row['finish']);
- $full_story = relace_news ($full_story,$row['start'],$row_finish,2);
- $short_story = relace_news ($short_story,$row['start'],$row_finish,1);
- if (trim ($sart_cat[0]) != ''or trim ($sart_cat[1]) != ''){
- $full = relace_news ($full,$row['start'],$row_finish);
- $tags_tty = relace_news ($tags_tty,$row['start'],$row_finish);
- $item = relace_news ($item,$row['start'],$row_finish);
- }
- }
- if (trim ($sart_cat[1]) != ''){
- $data_tmp =strip_tags_smart(get_full_news($full,$sart_cat[1]));
- if ($charik != strtolower($config['charset']) and trim ($data_tmp) != ''and trim ($charik) != '') {$data_tmp = convert($charik,strtolower($config['charset']),$data_tmp);}
- if (trim ($data_tmp) == ''){
- $data_tmp =strip_tags_smart(get_full_news($item.$tags_tty,$sart_cat[1]));
- }
- }
- if (trim ($tags_tmp,', ') == ''){
- if (trim ($sart_cat[0]) != '')$tags_tmp =strip_tags_smart(get_full_news($full,$sart_cat[0]));
- if ($charik != strtolower($config['charset']) and trim ($tags_tmp) != ''and trim ($charik) != '') {$tags_tmp = convert($charik,strtolower($config['charset']),$tags_tmp);}
- if (trim ($tags_tmp,', ') == ''){
- $tags_tmp =strip_tags_smart(get_full_news($item.$tags_tty,$sart_cat[0]));
- }
- }
- $xfields_array = array();
- if (trim($row['xfields_template']) != '')
- {
- $xfields_array = get_xfields (rss_strip($full_story),$short_story,$row['xfields_template']);
- $full_story = $xfields_array['content_story'];
- $short_story = $xfields_array['content0_story'];
- }
- $link = replace_url($news_li(trim(rss_strip($news_link))));
- $full_story = html_strip ($full_story);
- if (trim($news_tit) == ''and trim ($full) != '')
- {
- $news_tit = get_title($full);
- if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
- }
- if (trim($news_tit) == ''and trim ($full_story) != ''){
- $news_tit = get_tit($short_story.$full_story);
- if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
- }
- if($dop_sort[9] != 0) {
- $full_story = trim(preg_replace('/[\r\n\t]+/',' ',$full_story));
- $short_story = trim(preg_replace('/[\r\n\t]+/',' ',$short_story));
- }
- $full_story = trim(preg_replace("#(<br \/>|<br>)\s+(\S)#",'\\1\\2',$full_story));
- $short_story = trim(preg_replace("#(<br \/>|<br>)\s+(\S)#",'\\1\\2',$short_story));
- $full_story = trim(preg_replace('/\s+/',' ',$full_story));
- $short_story = trim(preg_replace('/\s+/',' ',$short_story));
- if ((trim($news_tit) == ''or intval($dnast[33]) == 1) and trim($short_story != '')){
- $tit_kon = strpos(substr( strip_tags ($short_story) ,'50'),' ');
- $tit_nach = '50'+$tit_kon +1;
- $news_tit = substr( strip_tags ($short_story) ,0,$tit_nach);
- }
- if($dop_sort[13] == 1) {$translate_google = translate_google (rss_strip('<{title}>'.$news_tit.'<{short}>'.trim($short_story).'<{full}>'.trim($full_story).'<{tags_tmp}>'.$tags_tmp.'<{end}>'),$dop_sort[14] ,$dop_sort[15] );
- preg_match('!<{title}>(.*)<{short}>!is',$translate_google,$tran1);
- preg_match('!<{short}>(.*)<{full}>!is',$translate_google,$tran2);
- preg_match('!<{full}>(.*)<{tags_tmp}>!is',$translate_google,$tran3);
- preg_match('!<{tags_tmp}>(.*)<{end}>!is',$translate_google,$tran4);
- if (trim($tran1[1]) == '')$tran1[1] = translate_google (rss_strip($news_tit),$dop_sort[14] ,$dop_sort[15] );
- if (trim($tran2[1]) == '')$tran2[1] = translate_google (rss_strip($short_story),$dop_sort[14] ,$dop_sort[15] );
- if (trim($tran3[1]) == '')$tran3[1] = translate_google (rss_strip($full_story),$dop_sort[14] ,$dop_sort[15] );
- if (trim($tran4[1]) == '')$tran4[1] = translate_google (rss_strip($tags_tmp),$dop_sort[14] ,$dop_sort[15] );
- if (intval($dnast[34]) == 0){
- if ($dnast[35] == 1 and $dop_sort[18] == ''){$news_tit = $tran1[1].'/'.$news_tit;}
- else {$news_tit = $tran1[1];}
- }
- $short_story = $tran2[1];
- $full_story = $tran3[1];
- $tags_tmp = $tran4[1];
- }
- if($dop_sort[13] == 1 and $dop_sort[18] != '') {$translate_google = rss_strip (translate_google (rss_strip('<{title}>'.$news_tit.'<{short}>'.trim($short_story).'<{full}>'.trim($full_story).'<{tags_tmp}>'.$tags_tmp.'<{end}>'),$dop_sort[15] ,$dop_sort[18] ));
- preg_match('!<{title}>(.*)<{short}>!is',$translate_google,$tran1);
- preg_match('!<{short}>(.*)<{full}>!is',$translate_google,$tran2);
- preg_match('!<{full}>(.*)<{tags_tmp}>!is',$translate_google,$tran3);
- preg_match('!<{tags_tmp}>(.*)<{end}>!is',$translate_google,$tran4);
- if (trim($tran1[1]) == '')$tran1[1] = rss_strip (translate_google (rss_strip($news_tit),$dop_sort[15] ,$dop_sort[18] ));
- if (trim($tran2[1]) == '')$tran2[1] = rss_strip (translate_google (rss_strip($short_story),$dop_sort[15] ,$dop_sort[18] ));
- if (trim($tran3[1]) == '')$tran3[1] = rss_strip (translate_google (rss_strip($full_story),$dop_sort[15] ,$dop_sort[18] ));
- if (trim($tran4[1]) == '')$tran4[1] = rss_strip (translate_google (rss_strip($tags_tmp),$dop_sort[15] ,$dop_sort[18] ));
- if (intval($dnast[34]) == 0){
- if ($dnast[35] == 1){$news_tit = $tran1[1].'/'.$news_tit;}
- else {$news_tit = $tran1[1];}
- }
- $short_story = $tran2[1];
- $full_story = $tran3[1];
- $tags_tmp = $tran4[1];
- }
- $news_tit = rss_strip($news_tit);
- if (trim($end_title[2]) != ''and trim($news_tit) != '') $news_tit = relace_news ($news_tit,$end_title[2],$end_title[3]);
- srand((float)microtime() * 1000000);
- preg_match_all("#\[(.+?)\]#is",$end_title[0],$end_title00);
- if (count($end_title00[1]) )
- {
- $end_title08 = $end_title[0];
- foreach ($end_title00[1] as $kl=>$nmb){
- $end_title000 = explode('|',$nmb);
- $end_title000 = $end_title000[array_rand($end_title000)];
- $end_title08 = preg_replace("#\[".addcslashes($nmb,"[]!-.#?*%+\\()|")."\]#",$end_title000,$end_title08,1);
- }
- $end_title0[0] = $end_title08;
- }else{
- $end_title0 = explode('|',$end_title[0]);
- }
- preg_match_all("#\[(.+?)\]#is",$end_title[1],$end_title10);
- if (count($end_title10[1]))
- {
- $end_title18 = $end_title[1];
- foreach ($end_title10[1] as $kl=>$nmb){
- $end_title100 = explode('|',$nmb);
- $end_title100 = $end_title100[array_rand($end_title100)];
- $end_title18 = preg_replace("#\[".addcslashes($nmb,"[]!-.#?*%+\\()|")."\]#",$end_title100,$end_title18,1);
- }
- $end_title1[0] = $end_title18;
- }else{
- $end_title1 = explode('|',$end_title[1]);
- }
- $news_title =trim($end_title0[array_rand($end_title0)].' '.((preg_match('#{frag#',$end_title[0]) or preg_match('#{frag#',$end_title[1]))?'':$news_tit).' '.$end_title1[array_rand($end_title1)]);
- $alt_name = totranslit( stripslashes( trim($news_tit) ),true,false );
- if ($dnast[12] == 1) $row['symbol'] =$db->safesql(e_substr(htmlspecialchars(strip_tags(stripslashes(trim( strtolower ($news_tit) ) ) ) ),0,$dnast[13],$config['charset'] ) );
- if ($news_title !='') echo"
- <div id=\"progressbar\"></div>
- <script> storyes($skey, $result,'$news_title');</script>";
- ob_flush();
- flush();
- if (trim($news_tit) == '') continue;
- $full_allow_news = false;
- if ($dop_sort[12] == 0) {$where = ' LIMIT 1';}
- elseif ($dop_sort[12] == 1 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%'";}
- elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$db->safesql ($news_title)."' OR alt_name = '".$db->safesql ($alt_name)."'";}
- elseif ($dop_sort[12] == 3 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%' OR title = '".$db->safesql ($news_title)."' OR alt_name = '".$db->safesql ($alt_name)."'";}
- else {$where = " WHERE title = '".$db->safesql ($news_title)."' OR alt_name = '".$db->safesql ($alt_name)."'";}
- $sql_result = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
- if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] != 1 )$full_allow_news = true;
- if ($db->num_rows ($sql_result) == 0 or $hide_leech[3] == 1 or $dop_sort[12] == 0)
- {
- $frag_ar = $zhv_code = array();
- $frag_ar = explode('===',$sart_cat[2]);
- if(count($frag_ar)){
- $kl_z = 0;
- foreach ($frag_ar as $kl_zas=>$frag_vl){
- $key_fr != '';
- if (preg_match("#\[GOLINK=(.*)\]#",$frag_vl,$outs_f)){
- $frag_vl = str_replace($outs_f[0],'{get}',$frag_vl);
- $key_fr = get_full_news ($full,$frag_vl);
- $linkf = replace_url($news_li(trim(rss_strip($key_fr))));
- $full_fr = get_full ($link_f[scheme],$linkf['host'],$linkf['path'],$linkf['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
- $key_fr = get_full_news ($full_fr,$outs_f[1]);
- }else{
- $key_fr = get_full_news ($full,$frag_vl);
- }
- $kl_z++;
- if (trim ($key_fr) != '')
- {
- if ($charik != strtolower($config['charset']) and trim ($key_fr) != ''and trim ($charik) != '') {
- $key_fr = convert($charik,strtolower($config['charset']),$key_fr);
- }
- if (trim($row['start']) != ''){
- $key_fr = relace_news ($key_fr,$row['start'],$row_finish);
- }
- $key_fr = rss_strip($key_fr);
- $key_fr = addcslashes(stripslashes($key_fr),'#');
- $key_fr = parse_Thumb ($key_fr);
- $key_fr = parse_rss ($key_fr);
- $key_fr = $parse->decodeBBCodes ($key_fr,false);
- $key_fr = rss_strip ($key_fr);
- $key_fr = strip_tags_smart ($key_fr,'<object><embed><param>'.$dop_sort[5]);
- if($dop_sort[13] == 1) {$key_fr = translate_google ($key_fr,$dop_sort[14] ,$dop_sort[15] );}
- if($dop_sort[13] == 1 and $dop_sort[18] != '') {$key_fr = rss_strip (translate_google ($key_fr,$dop_sort[15] ,$dop_sort[18] ));}
- $key_fr = preg_replace('#"#','"',$key_fr);
- $zhv_code[$kl_z] = strip_br($key_fr);
- }
- }
- }
- if (trim ($full_story) != '')
- {
- $full_story = rss_strip($full_story);
- $full_story = addcslashes(stripslashes($full_story),'#');
- $full_story = parse_Thumb ($full_story);
- $full_story = parse_rss ($full_story);
- $full_story = $parse->decodeBBCodes ($full_story,false);
- $full_story = rss_strip ($full_story);
- $full_story = strip_tags_smart ($full_story,'<object><embed><param>'.$dop_sort[5]);
- $full_story = preg_replace('#"#','"',$full_story);
- $full_story = strip_br($full_story);
- }
- else
- {
- $full_story = '';
- $full_allow_news = true;
- }
- $short_story = parse_Thumb ($short_story);
- $short_story = parse_rss ($short_story);
- $short_story = unhtmlentities( $short_story );
- $short_story = $parse->decodeBBCodes ($short_story,false);
- $short_story = rss_strip ($short_story);
- $short_story = strip_tags_smart ($short_story,'<object><embed><param>'.$dop_sort[5]);
- $short_story = preg_replace('#"#','"',$short_story );
- $short_story = strip_br($short_story );
- $short_stor = $short_story;
- if ($dop_sort[2] == 1) $full_story = $short_story.'<br /><br />'.$full_story;
- if ($dop_sort[0] != 0)$short_story = '';
- $full_story = strip_br($full_story);
- if($dop_sort[11] != 0) {
- $news_title = str_replace( ' ',' ',$news_title );
- }
- $full_story = parse_host ($full_story,$link['host'],$link['path']);
- $short_story = parse_host ($short_story,$link['host'],$link['path']);
- $short_story = create_URL ($short_story,$link['host']);
- $full_story = create_URL ($full_story,$link['host']);
- if ($dnast[7] == 1 or $dnast[7] == 3) $short_story = url_img_($short_story );
- if ($dnast[7] == 2 or $dnast[7] == 3) $full_story = url_img_($full_story );
- if ($dop_nast[1] == 1){
- if ($dop_nast[16] == 1 or $dop_nast[16] == 0)$short_story=preg_replace( "#(^|\s|>)((http://|https://|ftp://)\w+[^<\s\[\]]+)#i","\\1[url]\\2[/url]",$short_story );
- if ($dop_nast[16] == 2 or $dop_nast[16] == 0)$full_story=preg_replace( "#(^|\s|>)((http://|https://|ftp://)\w+[^<\s\[\]]+)#i","\\1[url]\\2[/url]",$full_story );
- }
- if($dop_nast[1] == 2){
- if ($dop_nast[16] == 1 or $dop_nast[16] == 0)$short_story = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$short_story );
- if ($dop_nast[16] == 2 or $dop_nast[16] == 0)$full_story = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$full_story );
- }
- if($dop_nast[1] == 3){
- if ($dop_nast[16] == 1 or $dop_nast[16] == 0)$short_story = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$short_story );
- if ($dop_nast[16] == 2 or $dop_nast[16] == 0)$full_story = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$full_story );
- }
- if ($hide_leech[1] == '1'){
- $short_story = replace_hide ($short_story);
- $full_story = replace_hide ($full_story);
- }
- if ($hide_leech[2] == '1'){
- $short_story = replace_leech ($short_story);
- $full_story = replace_leech ($full_story);
- }else{
- $short_story = replace_noleech ($short_story);
- $full_story = replace_noleech ($full_story);
- }
- $short_story = replace_quote ($short_story);
- $full_story = replace_quote ($full_story);
- if ($dop_nast[10] == 1){
- $short_story = trim(preg_replace('/[\r\n\t ]{3,}/','
- ',$short_story));
- $full_story = trim(preg_replace('/[\r\n\t ]{3,}/','
- ',$full_story));
- }
- if (intval($dop_nast[22]) != 0){
- if ($dop_nast[24] != '')$kones = $dop_nast[24];
- else $kones = ' ';
- $kol_b='';
- if (trim($short_story) != '')$full_stor = $short_story;
- else $full_stor = $full_story;
- $bb_d = array();
- $bb_dd = array();
- $dop_kon = strpos(substr( $full_stor ,$dop_nast[22]),$kones);
- $short_sto = substr( $full_stor ,0,$dop_nast[22]);
- preg_match_all('#\[(img|thumb).*\].*?\[\/(img|thumb)\]#is',$short_sto,$bb_d);
- if (count($bb_d[0]) != 0){
- foreach($bb_d[0] as $eh){
- $kol_b += strlen($eh);
- }
- }
- preg_match_all('#\[.*?\]#i',$short_sto,$bb_dd);
- if (count($bb_dd[0]) != 0){
- foreach($bb_dd[0] as $eh){
- $kol_b += strlen($eh);
- }
- }
- $dop_nast[22] +=$kol_b;
- $dop_kon = strpos(substr( $full_stor ,$dop_nast[22]),$kones);
- $nach = $dop_nast[22] +$dop_kon +1;
- if (intval($dop_nast[22]) != 0) $short_story = substr( $full_stor ,0,$nach);
- else $short_story = substr( $full_stor ,0,strpos(substr( $full_stor ,$dop_nast[22]),$kones));
- $short_story .= '...';
- $short_story = preg_replace('#\[\S+\.\.\.#','...',$short_story);
- $short_story = preg_replace('#<\S+\.\.\.#','...',$short_story);
- $short_story = preg_replace('#\.\s\.\.\.#','...',$short_story);
- $short_story = preg_replace('#,\s\.\.\.#','...',$short_story);
- $short_story = str_replace('....','...',$short_story);
- $short_story = preg_replace('#[\.]{2,}#','',$short_story);
- $short_story = close_dangling_tags($short_story).'...';
- if (trim($short_story,'., ') == '')$short_story = '';
- }
- if ($dop_sort[1] == 1 or $dop_sort[0] == 1 or count($str_urls) >'0') {
- if ($short_story == ''and $full_story != ''or $dop_sort[1] == 1){
- if (!preg_match ('#\[img.+?\]#i',$short_story) and !preg_match ('#\[thumb.+?\]#i',$short_story))$short_story = get_im ($full_story,$dop_sort[22],$dnast[39]).$short_story;
- }
- }
- if ($dop_sort[17] != 0)$full_story = '';
- if ($dop_nast[17] == 1 or $dop_nast[17] == 3){
- $indeg = get_im ($full_story);
- $full_story = str_replace ($indeg,'',$full_story);
- $full_story = $indeg.$full_story;
- }
- if ($dop_nast[17] == 2 or $dop_nast[17] == 3){
- $indeg = get_im ($short_story);
- $short_story = str_replace ($indeg,'',$short_story);
- $short_story = $indeg.$short_story;
- }
- if(intval($dop_nast[23]) != 0){
- $full_story = str_replace('[thumb','[img',$full_story);
- $full_story = str_replace('thumb]','img]',$full_story);
- preg_match_all ('#\[img.*?\](.+?)\[\/img\]#i',$full_story,$img_a);
- $is = 1;
- $num_i=ceil(count($img_a[0])/$dop_nast[23]);
- $is_k = 1;
- foreach ($img_a[0] as $value)
- {
- if ($is %$dop_nast[23] == 0){
- $full_story = str_replace($value,$value."\n{PAGEBREAK}\n",$full_story);
- $is_k++;
- }
- $is++;
- if ($num_i == $is_k)break;
- }
- }
- if (trim($row['xfields_template']) != '')
- {
- $xfields_array = get_xfields (rss_strip($full_story),$short_story,$row['xfields_template'],$xfields_array);
- $full_story = $xfields_array['content_story'];
- $short_story = $xfields_array['content0_story'];
- }
- $short_story = replace_align ($short_story,$dnast[0]);
- $full_story = replace_align ($full_story,$dnast[1]);
- if ($dnast[36] != ''and $dnast[36] != $dnast[1])
- {
- $img_poster = get_im ($full_story);
- $full_story = str_replace ($img_poster,replace_align ($img_poster,$dnast[36]),$full_story);
- $full_story = preg_replace('#\[center\]\[(img|thumb)=(.*?)\[\/(img|thumb)\]\\[/center\]#is','[\\1=\\2[/\\3]',$full_story);
- }
- $short_story = htmlspecialchars ($short_story);
- $full_story = htmlspecialchars ($full_story);
- if (!((!($row['date_format'] == 0) AND !($row['date_format'] == 1))))
- {
- $added_time_stamp = time () +($config['date_adjust'] * 60);
- $dat = $lang_grabber['date_post'].$lang_grabber['date_flowing'];
- if ($row['date_format'] == 1)
- {
- $interval = mt_rand ($config_rss['interval_start']*60,$config_rss['interval_finish']*60);
- $added_time_stamp += $interval;
- $dat = $lang_grabber['date_post'].$lang_grabber['date_casual'];
- }
- }
- else
- {
- if ($rss == 1 or trim($sart_cat[1]) != ''){
- if ($row['date_format'] == 2)
- {
- if(!preg_match('/\d/i',$data_tmp))$data_tmp = time ();
- else $data_tmp = parse_date($data_tmp);
- if ($data_tmp >time ())$data_tmp = time ();
- if ($rss == 0 and trim($data_tmp) != ''){$added_time_stamp = $data_tmp;}
- else $added_time_stamp = strtotime ($item['pubDate']);
- $dat = $lang_grabber['date_post'].$lang_grabber['date_channel'];
- }
- }else{$added_time_stamp = time () +($config['date_adjust'] * 60);
- $dat = $lang_grabber['date_post'].$lang_grabber['date_flowing'];
- }
- }
- $str_date = date( 'Y-m-d H:i:s',$added_time_stamp);
- if (preg_match('/00:00:00/',$str_date))$str_date = str_replace('00:00:00',date('H:i:s',time()),$str_date);
- $keywordsd = explode ('===',$row['keywords']);
- $keywords = stripslashes ($keywordsd[0]);
- if (trim ($keywords) != '')
- {
- $allow_news = FALSE;
- $keywords = explode ('|||',$keywords);
- foreach ($keywords as $word)
- {
- if (trim($word) != ''){
- $word = addcslashes(stripslashes($word),'"[]!-.#?*%\\()|/');
- if (preg_match ('#'.$word.'#',$short_story) or preg_match ('#'.$word.'#',$full_story) or preg_match ('#'.$word.'#',$news_title))
- {
- $allow_news = TRUE;
- }
- }else{$allow_news = TRUE;}
- }
- }
- else
- {
- $allow_news = TRUE;
- }
- $stkeywordsd = explode ('===',$row['stkeywords']);
- $stkeywords = stripslashes ($stkeywordsd[0]);
- if (trim ($stkeywords) != '')
- {
- $stkeywords = explode ('|||',$stkeywords);
- foreach ($stkeywords as $word)
- {
- if (trim($word) != ''){
- $word = addcslashes(stripslashes($word),'"[]!-.#?*%\\()|/');
- if (preg_match ('#'.$word.'#',$short_story) or preg_match ('#'.$word.'#',$full_story) or preg_match ('#'.$word.'#',$news_title))
- {
- $allow_news = FALSE;
- }
- }
- }
- }
- if (trim($keywordsd[1]) != '')$short_story = $keywordsd[1].' '.$short_story;
- if (trim($keywordsd[2]) != '')$full_story = $keywordsd[2].' '.$full_story;
- if (trim($stkeywordsd[1]) != '')$short_story .=' '.$stkeywordsd[1];
- if (trim($stkeywordsd[2]) != '')$full_story .=' '.$stkeywordsd[2];
- foreach ($zhv_code as $k_zh=>$v_zh){
- $short_story= str_replace('{frag'.$k_zh.'}',$v_zh,$short_story);
- $full_story= str_replace('{frag'.$k_zh.'}',$v_zh,$full_story);
- $news_title = str_replace('{frag'.$k_zh.'}',$v_zh,$news_title);
- $short_story= str_replace('{frag}',$v_zh,$short_story);
- $full_story= str_replace('{frag}',$v_zh,$full_story);
- $news_title = str_replace('{frag}',$v_zh,$news_title);
- }
- $news_title_out = $parse->decodeBBCodes($news_title);
- if (trim ($row['delate']) != '')
- {
- $row_inser= str_replace('{zagolovok}',$news_title,$row['inser']);
- $row_inser= str_replace('{link}',$news_link,$row['inser']);
- foreach ($zhv_code as $k_zh=>$v_zh){
- $row_inser= str_replace('{frag'.$k_zh.'}',$v_zh,$row_inser);
- $row_inser= str_replace('{frag}',$v_zh,$row_inser);
- }
- $short_story = relace_news ($short_story,$row['delate'],$row_inser,1);
- $full_story = relace_news ($full_story,$row['delate'],$row_inser,2);
- }
- $short_story= str_replace('{link}',$news_link,$short_story);
- $full_story= str_replace('{link}',$news_link,$full_story);
- $short_story= str_replace('{zagolovok}',$news_title,$short_story);
- $full_story= str_replace('{zagolovok}',$news_title,$full_story);
- $short_story= trim(strip_br ($short_story)," \n\t");
- $full_story= trim(strip_br ($full_story)," \n\t");
- if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] == 1){
- $word = addcslashes(stripslashes($news_link),'"[]!-.#?*%\\()|/');
- while ($ren = $db->get_row($sql_result)){
- if ($dnast[17] != 1){
- if ($dop_sort[12] == 1 or $dop_sort[12] == 3)$xfi=true;
- if(preg_match('#'.$word.'#i',$ren['xfields']) or !$xfi){
- $kolsa = array();$kolsb = array();
- preg_match_all("#<a.*?href[=]?[='\"](\S+?)['\" >].*?>(.*?)<\/a>#is",$ren['full_story'],$kolsa);
- preg_match_all('#\[url(\S+?)\].+?\[/url\]#i',$full_story,$kolsb);
- if (count($kolsa[0]) >= count($kolsb[0])){$allow_news = false;
- }else{$allow_news = true;
- break;
- }
- }
- }else{
- if ($dnast[30] == 1 and trim($data_tmp) == '')$data_tmp = 'data';
- if ($row['date_format'] == 2 and $data_tmp != ''){
- if ($dop_sort[12] == 1 or $dop_sort[12] == 3)$xfi=true;
- if(preg_match('#'.$word.'#i',$ren['xfields']) or !$xfi or trim($ren['xfields']) == ''){
- $allow_news = false;$full_allow_news=false;
- if (parse_date($str_date) >parse_date($ren['date'])){
- $allow_news = true;
- }else{$allow_news = false;$full_allow_news=false;}
- break;}
- }
- }
- }
- }
- if ($db->num_rows ($sql_result) == 0 and $hide_leech[3] == 1)$rewrite = '';
- if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] == 1) $rewrite = 'checked';
- if ($dnast[30] == 1 and $db->num_rows ($sql_result) == 0){$allow_news = false;$full_allow_news=false;}
- if (count($scrip[0])){
- foreach ($scrip[0] as $k_s=>$s_v){
- echo $k_s;
- $full_story = preg_replace("#\[skpipt".$k_s."\]#is",$s_v,$full_story);
- }
- }
- if ($allow_news)
- {
- $Autor = explode('=',$row['Autors']);
- if (trim($Autor[0]) != '')
- {
- $input=array ();
- $autor = explode ('|||',stripslashes($Autor[0]));
- foreach ($autor as $value)
- {
- $input[] =trim($value);
- }
- }
- else
- {if (trim($Autor[1]) == '') $Autor[1] = $config_rss['reg_group'];
- if (trim($Autor[1]) == '') $Autor[1] = 1;
- $rows = $db->query ('SELECT * FROM '.PREFIX ."_users WHERE user_group IN ({$Autor[1]})");
- while ($rown = $db->get_row($rows)) {
- $input[] = $rown['name'];
- }
- }
- if ($input != '')$author = $input[array_rand ($input)];
- $author_info = " <a onclick=\"javascript:window.open('?mod=editusers&action=edituser&user={$author}','User','toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=540,height=500'); return(false)\" href=\"#\"><img src=\"engine/skins/images/adminrss.gif\" style=\"vertical-align: middle;border: none;\" /></a>";
- $news_info = " <a onclick=\"javascript:window.open('{$news_link}','','toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=540,height=500'); return(false)\" href=\"google.com\"><img src=\"engine/skins/images/addresrss.gif\" alt='".$lang_grabber['orig_news']."' title='".$lang_grabber['orig_news']."' style=\"vertical-align: middle;border: none;\" /></a>";
- $sin_bb = " <div id=\"sin_b\" class=\"editor_button\" onclick=\"simpletag('sin')\"><img title=\"{$lang_grabber['sin_bbcode']}\" src=\"engine/skins/bbcodes/images/sin2.gif\" width=\"23\" height=\"25\" border=\"0\"></div><div id=\"nosin_b\" class=\"editor_button\" onclick=\"simpletag('nosin')\"><img title=\"{$lang_grabber['nosin_bbcode']}\" src=\"engine/skins/bbcodes/images/nosin2.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
- $sin_bb .='<div class="editor_button" onclick="javascript:window.open( \''.$PHP_SELF .'?mod=rss&action=sinonim\')"><img title="'.$lang_grabber['base_sin'].'" src="engine/skins/bbcodes/images/sin.gif" width="23" height="25" border="0"></div>';
- $sin_but= "<input class=\"edit\" style=\"margin: 0 0 3 0px; background: #E8F9E6; font-size:9pt;\" onclick=\"simpletag('sin')\" type=\"button\" value=\"sin\"> <input class=\"edit\" style=\"margin: 0 0 3 0px; background: #E8F9E6; font-size:9pt; text-decoration:line-through; \" onclick=\"simpletag('nosin')\" type=\"button\" value=\"nosin\">
- ";
- $key_wordss = '';
- $descrs = '';
- if ($dop_sort[7] == 5)$key_wordss = keyword($tags_tty);
- if ($dop_sort[10] == 5)$descrs = description($tags_tty);
- if ($key_wordss == ''or $descrs == ''){
- $metatags_short = create_metategs ($short_story);
- $metatags_full = create_metategs ($full_story);
- }
- if ($dop_sort[7] != 4 and $key_wordss == ''){
- if ($dop_sort[7] == 1){
- $key_wordss = trim($metatags_short['keywords'],' ,');
- }elseif ($dop_sort[7] == 2){
- $key_wordss = trim($metatags_full['keywords'],' ,');
- }elseif ($dop_sort[7] == 3){
- if ($metatags_full['keywords'] >= $metatags_short['keywords']){
- $key_wordss = trim($metatags_full['keywords'],' ,');
- }else{
- $key_wordss = trim($metatags_short['keywords'],' ,');
- }
- }else{
- $key_wordss = trim($metatags_short['keywords'].', '.$metatags_full['keywords'],' ,');
- }
- }
- $key_words = trim($row['key_words'].', '.$key_wordss,' ,');
- $key_words = substr( $key_words ,0,190 +strpos(substr( $key_words ,190),','));
- if ($dop_sort[10] != 4 and $descrs == ''){
- if ($dop_sort[10] == 1){
- $descrs = trim($metatags_short['description'],' ,');
- }elseif ($dop_sort[10] == 2){
- $descrs = trim($metatags_full['description'],' ,');
- }elseif ($dop_sort[10] == 3){
- if ($metatags_full['description'] >= $metatags_short['description']){
- $descrs = trim($metatags_full['description'],' ,');
- }else{
- $descrs = trim($metatags_short['description'],' ,');
- }
- }else{
- $descrs = trim($metatags_short['description'].', '.$metatags_full['description'],' ,');
- }
- }
- $descr = trim($row['meta_descr'].', '.$descrs ,' ,');
- $descr = substr( $descr ,0,190 +strpos(substr( $descr ,190),' '));
- $category_row = array();
- $category = array();
- $kateg = array();
- $tags_tmps = array();
- $tags_tm = '';
- $tags_tmpr = $tags_tmp;
- if ($dnast[21] == 0) $tags_tmps = replace_tags_title ($tags_tmp.','.$news_tit,$dnast[20]);
- else $tags_tmps = replace_tags ($tags_tmp.','.$full_story.','.$news_tit,$dnast[20]);
- if ($dnast[8] == 0){
- $tags_tm = trim(preg_replace('/[\r\n\t]+/','',$tags_tmp));
- if (intval($dnast[20]) != 0 and $tags_tm != ''){
- $sort = explode(',',$tags_tm);
- $strsm = array ();
- for ($ir=0;$ir<intval($dnast[20]);$ir++){$strsm[] = $sort[$ir];}
- $tags_tm = implode(',',$strsm);
- }
- }else{
- $tags_tm = $tags_tmps[0];
- }
- $tags_tmp = trim($row['ftags'].','.$tags_tm ,',');
- if (trim($row['sart_link'])==''and $rss == 0)$n_link= get_flink ($tags_tty.$full,$link['host'],$tu_link);
- else $n_link = $news_link;
- if (trim($row['kategory']) != ''){
- foreach (explode ('|||',$row['kategory']) as $value){
- $kr = explode ('==',$value);
- foreach (explode (',',$kr[0]) as $wnd){
- $url_kats = addcslashes(stripslashes(reset_urlk($wnd)),'"[]!-.#?*%\\()|/');
- if($dop_sort[16] == 1)$for = $tags_tmpr;
- else $for = $n_link;
- if (preg_match('#'.$url_kats.'#i',$for)){
- foreach (explode (',',$kr[1]) as $key){
- $db->close;
- $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
- if (trim($key) != '')$sql_cat= $db->super_query ('SELECT * FROM '.PREFIX ."_category WHERE name like '".$db->safesql(trim(strtolower($key)))."%' or alt_name like '".$db->safesql(trim(strtolower($key)))."%' or name like '".$db->safesql(trim($key))."%' or alt_name like '".$db->safesql(trim($key))."%'");
- if (trim($sql_cat['id']) != '')
- {
- $kateg[]=$sql_cat['id'];
- }
- }
- }
- }
- }
- }
- if (count($kateg) == 0){
- if ($row['thumb_img'] == 1){
- $gory = explode (',',$tags_tmps[1].','.$tags[1]);
- foreach ($gory as $value) {
- $db->close;
- $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
- if (trim($value) != '')$sql_cat= $db->super_query ('SELECT * FROM '.PREFIX ."_category WHERE name like '".$db->safesql(trim(strtolower($value)))."%' or alt_name like '".$db->safesql(trim(strtolower($value)))."%' or alt_name like '".$db->safesql(trim($value))."%' or alt_name like '".$db->safesql(trim($value))."%'");
- if (trim($sql_cat['id']) != '')
- {
- $category[]=$sql_cat['id'];
- }
- }
- }
- }else{$category =$kateg;}
- $categoryes = explode ('=',$row['category']);
- $category_row = explode (',',$categoryes[0]);
- if (count($category_row) == 1)$category_row = $categoryes[0];
- if (count($category) != '0'){
- $categories_list = CategoryNewsSelection (array_unique($category),0);
- }else{
- $categories_list = CategoryNewsSelection ($category_row,0);
- }
- unset ($news_tit);
- $db->close;
- $xfieldsaction = 'categoryfilter';
- include ($rss_plugins.'xfields.php');
- echo $categoryfilter;
- echo " <script >
- $(document).ready(function(e){
- $(\"select#category$i$channel_id\").change(function (e) {
- var str = \"\";
- $(\"select#category$i$channel_id option:selected\").each(function () {
- str += $(this).text() + \" \";
- });
- $(\".category$i$channel_id\").text(str);
- })
- .trigger('change');
- });
- </script>
- <script>
- $(function(){
- $('#tags$i$channel_id').autocomplete({
- serviceUrl:'engine/ajax/tags_rss.php',
- minChars:3,
- delimiter: /(,|;)\s*/,
- maxHeight:400,
- width:348,
- deferRequestBy: 300
- });
- });
- </script>
- <table width=\"100%\">
- <tr class=\"light\" onMouseOut=this.className=\"light\"
- onMouseOver=this.className=\"highlight\"
- onclick=\"selectRow(event,this)\">
- <td style=\"padding:4px\" align=\"left\" ><a href=\"javascript:ShowOrHideg('full_$i$channel_id');\">$news_title_out</a>";
- if ($dop_nast[5] == '0')$ava = ' style="display:none"';
- if ($dop_nast[7] == '0')$avd = ' style="display:none"';
- if ($dop_nast[6] == '0')$avt = ' style="display:none"';
- if ($dop_nast[13] == '0')$avw = ' style="display:none"';
- if ($dnast[2] == '0')$ada = ' style="display:none"';
- if ($dnast[3] == '0')$add = ' style="display:none"';
- if ($dnast[4] == '0')$adt = ' style="display:none"';
- if ($dnast[5] == '0')$adw = ' style="display:none"';
- if ($dnast[6] == '0')$adu = ' style="display:none"';
- if ($dnast[14] == '0')$ade = ' style="display:none"';
- if ($dnast[2] == '0'and $dnast[3] == '0'and $dnast[4] == '0'and $dnast[5] == '0'and $dnast[6] == '0')$adg = ' style="display:none"';
- if ($dop_sort[17] == 0 and intval($dop_sort[20]) == 0){
- if (trim ($full_story) == ''and trim ($news_link) !='')
- {
- echo " <br /><font color=red>{$lang_grabber['no_full_story']}</font> ==> <a href=\"$news_link\" target=\"_blank\">{$news_link}</a>";
- }
- }
- echo "</td>
- <td align=\"right\" ><font color=red><div class=\"category$i$channel_id\"></div></font></td>
- <td width=\"1%\" ></td>";
- if($dnast[28] == 1 and (@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php'))) {
- echo " <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"twitter_$i$channel_id\" id=\"twitter_$i$channel_id\" checked value=\"1\" style=\"background-color: #ffffff; color: #0000FF;\" title=\"{$lang_grabber['twitter']}\" /></td>";
- }else{echo "<td width=\"0px\" align=\"right\"></td>";}
- if($dnast[26] == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
- {
- echo " <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"crosspost_$i$channel_id\" id=\"crosspost_$i$channel_id\" checked value=\"1\" style=\"background-color: #ffffff; color: #FF6600;\" title=\"{$lang_grabber['crosspost']}\" /></td>";
- }else {echo "<td width=\"0px\" align=\"right\"></td>";}
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
- echo " <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"sinonims_$i$channel_id\" id=\"sinonims_$i$channel_id\" checked value=\"1\" style=\"background-color: #ffffff; color: #008000;\" title=\"{$lang_grabber['val_sinonims']}\" /></td>";
- }else {echo "<td width=\"0px\" align=\"right\"></td>";}
- echo " <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"rewrite_$i$channel_id\" id=\"rewrite_$i$channel_id\" {$rewrite} value=\"1\" title=\"{$lang_grabber['val_rewrite']}\" /></td>
- <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"mod_$i$channel_id\" id=\"mod_$i$channel_id\" {$allow_mod} value=\"1\" title=\"{$lang_grabber['val_mod']}\" /></td>
- <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"main_$i$channel_id\" id=\"main_$i$channel_id\" {$allow_main} value=\"1\" title=\"{$lang_grabber['val_main']}\"/></td>
- <td class=\"bd0\" align=\"right\"><input type=\"checkbox\" name=\"comm_$i$channel_id\" id=\"comm_$i$channel_id\" {$allow_comm} value=\"1\" title=\"{$lang_grabber['val_comm']}\"/></td>
- <td class=\"bd0\" align=\"right\"><input class=\"sel\" type=\"checkbox\" name=\"sel_$i$channel_id\" id=\"sel\" value=\"1\" style=\"background-color: #ffffff; color: #ff0000;\" title=\"{$lang_grabber['val_post']}\" /></td>
- </tr>
- <tr>
- <td colspan=\"10\">
- <div style=\"padding-top:5px;padding-bottom:2px;display:none\" id=\"full_$i$channel_id\">
- <div class=\"hr_line\"></div>
- <table width=\"100%\">
- <tr>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['edit_et']}</td>
- <td><input size=\"70\" name=\"title_$i$channel_id\" id=\"title_$i$channel_id\" value=\"{$news_title_out}\"> <input class=\"edit\" type=\"button\" onClick=\"find_relates($i$channel_id); return false;\" style=\"width:160px;\" value=\"{$lang['b_find_related']}\"> <a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[hint_title]}', this, event, '220px')\">[?]</a> {$news_info} <div id=\"related_news$i$channel_id\"></div>
- </td>
- </tr>
- <tr $ava>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['author']}</td>
- <td><input name=\"autor_$i$channel_id\" id=\"autor_$i$channel_id\" size=\"30\" value=\"{$author}\">$author_info</td>
- </tr>
- <tr $avd>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$dat}:</td>
- <td><input name=\"date-from-channel_$i$channel_id\" id=\"date-from-channel_$i$channel_id\" size=\"30\" value=\"{$str_date}\">
- <img src=\"engine/skins/images/img.gif\" align=\"absmiddle\" id=\"f_trigger_c_$i$channel_id\" style=\"cursor: pointer; border: 0\" title=\"{$lang['edit_ecal']}\"/>
- <script type=\"text/javascript\">
- Calendar.setup({inputField:\"date-from-channel_$i$channel_id\",ifFormat:\"%Y-%m-%d %H:%M\",button:\"f_trigger_c_$i$channel_id\",align : \"Br\",timeFormat:\"24\",showsTime:true,singleClick:true});
- </script>
- </td>
- </tr>
- <tr>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['edit_cat']}</td>
- <td><select name=\"category$i$channel_id []\" id=\"category$i$channel_id\" onchange=\"onCategoryChange$i$channel_id(this.value)\" class=\"cat_select\" multiple>{ $categories_list }</select>
- </td>
- </tr>
- <tr $avt><td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['tegs_post']}:</td>
- <td><input size=\"70\" id=\"tags$i$channel_id\" name=\"tags_$i$channel_id\" value=\"{$tags_tmp}\" class=\"edit bk\" autocomplete=\"off\">
- </td>
- </tr>
- </table>
- <div class=\"hr_line\"></div>
- <table width=\"100%\">
- <tr>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_short']}<br /></td>
- <td>";
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
- if ($dop_nast[8] == '1')echo $sin_bb;
- else echo $sin_but;
- }
- if ($dop_nast[8] == '1'){
- echo $bb_panel;
- }
- echo "<textarea style=\"width:98%; height:200px\" onclick=\"setFieldName(this.name)\" id=\"short_$i$channel_id\" name=\"short_$i$channel_id\">{$short_story}</textarea>";
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') )
- {
- echo "<input class=\"edit\" type=\"button\" onClick=\"start_sinonims(1, $i$channel_id); return false;\" style=\"width:180px; background: #FFF9E0; border: 1px solid #8C8C8C;\" value=\"{$lang_grabber['sinonims_preview']}\"> <a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang_grabber['help_sinonims_preview']}', this, event, '220px')\">[?]</a> <span id=\"sinonim_short$i$channel_id\"></span>";}echo "
- </td>
- </tr>
- <tr>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_full']}</td>
- <td><br />";
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
- if ($dop_nast[8] == '1')echo $sin_bb;
- else echo $sin_but;
- }
- if ($dop_nast[8] == '1'){
- echo $bb_panel;
- }
- echo "<textarea style=\"width:98%; height:200px\" onclick=\"setFieldName(this.name)\" id=\"full$i$channel_id\" name=\"full_$i$channel_id\">{$full_story}</textarea>";
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') )
- {echo "
- <input class=\"edit\" type=\"button\" onClick=\"start_sinonims(2, $i$channel_id); return false;\" style=\"width:180px; background: #FFF9E0; border: 1px solid #8C8C8C;\" value=\"{$lang_grabber['sinonims_preview']}\"> <a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang_grabber['help_sinonims_preview']}', this, event, '220px')\">[?]</a> <span id=\"sinonim_full$i$channel_id\"></span>";}echo "
- </td>
- </tr>
- <tr $avw>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['pics_post']}:</td>
- <td>
- <select name=\"serv_$i$channel_id\" id=\"serv_$i$channel_id\">
- ".server_host($row['load_img'])."</select>
- <a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang_grabber['help_post_rad']}', this, event, '220px')\">[?]</a>
- </td>
- </tr>";
- if ($dop_nast[9] == '1')
- {
- echo "<tr >
- <td style=\"padding:4px\" align=\"left\" colspan=\"8\"><a href=\"javascript:ShowOrHideg('xf_$i$channel_id');\"><font color=\"green\">{$lang_grabber['doppol']}</font></a></td>
- </tr>
- <tr>
- <td colspan=\"8\">
- <div style=\"display:none\" id=\"xf_$i$channel_id\">
- <div class=\"hr_line\"></div>
- <table width=\"100%\">";
- $xreplace = array();
- $ds = explode ('|||',$row['xfields_template']);
- foreach ($ds as $xvalue)
- {
- $xf=array();
- $xf = explode ('==',$xvalue);
- $xreplace[$xf[0]] = $xf;
- }
- $fieldvalue = array();
- if (count($xfields_array) !=0){
- foreach ($xfields_array as $key =>$value){
- if ($key != 'content_story'){
- if(array_key_exists($key,$xreplace)) {
- $xreplace_key = str_replace('{zagolovok}',$news_title,$xreplace[$key][6]);
- $xreplace_key = str_replace('{link}',$news_link,$xreplace_key);
- foreach ($zhv_code as $k_zh=>$v_zh){
- $xreplace_key= str_replace('{frag'.$k_zh.'}',$v_zh,$xreplace_key);
- $xreplace_key= str_replace('{frag}',$v_zh,$xreplace_key);
- }
- $value = relace_news ($value,$xreplace[$key][5],$xreplace_key);
- }
- $value = parse_Thumb ($value);
- $value = parse_rss ($value);
- $value = $parse->decodeBBCodes ($value,false);
- $value = rss_strip ($value);
- $value = strip_tags_smart ($value,'<object><embed><param>'.$dop_sort[5]);
- if($dop_sort[13] == 1) {$value = rss_strip (translate_google ($value,$dop_sort[14] ,$dop_sort[15] ));}
- if($dop_sort[13] == 1 and $dop_sort[18] != '') {$value = rss_strip (translate_google ($value,$dop_sort[15] ,$dop_sort[18] ));}
- $value = preg_replace('#"#','"',$value);
- if ($xreplace[$key][4] == 1)$value = '[img]'.$value.'[/img]';
- $value = parse_host ($value,$link['host'],$link['path']);
- if ($xreplace[$key][4] == 1){
- $value=str_replace( '[img]','',$value );
- $value=str_replace( '[/img]','',$value );
- }
- '<pre>'.$value.'</pre>';
- if ($dop_nast[1] == 1){
- $value=preg_replace( "#(^|\s|>)((http://|https://|ftp://)\w+[^<\s\[\]]+)#i","\\1[url]\\2[/url]",$value );
- }
- if($dop_nast[1] == 2){
- $value = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$value );
- }
- if($dop_nast[1] == 3){
- $value = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$value );
- }
- if (intval($xreplace[$key][8]) != 0 and trim($value) != ''){
- if ($dop_nast[24] != '')$kones = $dop_nast[24];
- else $kones = ' ';
- $kol_b='';
- $full_stor = $value;
- $bb_d = array();
- $bb_dd = array();
- $dop_kon = strpos(substr( $full_stor ,$xreplace[$key][8]),$kones);
- $short_sto = substr( $full_stor ,0,$xreplace[$key][8]);
- preg_match_all('#\[(img|thumb)\].*?\[\/(img|thumb)\]#is',$full_sto,$bb_d);
- if (count($bb_d[0]) != 0){
- foreach($bb_d[0] as $eh){
- $kol_b += strlen($eh);
- }
- }
- preg_match_all('#[.*?]#i',$full_sto,$bb_dd);
- if (count($bb_dd[0]) != 0){
- foreach($bb_dd[0] as $eh){
- $kol_b += strlen($eh);
- }
- }
- $xreplace[$key][8] +=$kol_b;
- $dop_kon = strpos(substr( $full_stor ,$xreplace[$key][8]),$kones);
- $nach = $xreplace[$key][8] +$dop_kon +1;
- if (intval($xreplace[$key][8]) != 0) $value = substr( $full_stor ,0,$nach).'...';
- else $value = substr( $full_stor ,0,strpos(substr( $full_stor ,$xreplace[$key][8]),$kones)).'...';
- $value = preg_replace('#<\S+\.\.\.#','...',$value);
- $value = preg_replace('#\.\s\.\.\.#','...',$value);
- $value = preg_replace('#,\s\.\.\.#','...',$value);
- $value = str_replace('....','...',$value);
- if (trim($value,'., ') == '')$value == '';
- }
- $value= str_replace('{zagolovok}',$news_title,$value);
- foreach ($zhv_code as $k_zh=>$v_zh){
- $value= str_replace('{frag'.$k_zh.'}',$v_zh,$value);
- $value= str_replace('{frag}',$v_zh,$value);
- }
- $fieldvalue[$key] = $value;
- }
- }
- }
- if ($row['allow_more'] == 1)
- {
- $fieldvalue['source_name'] = $row['title'];
- $fieldvalue['source_link'] = $news_link;
- }
- $xfieldsaction = 'list';
- include ($rss_plugins.'xfields.php');
- $config_code_bb = explode (',',$config_rss['code_bb'] );
- $config_sin_dop = explode (',',$config_rss['sin_dop'] );
- if ($config_rss['code_bb'] != ''){
- foreach ($config_code_bb as $value){
- $output = str_replace('<!--'.$value.'-->','<!--'.$value.'-->'.$bb_panel,$output);
- }
- }
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') and $config_rss['sin_dop'] != '')
- {
- foreach ($config_sin_dop as $val){
- if (in_array($val,$config_code_bb))$output = str_replace('<!--'.$val.'-->',$sin_bb,$output);
- else $output = str_replace('<!--'.$val.'-->',$sin_but,$output);
- }
- }
- echo $output;
- echo '</table>
- </div>
- </td>
- </tr>';
- }
- echo "<tr $adg>
- <td style=\"padding:4px\" align=\"left\" colspan=\"8\"><a href=\"javascript:ShowOrHideg('dop_$i$channel_id');\"><font color=\"green\">{$lang_grabber['dopmet']}</font></a></td>
- </tr>
- <tr>
- <td colspan=\"8\">
- <div style=\"display:none\" id=\"dop_$i$channel_id\">
- <table width=\"100%\" >
- ";
- if (intval($dnast[10]) != 0){
- $expires = date( 'Y-m-d H:i:s',(strtotime($str_date) +$dnast[10] * 86400));
- if($dnast[11] == 1)$expi = 'selected';else $exp = 'selected';
- }else{$expires = '';}
- if (intval($dnast[10]) != 0){
- if ($expires != ''){$datede = strtotime ($expires);}else
- {$datede = strtotime ($thistime) +$dnast[10] * 86400;}
- $db->query( 'INSERT INTO '.PREFIX ."_post_log (news_id, expires, action) VALUES('$news_id', '$datede', '{$dnast[11]}')");
- }
- echo " <td colspan=\"2\"><div class=\"hr_line\"></div></td>
- <tr $ada>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['catalog_url']}</td>
- <td><input type=\"text\" name=\"symbol$i$channel_id\" size=\"5\" class=\"edit\" value=\"{$row['symbol']}\"><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[catalog_hint_url]}', this, event, '300px')\">[?]</a></td>
- </tr>
- <tr $adu>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_url']}</td>
- <td><input type=\"text\" name=\"alt_name$i$channel_id\" size=\"55\" class=\"edit\" value=\"{$alt_names}\"><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[hint_url]}', this, event, '300px')\">[?]</a></td>
- </tr>
- <tr $ade>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['date_expires']}</td>
- <td><input type=\"text\" name=\"expires_$i$channel_id\" id=\"e_date_c_$i$channel_id\" size=\"20\" value=\"{$expires}\" class=edit>
- <img src=\"engine/skins/images/img.gif\" align=\"absmiddle\" id=\"e_trigger_c_$i$channel_id\" style=\"cursor: pointer; border: 0\" /> {$lang['cat_action']} <select name=\"expires_action_$i$channel_id\"><option $exp value=\"0\">{$lang['edit_dnews']}</option><option $expi value=\"1\" >{$lang['mass_edit_notapp']}</option></select><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang['hint_expires']}', this, event, '320px')\">[?]</a>
- <script type=\"text/javascript\">
- Calendar.setup({
- inputField : \"e_date_c_$i$channel_id\", // id of the input field
- ifFormat : \"%Y-%m-%d\", // format of the input field
- button : \"e_trigger_c_$i$channel_id\", // trigger for the calendar (button ID)
- align : \"Br\", // alignment
- singleClick : true
- });
- </script></td>
- </tr>
- <tr $add>
- <td width=\"140\" height=\"29\" > </td>
- <td>{$lang['add_metatags']}<a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang['hint_metas']}', this, event, '220px')\">[?]</a></td>
- </tr>
- <tr $add>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['meta_title']}</td>
- <td><input type=\"text\" name=\"meta_title$i$channel_id\" style=\"width:388px;\" class=\"edit\" value=\"".str_replace('{zagolovok}',$news_title,$row['metatitle'])."\"> <input type=\"checkbox\" name=\"met_$i$channel_id\" {$met} value=\"1\" title=\"{$lang_grabber['val_met']}\" /></td>
- </tr>
- <tr $adt>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['meta_descr']}:<br><i>({$lang['meta_descr_max']})</i></td>
- <td><textarea type=\"text\" name=\"descr$i$channel_id\" id=\"autodescr$i$channel_id\" style=\"width:388px;height:70px;\" >{$descr}</textarea>
- </td>
- </tr>
- <tr $adw>
- <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['meta_keys']}:<br><i>({$lang['meta_descr_max']})</i></td>
- <td><textarea name=\"keywords$i$channel_id\" id='keywords$i$channel_id' style=\"width:388px;height:70px;\">{$key_words}</textarea>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- ";
- echo "<input type=\"hidden\" name=\"news_link_$i$channel_id\" value=\"$news_link\">";
- echo "
- <tr>
- <td><input class=\"edit\" style=\"background: #E8F9E6; font-size:9pt;\" onClick=\"preview($i$channel_id)\" type=\"button\" value=\"{$lang['btn_preview']}\"></td><td align=right><a href=\"javascript:ShowOrHideg('full_$i$channel_id');\"><font color=orange>↑ {$lang_grabber['contr']} ↑</font></a></td>
- </tr>
- </table>
- <div class=\"hr_line\"></div>
- </div>
- </td>
- </tr>
- </table>
- <table cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=8></td></tr>
- </table>";
- ++$i;
- ++$news_count;
- ++$news_per_channel;
- ++$news_str_channel;
- continue;
- }else{echo "<table width=\"100%\">
- <tr class=\"navigation\">
- <td style=\"padding:4px\" align=\"left\" >{$news_tit}</td>
- <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
- </table>";}
- }else{
- if ($full_allow_news){
- echo "<table width=\"100%\">
- <tr class=\"navigation\">
- <td style=\"padding:4px\" align=\"left\" >{$news_title}</td></td>
- <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
- </table>";}else{
- echo "<table width=\"100%\">
- <tr class=\"navigation\">
- <td style=\"padding:4px\" align=\"left\" >{$news_title}</td></td>
- <td align=\"right\" > {$lang_grabber['filer_news']}</td></tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
- </table>";
- }
- }
- }else{echo "<table width=\"100%\">
- <tr class=\"navigation\">
- <td style=\"padding:4px\" align=\"left\" >{$news_tit}</td>
- <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
- </table>";}
- }
- if ($news_count == 1)
- {
- echo '<div align="center" class="navigation">- '.$lang_grabber['no_news'].' -</div>';
- }
- $str = $news_str_channel -1;
- if ($cv != 0 and $rss == 0)
- {
- if ($str == 1) $now = $lang_grabber['post_one'];elseif($str <4 ) $now = $lang_grabber['news_sm'];else $now = $lang_grabber['post_big'];
- if ($str == 0)
- {
- echo '<font color="#339900">- '.$lang_grabber['no_news'].' -</font>';
- }else{
- echo '
- <table cellpadding="4" cellspacing="0">
- <tr><td class="navigation" style="padding:4px">
- <font color="green">'.$lang_grabber['yes_news'].'<b>'.$str.'</b> '.$now.'</font>
- </td></tr>
- </table>';}
- }
- }
- }
- $kol = $news_per_channel -1 ;
- echo ' <input type="hidden" name="news-per-channel-'.$channel_id .'" value="'.$news_per_channel .'" />
- <table cellpadding="4" cellspacing="0">
- <tr><td class="navigation" style="padding:4px">
- '.$lang_grabber['yes_news'].' <b>'.$kol .'</b> '.$lang_grabber['post_big'].'
- </td></tr>
- </table>
- </fieldset>';
- continue;
- }
- $db->free();
- $categories_list = categorynewsselection (0,0);
- echo '<br/>';
- unterline ();
- if( function_exists('memory_get_peak_usage') ) {
- $mem_usage = memory_get_peak_usage(true);
- if ($mem_usage <1024)
- echo $mem_usage.' bytes';
- elseif ($mem_usage <1048576)
- $memory_usage = round($mem_usage/1024,2).' kb';
- else
- $memory_usage = round($mem_usage/1048576,2).' mb';
- }
- $kolv = $news_count -1 ;
- echo ' <table cellpadding="0" cellspacing="0" width="100%" border=0>
- <tr >
- <td class="navigation" style="padding:0px">
- '.$lang_grabber['news_all'].': <b>'.$kolv .'</b><br /> '.$lang_grabber['mem_gr'].' ~ '.$memory_usage.'
- </td>
- <td align="right" style="padding:4px;">
- '.$lang_grabber['gl_val'].':
- <select name="category" id="category" onChange="check_cat();" class="edit">
- '.$categories_list .'
- </select></td>';
- if($dnast[28] == 1 and (@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
- {
- echo '<td class="bd0" align="right"><input type="checkbox" name="twitter_all" id="twitter_all" onClick="check_all(\'twitter\', this.checked);" title="'.$lang_grabber['twitter'].' ('.$lang_grabber['val_all'].')">';
- }else{echo "<td width=\"0px\" align=\"right\"></td>";}
- if($dnast[26] == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
- {
- echo '<td class="bd0" align="right"><input type="checkbox" name="crosspost_all" id="crosspost_all" onClick="check_all(\'crosspost\', this.checked);" title="'.$lang_grabber['crosspost'].' ('.$lang_grabber['val_all'].')">';
- }else{echo "<td width=\"0px\" align=\"right\"></td>";}
- if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
- echo '<td class="bd0" align="right"><input type="checkbox" name="sinonims_all" id="sinonims_all" onClick="check_all(\'sinonims\', this.checked);" title="'.$lang_grabber['val_sinonims'].' ('.$lang_grabber['val_all'].')">';
- }else{echo "<td width=\"0px\" align=\"right\"></td>";}
- echo '</td>
- <td class="bd0" align="right">
- <input type="checkbox" name="rewrite_all" id="rewrite_all" onClick="check_all(\'rewrite\', this.checked);" title="'.$lang_grabber['val_rewrite'].' ('.$lang_grabber['val_all'].')"></td>
- <td class="bd0" align="right">
- <input type="checkbox" name="approve" id="approve" onClick="check_all(\'mod\', this.checked);" title="'.$lang_grabber['val_mod'].' ('.$lang_grabber['val_all'].')"></td>
- <td class="bd0" align="right">
- <input type="checkbox" name="main_all" id="main_all" onClick="check_all(\'main\', this.checked);" title="'.$lang_grabber['val_main'].' ('.$lang_grabber['val_all'].')"></td>
- <td class="bd0" align="right">
- <input type="checkbox" name="comm_all" id="comm_all" onClick="check_all(\'comm\', this.checked);" title="'.$lang_grabber['val_comm'].' ('.$lang_grabber['val_all'].')"></td>
- <td class="bd0" align="right">
- <input type=checkbox name="select_all" id="select_all" onClick="checkAll(document.news_form.sel)" title="'.$lang_grabber['val_all'].'">
- </td>
- <td width="1%" >
- </td>
- </tr>
- </table>
- <table cellpadding="4" cellspacing="0" width="100%">
- <tr>
- <td align="left" style="padding:4px"><input type="button" class="btn btn-warning btn-mini" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" /> </td>
- <td align="right" style="padding:4px"><div class="quick" ></div>
- <button align="right" type="submit" class="btn btn-success" id="checks" disabled> - '.$lang_grabber['no_news_selected'].' - </button>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div></form>
- ';
- echo "<form method=post name=\"addnews\" id=\"addnews\">
- <input type=hidden name=\"mod\" value=\"preview\">
- <input type=hidden name=\"title\" value=\"\">
- <input type=hidden name=\"short_story\" value=\"\">
- <input type=hidden name=\"full_story\" value=\"\">
- <input type=hidden name=\"allow_br\" value=\"1\">
- </form>";
- echo"<script>document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['ajax_info']}';</script>";
- unterline ();
- closetable ();
- echofooter ();
- $db->close;
- return 1;
- }
- if ($action=='config'){
- include $rss_plugins.'config.php';
- return 1;}
- if( $action == 'upload') {
- if (!is_dir($rss_plugins.'files')){
- @mkdir($rss_plugins.'files',0777);
- @chmod($rss_plugins.'files',0777);
- }
- $uploadfile = ENGINE_DIR.'/inc/plugins/files/proxy.txt';
- if (@move_uploaded_file($_FILES['uploadfile']['tmp_name'],$uploadfile) and $_FILES['uploadfile']['type'] == 'text/plain')
- {
- echo '<font color="green">'.$lang_grabber['file_pr_sv'].' </font> <font color="red">'.$lang_grabber['file_loaded'].' '.date( 'Y-m-d H:i:s',filectime(ENGINE_DIR .'/inc/plugins/files/proxy.txt')).'</font>';
- }else{
- @unlink($uploadfile);
- echo "<font color=\"red\">{$lang_grabber['eror']}! {$lang['images_uperr_3']}</font>";
- }
- exit();
- }
- if ($action == 'copy_channel')
- {
- $ids = $_POST['channel'];
- if (count ($ids) == 0)
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- return 1;
- }
- foreach ($ids as $id)
- {
- $copys = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- $copy = array();
- $sql_result = $db->query ('SELECT url FROM '.PREFIX .'_rss');
- $copys['xpos'] = $db->num_rows ($sql_result) +1;
- $copys['id'] = '';
- $copys['title'] = '['.$lang_grabber['cops_canal'].'] '.$copys['title'];
- foreach ($copys as $key =>$value) $copy[$key] = "'".$db->safesql(stripslashes($value))."'";
- $copye = implode(',',$copy);
- $db->query ('INSERT INTO '.PREFIX ."_rss VALUES ({$copye})");
- if (trim ($copy['title']) != '')
- {$title = stripslashes (strip_tags_smart ($copy['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= $lang_grabber['channel'].' '.$copy['xpos'].'<font color="green">"'.$title.' | '.$copy['url'].'"</font> <font color="red">'.$lang_grabber['copy_channel_ok'].'</font><br />';
- }
- msg ($lang_grabber['info'],$lang_grabber['channel_copy'],$mgs ,$PHP_SELF .'?mod=rss');
- return 1;
- }
- if ($action == 'auto_channel')
- {
- $ids = $_POST['channel'];
- if (count ($ids) == 0)
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- return 1;
- }
- foreach ($ids as $id)
- {
- $auto = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- $db->query ('UPDATE '.PREFIX ."_rss SET allow_auto = 1 WHERE id ='$id'");
- if (trim ($auto['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($auto['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$auto['url'].'"</font> <font color="red">'.$lang_grabber['auto_channel_ok'].'</font><br />';
- }
- clear_cache ('cron.rss');
- msg ($lang_grabber['info'],$lang_grabber['channel_auto_y'],$mgs,$PHP_SELF .'?mod=rss');
- return 1;
- }
- if ($action == 'noauto_channel')
- {
- $ids = $_POST['channel'];
- if (count ($ids) == 0)
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- return 1;
- }
- foreach ($ids as $id)
- {
- $auto = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- $db->query ('UPDATE '.PREFIX ."_rss SET allow_auto = '0' WHERE id = '$id' ");
- if (trim ($auto['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($auto['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$auto['url'].'"</font> <font color="red">'.$lang_grabber['auto_channel_no'].'</font><br />';
- }
- clear_cache ('cron.rss');
- msg ($lang_grabber['info'],$lang_grabber['channel_auto_n'],$mgs,$PHP_SELF .'?mod=rss');
- return 1;
- }
- if ($action == 'del_channel')
- {
- $ids = $_POST['channel'];
- if (count ($ids) == 0)
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- return 1;
- }
- if($_POST['act'] == 'sav'){
- $ids = explode ( ',',$ids);
- foreach ($ids as $id)
- {
- $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- $db->query ('DELETE FROM '.PREFIX .('_rss WHERE id = \''.$id .'\''));
- if (trim ($del['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($del['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red">'.$lang_grabber['del_channel_ok'].'</font><br />';
- }
- clear_cache ('cron.rss');
- msg ($lang_grabber['info'],$lang_grabber['del_channel'],$mgs,$PHP_SELF .'?mod=rss');
- return 1;
- }elseif($_POST['act'] != 'sav'){
- echoheader('','');
- opentable ($lang_grabber['del_channel']);
- foreach ($ids as $id)
- {
- $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- if (trim ($del['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($del['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= ' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red"><br />';
- }
- $ids = implode ( ',',$ids);
- echo '
- <form method="post" name="del_channel" id="del_channel">
- <input type="hidden" name="action" value="del_channel">
- <input type="hidden" name="act" value="sav">
- <table width="100%">
- <tr>
- <td align="center">
- <b><font color="red">'.$lang_grabber['del_action'].'</font></b><br /><br />'.$mgs.'
- </td>
- </tr>
- <tr>
- <td align="center">
- <br />
- <input type="hidden" name="channel" value="'.$ids.'">
- <input type="submit" class="btn btn-success" value=" '.$lang['opt_sys_yes'].' " ">
- <input type="button" class="btn btn-warning" value=" '.$lang['opt_sys_no'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
- </td>
- </tr>
- </table>
- </form>';
- closetable ();
- echofooter ();
- return 1;
- }
- }
- if ($action == 'sort') {
- $xpos = $_POST['xpos'];
- $i=1;
- foreach ($xpos as $k=>$v)
- {
- $db->query ('UPDATE '.PREFIX .('_rss set xpos='.((int)$v).' WHERE id = \''.((int)$k) .'\''));
- $i++;
- }
- msg ($lang_grabber['info'],$lang_grabber['sort_channel'],$lang_grabber['sort_channel_ok'],$PHP_SELF .'?mod=rss');
- return 1;}
- if ($config['keygrab'] != $еmpty and $_SERVER['REMOTE_ADDR']!='127.0.0.1'){
- if($_POST['act'] == 'sav'and $_POST['key']==$еmpty){
- if(!array_key_exists('keygrab',$config)){
- $keyz = array ('keygrab'=>$_POST['key'] );
- $cont = $config +$keyz;
- }else{
- $config['keygrab'] = $_POST['key'];
- unset($config['keyrss']);
- $cont = $config;
- }
- openz(ENGINE_DIR.'/data/config.php',"<?php \n\n\$config = ".var_export ($cont,true).";\n?>");
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['key_add'],$PHP_SELF .'?mod=rss');
- return 1;
- }else{
- if(!array_key_exists('keygrab',$config)){
- $i_control = new image_controller ();
- $result = $i_control->download_host ('http://rss-grabber.ru/eng/akk.php?host='.$_SERVER['HTTP_HOST'],$fg);
- preg_match('!<div>(.*?)</div>!i',$result,$out);
- }
- if ($out[1] == '')
- {
- echoheader ($lang_grabber['eror'],'');
- echo "<div align=\"center\">
- <font color=\"red\">{$lang_grabber['no_lis']} !!!</font><br /><br />
- <a href=\"http://rss-grabber.ru\" target=\"_blank\"><font color=\"green\"><b>{$lang_grabber['buy_lis']}</font></b></a><br /><br />{$lang_grabber['key_buy']}.<br /><br />
- <form method=\"post\" >
- <input type=\"hidden\" name=\"act\" value=\"sav\">
- <input size=\"35\" name=\"key\" value=\"\" /><br /><br />
- <span style=\"text-align: center;\">
- <input type=\"submit\" class=\"btn btn-primary\" value=\"{$lang_grabber['do_register']}\" />
- </span><br><br>
- </form>
- </div>";
- echofooter ();
- exit;
- }else{
- $keyz = array ('keygrab'=>$out[1]);
- unset($config['keyrss']);
- $cont = $config +$keyz;
- openz(ENGINE_DIR.'/data/config.php',"<?php \n\n\$config = ".var_export ($cont,true).";\n?>");
- }
- };
- }if ($action == 'sinonim') {
- include $rss_plugins.'add.sin.php';
- return 1;
- }
- if ($action == 'get_proxy') {
- include $rss_plugins.'proxy.php';
- if (get_proxy() == true) {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['prox_up_ed'],$PHP_SELF .'?mod=rss&action=config');
- }else{
- $time = time() -filectime(ENGINE_DIR.'/inc/plugins/files/proxy.txt');
- if ( $time <= 3600) $inf = $lang_grabber['up_time'].date('i',(1200-$time)).' min.';
- else $inf = $lang_grabber['no_upd_prox'];
- msg ($lang_grabber['info'],$lang_grabber['info'],$inf ,$PHP_SELF .'?mod=rss&action=config');
- }
- return 1;
- }
- if ($action == 'grups') {
- include $rss_plugins.'add.grups.php';
- return 1;
- }
- if ($action == 'addgrup_channel')
- {
- $ids = $_POST['channel'];
- if (count ($ids) == 0)
- {
- msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
- return 1;
- }
- if($_POST['act'] == 'sav'){
- $sql_result = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id = '{$_POST['rss_priv']}'");
- if ($sql_result['title'] == '')$mgs = '<b><font color=green>'.$lang_grabber['y_c_trans'].'</font></b> <br /><br />';
- else $mgs = ' <b><font color=green>'.$lang_grabber['yes_trans'].'</font> <font color=red>'.$sql_result['title'].'</font></b><br /><br />';
- $ids = explode ( ',',$ids);
- foreach ($ids as $id)
- {
- $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- $categoryes = explode ('=',$del['category']);
- $ht = $categoryes[0].'='.$_POST['rss_priv'];
- $db->query ('UPDATE '.PREFIX ."_rss SET category='$ht' WHERE id = '$id'");
- if (trim ($del['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($del['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= ' <font color="#C0C0C0">"'.$title.' | '.$del['url'].'"</font><br />';
- }
- msg ($lang_grabber['info'],$lang_grabber['transfer_canal'],$mgs,$PHP_SELF .'?mod=rss');
- return 1;
- }elseif($_POST['act'] != 'sav'){
- echoheader('','');
- opentable ($lang_grabber['transfer_canal']);
- $channel_inf = array();
- $channel_color = array();
- $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
- $run[0] = '';
- while ($channel_info = $db->get_row($sql_result)) {
- if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] = $channel_info['title'];
- else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
- }
- foreach($channel_inf as $value)
- {
- if (count($value) != '0'){
- foreach($value as $kkey=>$key)
- {
- $run[$kkey] = $key;
- }
- }
- }
- foreach ($ids as $id)
- {
- $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
- if (trim ($del['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($del['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- $mgs .= ' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red"><br />';
- }
- $ids = implode ( ',',$ids);
- echo '
- <form method="post" name="addgrup_channel" id="addgrup_channel">
- <input type="hidden" name="action" value="addgrup_channel">
- <input type="hidden" name="act" value="sav">
- <table width="100%">
- <tr>
- <td align="center">
- <b><font color="red">'.$lang_grabber['you_tr_can'].':</font></b><br /><br />'.$mgs.'
- <br /></td>
- </tr>
- <tr>
- <td class="hr_line" colspan=6></td>
- </tr>
- <tr>
- <td align="center"><br />
- '.$lang_grabber['selected_grup'].': <select name="rss_priv" class="load_img">
- '.sel ($run,'').'
- </select><br />
- <br /></td>
- </tr>
- <tr>
- <td class="hr_line" colspan=6></td>
- </tr>
- <tr>
- <td align="center">
- <br />
- <input type="hidden" name="channel" value="'.$ids.'">
- <input type="submit" class="btn btn-success" value=" '.$lang_grabber['mov_can'].' " ">
- <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
- </td>
- </tr>
- </table>
- </form>';
- closetable ();
- echofooter ();
- return 1;
- }
- }
- if ($action == 'ping') {
- if ($_GET['deletey'])
- {
- openz(ENGINE_DIR.'/cache/system/pinglogs.txt',' ');
- msg ($lang_grabber['ping'],'<b>'.$lang_grabber['ping_title'].'</b>','<font color=green>'.$lang_grabber['cl_log_yes'].'</font>',$PHP_SELF .'?mod=rss&action=ping');
- }elseif($_GET['delete']){
- echoheader ('','');
- opentable ('<b>'.$lang_grabber['ping_title'].'</b>');
- echo '<center><b><font color=red>'.$lang_grabber['cl_log_ask'].' ?</font></b><br /><br /><input type="button" class="btn btn-sin" value=" '.$lang['opt_sys_yes'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping&deletey=yes\'" />
- <input type="button" class="btn btn-danger" value=" '.$lang['opt_sys_no'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping\'" />
- </center>';
- closetable ();
- echofooter ();
- return 1;
- msg ($lang_grabber['ping'],'<b>'.$lang_grabber['ping_title'].'</b>','<font color=red>'.$lang_grabber['cl_log_ask'].' ?</font>',$PHP_SELF .'?mod=rss&action=ping&deletey=yes');
- }else{
- echoheader ('','');
- opentable ('<b>'.$lang_grabber['ping_title'].'</b>');
- $arr=array_map('trim',file(ENGINE_DIR.'/cache/system/pinglogs.txt'));
- if($arr[0]!='') $all=count($arr);
- if($config_rss['ping_lognum']!='')$pnumber=$config_rss['ping_lognum'];else$pnumber=5;
- echo "<div class=\"quick\">";
- if (isset ($all)){echo ' <b>'.$lang_grabber['ping_writing_all'].' '.$all.' '.$lang_grabber['sht'].'</b><br/>';}else{echo $lang_grabber['cl_log_msg'];}
- echo "</div>
- <style type=\"text/css\" media=\"all\">
- .listp {
- color: #999898;
- font-size: 11px;
- font-family: tahoma;
- padding: 5px;
- }
- .listp a:active,
- .listp a:visited,
- .listp a:link {
- color: green;
- text-decoration:none;
- }
- .listp a:hover {
- color: blue;
- text-decoration: underline;
- }
- </style>
- <div class=\"listp\">";
- $page=(isset($_GET['page'])) ?(int)$_GET['page'] : 1;
- $num_pages=ceil($all/$pnumber);
- $start=$page*$pnumber-$pnumber;
- if ($page >$num_pages ||$page <1)
- {
- $page=1;
- $start=0;
- }
- if ($all)
- {
- for ($i=$all-$start-1;$i>=$all-$start-$pnumber;$i--)
- {
- if (!isset($arr[$i])) break;
- echo $all-$i.'. '.$arr[$i];
- echo '<br/>';
- }
- echo '</div>';
- if($num_pages == 1){
- }else{
- $npp_nav = "<div class=\"news_navigation\" style=\"margin-bottom:5px; margin-top:5px;\">";
- for($i =1;$i <= $num_pages;$i++)
- {
- if ($i == 1 or $i == $num_pages or abs($i-$page) <10){
- if ($i == $page)$npp_nav .= " <SPAN>$i</SPAN> ";
- else $npp_nav .= ' <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ';
- }else{
- if ($page+10 == $i ) {
- $npp_nav .= ' <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ... ';
- }elseif ( $page-10 == $i ){
- $npp_nav .= ' ... <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ';
- }else{
- $npp_nav .= '';
- }
- }
- }
- $npp_nav .= '
- <form action="" onsubmit="topage() return false;">
- <script type="text/javascript">
- function topage() {
- var loca = window.location+"";
- var locas = loca.split("page");
- loca = locas[0];
- locas = loca.split("'.$PHP_SELF .'");
- window.location.href = locas[0] + \''.$PHP_SELF .'?mod=rss&action=ping&page=\' + document.getElementById(\'num_page\').value;
- }
- </script>
- <span><input id="num_page" style="background:none; height:15px; width:50px; border:0;"/></span> <a href="#" onclick="topage(); return false;">'.$lang_grabber['go_do'].'</a>
- </form>
- ';
- $npp_nav .= '</div>';
- echo $npp_nav;
- }
- }
- echo '<br><input type="button" class="btn btn-sin" value=" '.$lang_grabber['ping_del_log'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping&delete=yes\'" />
- <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
- ';
- closetable ();
- echofooter ();
- }
- return 1;
- }
- if ($action == 'updates') {
- include $rss_plugins.'update.php';
- return 1;
- }
- if ($_GET['s'] == 'go')
- {
- $_POST['search'] = $_GET['s'];
- $_POST['key'] = $_GET['k'];
- $_POST['pol'] = $_GET['p'];
- }
- if ($action == 'search_k')
- {
- if (count($_POST['channel'])>1)msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['sel_one_canal'].'! ','javascript:history.go(-1)');
- $_POST['search'] = 'go';
- $can_s = $db->super_query ('SELECT url FROM '.PREFIX ."_rss WHERE id='".$_POST['channel'][0]."'");
- $_POST['key'] = reset_url($can_s['url']);
- $_POST['pol'] = 'url';
- }
- $search = "<form method=\"post\" >
- <input type=\"hidden\" name=\"search\" value=\"go\">
- {$lang_grabber['search']}
- <input size=\"25\" class=\"edit\" name=\"key\" value=\"".$_POST['key']."\" /> {$lang_grabber['po_news']}
- <select name=\"pol\">";
- $search .= $_POST['pol'] == 'url'?"<option value=\"url\" selected \">{$lang_grabber['links']}</option>": "<option value=\"url\">{$lang_grabber['links']}</option>";
- $search .= $_POST['pol'] == 'title'?"<option value=\"title\" selected \">{$lang_grabber['names']}</option>": "<option value=\"title\">{$lang_grabber['names']}</option>";
- $search .= $_POST['pol'] == 'xdescr'?"<option value=\"xdescr\" selected \">{$lang_grabber['descrs']}</option>": "<option value=\"xdescr\">{$lang_grabber['descrs']}</option>";
- $search .= "</select>
- <input type=\"submit\" class=\"btn btn-primary\" value=\"{$lang_grabber['go_search']}\" />
- </form>";
- $vose = '
- <style type="text/css">
- .title_spoiler {
- color: #636363;
- border: 1px solid #bebebe;
- font-weight: bold;
- font-size: 9pt;
- padding: 2px;
- margin-top: 5px;
- }
- .text_spoiler {
- border: 1px solid #bebebe;
- border-top: 0;
- margin-bottom: 5px;
- }
- .title_spoil {
- color: #636363;
- border: 1px solid #C8E4FA;
- font-weight: bold;
- font-size: 9pt;
- padding: 2px;
- margin-top: 5px;
- margin-left: 0px;
- margin-right: 0px;
- }
- .text_spoil {
- border: 1px solid #C8E4FA;
- border-top: 0;
- margin-bottom: 5px;
- margin-left: 0px;
- margin-right: 0px;
- }
- .darkw{ background-color: #E8F9E6}
- </style>
- ';
- $order_by = '';
- $sort_rss = get_vars('rss.sort');
- if( !$_POST['dlenewssortby'] ) {
- if($sort_rss[0] == ''or $sort_rss[1] == '')$order_by = 'xpos DESC ,title DESC';
- else $order_by = $sort_rss[0].' '.$sort_rss[1];
- }else{$order_by = $_POST['dlenewssortby'].' '.$_POST['dledirection'];
- $sort_rss = array(0 =>$_POST['dlenewssortby'],1 =>$_POST['dledirection']);
- set_vars('rss.sort',$sort_rss);
- }
- $channel_inf = array();
- $channel_info = array();
- $grup_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
- $channel_inf[0] = '';
- while ($channel_info = $db->get_row($grup_result)) {
- $channel_inf[$channel_info['id']] = $channel_info['osn'];
- $channel_color[$channel_info['id']] = $channel_info['color'];
- }
- if ($_POST['search'] == 'go'and $_POST['key'] != ''){
- if($_POST['pol'] == '')$_POST['pol'] = 'url';
- $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss WHERE '.$_POST['pol']." like '%".$_POST['key']."%' ORDER BY $order_by");
- $empty = $db->num_rows ($sql_result) == 0;
- $hk = $db->num_rows ($sql_result);
- }else{
- $sql_result = $db->query ('SELECT * FROM '.PREFIX ."_rss ORDER BY $order_by");
- $empty = $db->num_rows ($sql_result) == 0;
- }
- if ($empty)
- {
- $vose .= '
- <form method="post" name="rss_form" id="rss_form">
- <span id="channels"></span>
- <table cellpadding="4" cellspacing="0" width="100%">
- <tr>
- <td height="40" valign="middle" align="center" class="navigation">- '.$lang_grabber['no_canals'].' -</td>
- </tr>
- </table>';
- }else{
- $vose .= '<input style="display:none" type="checkbox" name="tables" id="tables" value="" />';
- $vose .= "
- <script>
- function checkAll(field){
- nb_checked=0;
- for(n=0;n<field.length;n++)
- if(field[n].checked)nb_checked++;
- if(nb_checked==field.length){
- for(j=0;j<field.length;j++){
- field[j].checked=!field[j].checked;
- field[j].parentNode.parentNode.style.backgroundColor
- =field[j].backgroundColor==''?'#E8F9E6':'';
- }
- }else{
- for(j=0;j<field.length;j++){
- field[j].checked = true;
- field[j].parentNode.parentNode.style.backgroundColor
- ='#E8F9E6';
- }document.news_set_sort.check_all.checked=true;
- }
- }
- function selectRow(evnt,elmnt){
- var ch=elmnt.getElementsByTagName(\"TD\")[5].firstChild;
- tg = document.all?evnt.srcElement:evnt.target;
- if(tg.tagName!='INPUT')ch.checked=!ch.checked;
- elmnt.style.backgroundColor=ch.checked?'#E8F9E6':'';
- document.channels(document.rss_form.channel.length);
- }
- function ShowOrHidegr( id, name ) {
- var item = document.getElementById(id);
- if ( document.getElementById('image-'+ id) ) {
- var image = document.getElementById('image-'+ id);
- } else {
- var image = null;
- }
- if (!item) {
- retun;
- } else {
- if (item.style) {
- if (item.style.display == \"none\") {
- item.style.display = \"table\";
- image.src = './engine/inc/plugins/images/minus.gif';
- var curCookie = id + \"=\" + '1';
- } else {
- item.style.display = \"none\";
- image.src = './engine/inc/plugins/images/plus.gif';
- var curCookie = id + \"=\" + '';
- }
- } else{ item.visibility = \"show\"; }
- }
- document.cookie = curCookie;
- };
- function ShowOrHidegrp( id, name ) {
- var item = document.getElementById(id);
- if ( document.getElementById('images-'+ id) ) {
- var images = document.getElementById('images-'+ id);
- }
- if (!item) {
- retun;
- } else {
- if (item.style) {
- if (item.style.display == \"none\") {
- item.style.display = \"table\";
- images.src = './engine/inc/plugins/images/p-minus.gif';
- var curCookie = id + \"=\" + '1';
- } else {
- item.style.display = \"none\";
- images.src = './engine/inc/plugins/images/p-plus.gif';
- var curCookie = id + \"=\" + '';
- }
- } else{ item.visibility = \"show\"; }
- }
- document.cookie = curCookie;
- };
- function ShowOrHideAll() {
- var show = document.getElementById('tables');
- var item = document.getElementsByTagName('table');
- for(n=0;n<item.length;n++){
- if (!item[n]) {
- retun;
- } else {
- if (item[n].style.display ) {
- if ( document.getElementById('image-'+ item[n].id) ) {
- var image = document.getElementById('image-'+ item[n].id);
- } else {
- var image = null;
- }
- if ( document.getElementById('images-'+ item[n].id) ) {
- var images = document.getElementById('images-'+ item[n].id);
- } else {
- var images = null;
- }
- if (!show.checked) {
- if (item[n].style.display == \"none\") {
- item[n].style.display = \"table\";
- if(image) image.src = '/engine/inc/plugins/images/minus.gif';
- if(images) images.src = '/engine/inc/plugins/images/p-minus.gif';
- var curCookie = item[n].id + \"=\" + '1';
- }
- }else {
- item[n].style.display = \"none\";
- if(image)image.src = '/engine/inc/plugins/images/plus.gif';
- if(images) images.src = '/engine/inc/plugins/images/p-plus.gif';
- var curCookie = item[n].id + \"=\" + '';
- }
- }
- else{ item[n].visibility = \"show\"; }
- }
- document.cookie = curCookie;
- }
- if (show.checked)
- {
- show.checked = false;
- }else{
- show.checked = true;}
- };
- function Addurls(numm) {
- for(n=0;n<numm;n++){
- var tbl = document.getElementById('tblSample');
- var lastRow = tbl.rows.length;
- var iteration = lastRow+1;
- var tr = tbl.insertRow(lastRow);
- var td = tr.insertCell(0);
- td.setAttribute('style', 'padding: 0px 0px 2px 0px;');
- td.setAttribute('align', 'right');
- var el = document.createElement('input');
- el.setAttribute('type', 'text');
- el.setAttribute('name', 'str_url[]');
- el.setAttribute('size', '35');
- el.setAttribute('value', '');
- var newText = document.createTextNode(iteration);
- var elm = document.createElement('button');
- elm.setAttribute('disabled', 'disabled');
- elm.setAttribute('class', 'edit');
- elm.setAttribute('style', 'background:#9E9E9E;color:#fff;');
- var elem = document.createElement('input');
- elem.setAttribute('type', 'text');
- elem.setAttribute('disabled', 'disabled');
- elem.setAttribute('border', '0');
- elem.setAttribute('size', '1');
- elem.setAttribute('value', iteration);
- td.appendChild(elm);
- elm.appendChild(newText);
- //td.appendChild(elem);
- td.appendChild(el);
- }
- }
- function Removeurls() {
- var tbl = document.getElementById('tblSample');
- var lastRow = tbl.rows.length;
- if (lastRow > 1){
- tbl.deleteRow(lastRow - 1);
- }
- }
- </script>";
- if ($еmpty){
- $vose .= news_sort_rss($_POST['dlenewssortby'],$_POST['dledirection']);
- $vose .= '
- <div>
- <form method="post" name="rss_form" id="rss_form">
- <span id="channels"></span>
- <table cellpadding="6" align="center" cellspacing="0" width="100%" border="0">
- <tr>
- <td colspan="6">';
- $vose .= '<div class="unterline"></div>';
- $vose .= '</td></tr></table>';
- $rss_kanal = array();
- $cat_rss = array();
- while ($row = $db->get_row ($sql_result))
- {
- $rss_kan = '';
- if (trim ($row['title']) != '')
- {
- $title = stripslashes (strip_tags_smart ($row['title']));
- if (50 <strlen ($title))
- {
- $title = substr ($title,0,50) .'...';
- }
- }
- else
- {
- $title = $lang_grabber['no_title'];
- }
- if ($row['xdescr']) {
- $xdescr = htmlspecialchars($row['xdescr']);
- if (strlen($xdescr)>50) {
- $xdescr = substr($xdescr,0,50).'...';
- }
- }else {
- $xdescr = ' ';
- }
- if ($row['allow_auto'] == 0){$auto = '';}else{$auto = '<font color=green><b>'.$lang['opt_sys_yes'].'</b></font>';}
- if ($row['rss'] == 0){$rss = '<font color=blue>HTML</font>';}else{$rss = '<font color=red>RSS</font>';}
- $row['url'] = stripslashes ($row['url']);
- $row['descr'] = stripslashes ($row['descr']);
- $categoryes = explode ('=',$row['category']);
- $del=array();
- if (trim($channel_color[intval($categoryes[1])]) == '') $channel_color[intval($categoryes[1])] = '#f2f2f2';
- if (intval($categoryes[1]) != '0'){
- if (intval($channel_inf[$categoryes[1]]) != '0') $style_grups = 'text_spoil" style ="border-color: '.$channel_color[intval($categoryes[1])].';"';
- else $style_grups = 'text_spoiler';
- }else{$style_grups = 'light';}
- $rss_kan = '<tr class="'.$style_grups.'" onMouseOut=this.className="'.$style_grups.'"
- onMouseOver=this.className="highlight"
- onclick=selectRow(event,this)>
- <td width="5%" style="padding:1px" align="center"><input type="text" name="xpos['.$row['id'].']" value="'.$row['xpos'].'" class="edit" align="center" size="3" /></td>
- <td width="5%" style="padding:1px" align="center">'.$rss.'</td>
- <td width="6%" style="padding:1px" align="center">'.$auto.'</td>
- <td style="padding:4px">
- <a href="'.$row['url'] .'" target=\"_blank\">[i]</a> <a href="'.$PHP_SELF .'?mod=rss&action=channel&subaction=edit&id='.$row['id'] .'" class="hintanchor" onMouseover="showhint(\'<b>'.$row['url'] .'</b><br/>'.$row['descr'] .'\', this, event, \'300px\');">'.$title .'</a></td>
- <td style="padding:4px" align="center">'.$xdescr.'</td>
- <td width="3%"><input style="background-color: #ffffff; color: #ff0000;" title="'.$lang_grabber['val_post'].'" type="checkbox" name="channel[]" id="channel" value="'.$row['id'] .'" />
- </td>
- </tr>
- <tr>';
- if (intval($categoryes[1]) != '0'and array_key_exists($categoryes[1],$channel_inf)) {
- if (intval($channel_inf[$categoryes[1]]) != '0') $cat_rss[$channel_inf[$categoryes[1]]][$categoryes[1]][$row['id']] = $rss_kan;
- else $cat_rss[$categoryes[1]][0][$row['id']] = $rss_kan;
- }else{
- $rss_kanal[$row['id']] = $rss_kan;
- }
- }
- if (count($cat_rss) != '0')
- {
- $grups_rss = array();
- foreach ($cat_rss as $papka =>$kanals){
- $grups_r = '';
- $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id= '".$papka."'");
- $id_spoiler = spoiler( $del['title'] );
- $vose .= " <script type=\"text/javascript\">
- $(document).ready( function() {
- $(\"#ch_$id_spoiler\").click( function() {
- if($('#ch_$id_spoiler').attr('checked')){
- $(\"#\" + $(this).attr('name') + \" input:checkbox:enabled\").attr('checked', true);
- $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '#E8F9E6');
- } else {
- $(\"#\" + $(this).attr('name') + \" input:checkbox\").attr('checked', false);
- $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '');
- }
- });
- });
- </script>";
- $kol = '';
- $kol = count($kanals,1) -count($kanals);
- if (count($kanals) == '1'and count($kanals[0]) >0){$kol = count($kanals,1) -count($kanals);}
- else
- {
- $kols = count($kanals[0]) == 0 ?count($kanals):count($kanals) -1;
- $kol = count($kanals,1) -count($kanals).'|'.$kols;
- }
- if (trim($del['color']) == '') $del['color'] = '#f2f2f2;';
- if ($_COOKIE[$id_spoiler] != 1) {
- $strp = 'style="display:none;background-color: '.$del['color'].';"';
- $strp_i = 'src="./engine/inc/plugins/images/plus.gif"';
- }else {
- $strp = 'style="display:table;background-color: '.$del['color'].';"';
- $strp_i = 'src="./engine/inc/plugins/images/minus.gif"';
- }
- $grups_r .= '<table width="100%" border="0" ><div class="title_spoiler" style ="background-color: '.$del['color'].';"><img id="image-'.$id_spoiler.'" style="vertical-align: middle;border: none;" alt="" '.$strp_i.' /> <a href="javascript:ShowOrHidegr(\''.$id_spoiler.'\', \'rss_sp_'.$papka.'\')">'.$del['title'].' ('.$kol.')</a>
- <input type="checkbox" name="'.$id_spoiler.'" id="ch_'.$id_spoiler.'" value="" alt="'.$lang_grabber['sel_all_can'].'" title="'.$lang_grabber['sel_all_can'].'"/>
- </div>
- </table>
- <table id="'.$id_spoiler.'" name="rss_sp_'.$papka.'" cellpadding="6" align="center" cellspacing="0" width="100%" border="0" class="text_spoiler" '.$strp.' >';
- ksort ($kanals);
- foreach ($kanals as $papk =>$kanal){
- if ($papk != 0){
- $osn = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id= '".$papk."'");
- $id_spoil = spoiler( $osn['title'] );
- $vose .= " <script type=\"text/javascript\">
- $(document).ready( function() {
- $(\"#ch_$id_spoil\").click( function() {
- if($('#ch_$id_spoil').attr('checked')){
- $(\"#\" + $(this).attr('name') + \" input:checkbox:enabled\").attr('checked', true);
- $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '#E8F9E6');
- } else {
- $(\"#\" + $(this).attr('name') + \" input:checkbox\").attr('checked', false);
- $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '');
- }
- });
- });
- </script>";
- if (trim($osn['color']) == '') $osn['color'] = '#f2f2f2;';
- if ($_COOKIE[$id_spoil] != 1) {
- $strj = 'style="display:none;background-color: '.$osn['color'].';"';
- $strj_i = 'src="./engine/inc/plugins/images/p-plus.gif"';
- }else {
- $strj = 'style="display:table;background-color: '.$osn['color'].';"';
- $strj_i = 'src="./engine/inc/plugins/images/p-minus.gif"';
- }
- $grups_r .= '<tr><td colspan=6 ><table width="100%" border="0"><div class="title_spoil" style ="background-color: '.$osn['color'].';"><img id="images-'.$id_spoil.'" style="vertical-align: middle;border: none;" alt="" '.$strj_i.' /> <a href="javascript:ShowOrHidegrp(\''.$id_spoil.'\', \'rss_sp_'.$papk.'\')">'.$osn['title'].' ('.count($kanal).')</a>
- <input type="checkbox" name="'.$id_spoil.'" id="ch_'.$id_spoil.'" value="" alt="'.$lang_grabber['sel_all_can'].'" title="'.$lang_grabber['sel_all_can'].'"/>
- </div>
- </table>
- <table id="'.$id_spoil.'" name="rss_sp_'.$papk.'" cellpadding="6" align="center" cellspacing="0" width="100%" border="0" class="text_spoil" '.$strj.' >'.implode('<td background="engine/skins/images/mline.gif" height=1 colspan=6></td></tr>',$kanal).'</table></td></tr> ';
- }
- }
- if (count($kanals[0]) >0)$grups_r .= implode('<td background="engine/skins/images/mline.gif" height=1 colspan=8></td></tr>',$kanals[0]).'</table> ';
- $grups_rss[$del['kanal']]= $grups_r;
- }
- ksort ($grups_rss);
- $vose .= implode($grups_rss);
- }
- }
- }
- if (count($rss_kanal) != 0)$vose .= '<table cellpadding="6" align="center" cellspacing="0" width="100%" border="0">'.implode('<td background="engine/skins/images/mline.gif" height=1 colspan=6></td></tr>',$rss_kanal).'<td background="engine/skins/images/mline.gif" height=1 colspan=6></td></tr></table>';
- $vose .= '<table cellpadding="4" width="100%"><tr><td colspan="6"><br/>';
- $vose .= '<div class="unterline"></div>';
- $vose .= ' </td></tr> <tr>
- <td colspan="5">
- <table width="100%" border="0">
- <tr>
- <td align="left" width="270">';
- if ($_POST['search'] == 'go'and $_POST['key'] != ''){
- $vose .= '
- <input type="button" class="btn btn-warning" value="'.$lang_grabber['go_index'].'" onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
- ';
- }
- $vose .= '
- <input type="button" class="btn btn-success" value="'.$lang_grabber['add_canal'].'" onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=channel&subaction=add\'" />
- </td>
- <td style="padding:2px" align="right" colspan="2">'.$lang['xfield_xact'].':
- <select id="ui_element" name="action">
- <option value="scan" selected style="background: #EFEFEF;">'.$lang['rss_news'].'</option>
- <option value="scan1">'.$lang_grabber['rss_news'].' '.$lang_grabber['post_sm'].'</option>
- <option value="scan3">'.$lang_grabber['rss_news'].' 3 '.$lang_grabber['post_sm'].'</option>
- <option value="scan5">'.$lang_grabber['rss_news'].' 5 '.$lang_grabber['post_big'].'</option>
- <option value="scan10">'.$lang_grabber['rss_news'].' 10 '.$lang_grabber['post_big'].'</option>
- <option value="scan15">'.$lang_grabber['rss_news'].' 15 '.$lang_grabber['post_big'].'</option>
- <option value="scan20">'.$lang_grabber['rss_news'].' 20 '.$lang_grabber['post_big'].'</option>';
- if ($config_rss['news_kol'] != ''){$vose .= '<option value="scan'.$config_rss['news_kol'].'">'.$lang_grabber['rss_news'].' '.$config_rss['news_kol'].' '.$lang_grabber['post_big'].'</option>';}
- $vose .= '<option value="auto_channel" style="background: #EFEFEF; color:green">'.$lang_grabber['channel_auto_y'].'</option>
- <option value="noauto_channel">'.$lang_grabber['channel_auto_n'].'</option>
- <option value="copy_channel" style="background: #EFEFEF; color:orange; font: bold 110% ;">'.$lang_grabber['channel_copy'].'</option>
- <option value="sort" style="background: #EFEFEF; color:blue">'.$lang_grabber['channel_sort'].'</option>
- <option value="del_channel" style="background: #EFEFEF; color:red">'.$lang_grabber['channel_del'].'</option>
- <option value="save_channel" style="background: #EFEFEF;">'.$lang_grabber['expo'].'</option>
- <option value="save_up_channel" style="background: #EFEFEF;">'.$lang_grabber['impo'].'</option>
- <option value="addgrup_channel" style="background: #EFEFEF; color:red">'.$lang_grabber['move_grup'].'</option>
- <option value="editgrup_channel">'.$lang_grabber['batch_edit'].'</option>
- <option value="search_k">'.$lang_grabber['sel_cans'].'</option>
- </select></td>
- <td align="left" style="padding:2px" class="navigation"> '.$lang_grabber['s_news'].' <input type="text" class="edit" name="str_news" size="3" value=""/> '.$lang_grabber['po_news'].' <input type="text" class="edit" name="str_newf" size="3" value=""/> '.$lang_grabber['post_one'].'
- </td>
- <td align="right" rowspan="2" width="50">
- <input type="submit" class="btn btn-warning btn-mini" style="height: 40px;" value="'.$lang_grabber['b_start'].'"/>
- </td>
- </tr>
- <tr> <td align="left" rowspan="2" colspan="3" class="navigation">'.$lang_grabber['help_run'].'</td>
- <td style="padding:2px" align="left" class="navigation" width="150"> '.$lang_grabber['s_news'].' <input type="text" class="edit" name="str_kans" size="3" value=""/> '.$lang_grabber['po_news'].' <input type="text" class="edit" name="str_kanf" size="3" value=""/> '.$lang_grabber['page_do'].'</td>
- </tr>
- </table>
- <tr>
- <td style="padding:2px 0px 2px 2px" colspan="3" align="right" class="navigation" width="150">
- <table id="tblSample" class="upload">
- <tr>
- <td style="padding:2px 0px 2px 2px;">'.$lang_grabber['grab_links'].'<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_grab_links'].'\', this, event, \'250px\')">[?]</a> <button disabled="disabled" class="edit" style="background:#9E9E9E;color:#fff;" >1</button><input type="text" class="edit" name="str_url[]" size="35" value=""/>
- </td>
- </tr>
- </table>
- <div>
- <input type=button class="btn btn-sin" value=\' + 1 \' title="'.$lang_grabber['grab_links_1'].'" onClick="Addurls(1);return false;">
- <input type=button class="btn btn-sin" value=\' + 5 \' title="'.$lang_grabber['grab_links_5'].'" onClick="Addurls(5);return false;">
- <input type=button class="btn btn-sin" value=\' + 10 \' title="'.$lang_grabber['shr_max'].'" onClick="Addurls(10);return false;">
- </div>
- </td>
- </tr>
- </td></tr>
- </table></form>';
- if (count($cat_rss) != '0') $spoi = ' <a href="javascript:ShowOrHideAll()"><font color=orange>↑ '.$lang_grabber['shr_max'].' ↓</font></a>';
- echoheader ('','');
- check_disable_functions ();
- opentable ($lang_grabber['rss_list'].$spoi,$tr.$search);
- if ($_POST['search'] == 'go'and $_POST['key'] != ''){
- echo ' <table width="100%" border=0>
- <tr><td><font color="#999898">'.$lang_grabber['you_sear'].': <font color="green">'.$_POST['key'].'</font><br />
- '.$lang_grabber['res_sear'].': <font color="blue">'.$hk.'</font></font></td></tr><tr><td background="engine/skins/images/mline.gif" height=1 colspan=6></td></tr></table>';
- }
- echo $vose;
- closetable ();
- opentable ();
- tableheader ($lang_grabber['tabs_extra']);
- echo "
- <script>
- var ajax = new dle_ajax();
- function check_updates ( ){
- document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
- document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
- var varsString = \"moduleversion={$module_info['version']}\";
- ajax.setVar(\"modulebuild\", '{$module_info['build']}');
- ajax.requestFile = \"engine/ajax/grabber.php\";
- ajax.element = 'main_box';
- ajax.method = 'POST';
- ajax.sendAJAX(varsString);
- return false;
- }
- function grabber_updates_down ( ){
- document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
- document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
- var varsString = \"key={$config['keygrab']}\";
- ajax.setVar(\"ver\", '{$module_info['version']}');
- ajax.setVar(\"bul\", '{$module_info['build']}');
- ajax.requestFile = \"engine/ajax/update_grabber.php\";
- ajax.element = 'main_box';
- ajax.method = 'POST';
- ajax.sendAJAX(varsString);
- return false;
- }
- function grabber_updates (dwn){
- document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
- document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
- var varsString = \"url=dwn\";
- ajax.setVar(\"dwn\", dwn);
- ajax.requestFile = \"engine/ajax/update_grabber.php\";
- ajax.element = 'main_box';
- ajax.method = 'POST';
- ajax.sendAJAX(varsString);
- return false;
- }
- function closead()
- {
- var obj = document.getElementById( \"ad\" );
- obj.style.visibility = \"hidden\";
- }
- </script>";
- echo '
- <table width="100%" cellpadding="4">
- <tr><td align="left">
- <input type="button" class="btn btn-primary" value=" '.$lang_grabber['glob_options'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=config\'" />
- <input type="button" class="btn btn-info" value=" '.$lang_grabber['grups'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=grups\'" />';
- if (@file_exists (ENGINE_DIR .'/inc/plugins/sinonims.php') )
- {echo'
- <input type="button" class="btn btn-inverse" value=" '.$lang_grabber['sinonims_bottom'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=sinonim\'" />';
- }echo'
- </td><td id="main_box" align=right>
- <input onclick="check_updates(); return false;" class="btn btn-danger" type="button" value=" '.$lang_grabber['update_bottom'].' ">
- </td>
- <td align=right>
- <input type="button" class="btn btn-sin" value=" '.$lang_grabber['ping_button'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping\'" />
- </td></tr>
- <tr>
- <td colspan=6 align="right" style="padding-top:5px;" class="navigation"><a href="http://rss-grabber.ru" target="_blank">'.$module_info['name'].' '.$module_info['version'].' build'.$module_info['build'].'</a> | Copyright 2009-2011 © created by Andersoni. All rights reserved.</td>
- </tr>
- </table>
- ';
- closetable ();
- echofooter ();
- $db->close;
- ;
- function script_br($scr,$txt)
- {global $db;
- $txt = str_replace( '<br>',"\n",$txt );
- $txt = str_replace( '<br />',"\n",$txt );
- $txt = str_replace( '<BR>',"\n",$txt );
- $txt = str_replace( '<BR />',"\n",$txt );
- return stripslashes('<script'.$scr.'>'.$txt.'</script>');
- }
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement