Advertisement
Guest User

Untitled

a guest
Mar 7th, 2013
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if( !defined( 'DATALIFEENGINE') ) {
  3. die( 'Hacking attempt!');
  4. }
  5. if( !$user_group[$member_id['user_group']]['admin_rss'] ) {msg( 'error',$lang['index_denied'],$lang['index_denied'] );}
  6. @include(ENGINE_DIR.'/data/rss_config.php');
  7. if(intval($config_rss['memory_limit'])!=0)@ini_set ('memory_limit',$config_rss['memory_limit']);
  8. else @ini_set ('memory_limit','128M');
  9. @set_time_limit (0);
  10. @ini_set ('max_input_time',864000);
  11. @ini_set ('post_max_size','20M');
  12. @ini_set ('upload_max_filesize','20M');
  13. @ini_set ('max_execution_time',864000);
  14. @ini_set ('output_buffering','off');
  15. @ob_end_clean ();
  16. clearstatcache ();
  17. ob_implicit_flush (TRUE);
  18. $dle_plugins = ENGINE_DIR .'/classes/';
  19. $rss_plugins = ENGINE_DIR .'/inc/plugins/';
  20. $selected_language = $config['langs'];
  21. if (isset( $_COOKIE['selected_language'] )) {
  22. $_COOKIE['selected_language'] = totranslit( $_COOKIE['selected_language'],false,false );
  23. if (@is_dir ( ROOT_DIR .'/language/'.$_COOKIE['selected_language'] )) {
  24. $selected_language = $_COOKIE['selected_language'];
  25. $config['langs'] = $selected_language;
  26. }
  27. }
  28. if ( file_exists( ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng') ) {
  29. require_once ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng';
  30. }else {
  31. if ( file_exists( ROOT_DIR .'/language/Russian/grabber.lng') ) {
  32. require_once ROOT_DIR .'/language/Russian/grabber.lng';
  33. require_once $rss_plugins.'core.php';
  34. require_once $rss_plugins.'rss.classes.php';
  35. require_once $rss_plugins.'rss.functions.php';
  36. require_once $rss_plugins.'rss.parser.php';
  37. $file = ROOT_DIR .'/language/'.$config['langs'] .'/grabber.lng';
  38. $d_lang = substr(strtolower($config['langs']),0,2);
  39. $n=count($lang_grabber);
  40. $i=0;
  41. $text = translate_google('Подождите идёт локализация модуля ...','ru',$d_lang);
  42. echoheader ('','');
  43. opentable ($text);
  44. ob_flush();flush();
  45. foreach ($lang_grabber as $key=>$value){
  46. $i++;
  47. echo "<script> storyes($i, $n, '$text'); </script>";
  48. ob_flush();flush();
  49. $value = str_replace( '&#','<hw',$value );
  50. $value = str_replace( '&lt;','lt;',$value );
  51. $value = str_replace( '&gt;','gt;',$value );
  52. $value = translate_google($value,'ru',$d_lang);
  53. $value = str_replace( "\n",'<br />',$value );
  54. $value = str_replace( ' /','/',$value );
  55. $value = str_replace( '/ ','/',$value );
  56. $value = str_replace( '"','',$value );
  57. $value = str_replace( 'lt;','&lt;',$value );
  58. $value = str_replace( 'gt;','&gt;',$value );
  59. $value = str_replace( '<hw','&#',$value );
  60. $lang_grabber[$key]=$value;
  61. }
  62. echo 'Локализация завершена!!!';
  63. closetable ();
  64. echofooter ();
  65. $handler = fopen($file,'w+');
  66. fwrite($handler,"<?php\n\n");
  67. fwrite($handler,"\$lang_grabber = ".var_export ($lang_grabber,true).';'."\n?".'>');
  68. fclose($handler);
  69. exit();
  70. }else{die('Language file not found');}
  71. }
  72. $module_info = array ('name'=>'RSS Grabber','version'=>'3.6.9','build'=>'1007');
  73. $dle_plugins = ENGINE_DIR .'/classes/';
  74. require_once $dle_plugins.'templates.class.php';
  75. require_once $dle_plugins.'parse.class.php';
  76. $parse = new ParseFilter (array (),array (),1,1);
  77. $key_iframe = array_search('iframe',$parse->tagBlacklist);
  78. unset ($parse->tagBlacklist[$key_iframe]);
  79. $key_script = array_search('script',$parse->tagBlacklist);
  80. unset ($parse->tagBlacklist[$key_script]);
  81. $tpl = new dle_template ();
  82. $rss_plugins = ENGINE_DIR .'/inc/plugins/';
  83. require_once $rss_plugins.'core.php';
  84. require_once $rss_plugins.'strip_tags_smart.php';
  85. require_once $rss_plugins.'backup.php';
  86. $tpl->dir = $rss_plugins.'templates/';
  87. require_once $rss_plugins.'rss.classes.php';
  88. require_once $rss_plugins.'rss.functions.php';
  89. require_once $rss_plugins.'rss.parser.php';
  90. require_once $rss_plugins.'classes.file.php';
  91. require_once $rss_plugins.'channel.php';
  92. if ($_REQUEST['action'] != '')
  93. {
  94. $action = $_REQUEST['action'];
  95. }
  96. else
  97. {
  98. $action = '';
  99. }
  100. if ($_REQUEST['subaction'] != '')
  101. {
  102. $subaction = $_REQUEST['subaction'];
  103. }
  104. else
  105. {
  106. $subaction = '';
  107. }
  108. if ($_REQUEST['id'] != '')
  109. {
  110. $id = intval ($_REQUEST['id']);
  111. }
  112. else
  113. {
  114. $id = '';
  115. }
  116. $add_bb = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
  117. <div> </div><div id="skip" style="padding:5px 0 0 2px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'skip\')" ><b>{skip}</b>
  118. </div>
  119. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  120. <div id="get" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'get\')"><b>{get}</b>
  121. </div>
  122. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  123. <div id="num" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'num\')"><b>{num}</b>
  124. </div>
  125. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  126. <div id="link" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'link\')"><b>{link}</b>
  127. </div>
  128. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  129. </div>
  130. </div>
  131. ';
  132. $add_bbz = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
  133. <div> </div><div id="skip" style="padding:5px 0 0 2px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'skip\')" ><b>{skip}</b>
  134. </div>
  135. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  136. <div id="get" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'get\')"><b>{get}</b>
  137. </div>
  138. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  139. <div id="num" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'num\')"><b>{num}</b>
  140. </div>
  141. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  142. <div id="frag" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'frag\')"><b>{frag}</b>
  143. </div>
  144. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  145. <div id="zagolovok" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'zagolovok\')"><b>{zagolovok}</b>
  146. </div>
  147. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  148. <div id="link" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'link\')"><b>{link}</b>
  149. </div>
  150. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  151. </div>';
  152. $add_bbzz = ' <div style="width:79%; height:25px; border:0px solid #BBB; background-image:url(\'engine/skins/bbcodes/images/bg.gif\')">
  153. <div> </div>
  154. <div id="frag" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'frag\')"><b>{frag}</b>
  155. </div>
  156. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  157. <div id="zagolovok" style="padding-top:5px;font: 7pt bold;" class="editor_button" onclick="simpletags(\'zagolovok\')"><b>{zagolovok}</b>
  158. </div>
  159. <div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
  160. </div>';
  161. if (($action == 'channel') and ($subaction == 'add'))
  162. {
  163. echoheader ('','');
  164. opentable ($lang_grabber['new_channel']);
  165. $channel_inf = array();
  166. $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
  167. $run[0] = '';
  168. while ($channel_info = $db->get_row($sql_result)) {
  169. if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] =  $channel_info['title'];
  170. else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
  171. }
  172. foreach($channel_inf as $value)
  173. {
  174. if (count($value) != '0'){
  175. foreach($value as $kkey=>$key)
  176. {
  177. $run[$kkey] = $key;
  178. }
  179. }
  180. }
  181. $tpl->load_template ('rss_addchannel.tpl');
  182. $tpl->set ('{rss-priv}',sel ($run,''));
  183. $tpl->set ('{title}','');
  184. $tpl->set ('{category}',categorynewsselection (1,0));
  185. $tpl->set ('{address}','');
  186. $tpl->set ('{date-format}',gen_date_format ($config_rss['date']));
  187. $tpl->set ('{charsets}','');
  188. $tpl->set ('{load-img}',server_host($config_rss['img_host'] ));
  189. $tpl->set ('{dubl-host}','');
  190. $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']),''));
  191. $tpl->set ('{cache-link}','');
  192. $tpl->set ('{one-serv}','');
  193. $tpl->set ('{image-align}',gen_x ($config_rss['image_align'],4));
  194. $tpl->set ('{image-align-full}',gen_x ($config_rss['image_align_full'],4));
  195. $tpl->set ('{image-align-post}',gen_x ($config_rss['image_align_full'],4));
  196. $tpl->set ('{hide}',($config_rss['hide'] == 'yes'?'checked': ''));
  197. $tpl->set ('{leech}',($config_rss['leech']== 'yes'?'checked': ''));
  198. $tpl->set ('{leech-dop}',($config_rss['leech_dop']== 'yes'?'checked': ''));;
  199. $tpl->set ('{leech-shab}','');
  200. $tpl->set ('{thumb-images}',($config_rss['cat']== 'yes'?'checked': ''));
  201. $tpl->set ('{cat-nul}','');
  202. $tpl->set ('{cat-sp}','');
  203. $tpl->set ('{kategory}','');
  204. $tpl->set ('{kol-short}','');
  205. $tpl->set ('{sim-short}','');
  206. $tpl->set ('{starter-page}','');
  207. $tpl->set ('{page-break}','');
  208. $tpl->set ('{data-deap}','');
  209. $tpl->set ('{max-image}','');
  210. $tpl->set ('{deap}',deap ());
  211. $tpl->set ('{log-pas}','');
  212. $tpl->set ('{log-cookies}','checked');
  213. $tpl->set ('{wat-host}','');
  214. $tpl->set ('{tags-auto}',($config_rss['tags_auto']== 'yes'?'checked': ''));
  215. $tpl->set ('{tags-zag}','');
  216. $tpl->set ('{allow-mod}',($config_rss['allow-mod']== 'yes'?'checked': ''));
  217. $tpl->set ('{allow-main}',($config_rss['allow-main']== 'yes'?'checked': ''));
  218. $tpl->set ('{allow-comm}',($config_rss['allow-rate']== 'yes'?'checked': ''));
  219. $tpl->set ('{allow-rate}',($config_rss['allow-comm']== 'yes'?'checked': ''));
  220. $tpl->set ('{allow-full}',($config_rss['allow-full']== 'yes'?'checked': ''));
  221. $tpl->set ('{allow-auto}',($config_rss['allow-auto']== 'yes'?'checked': ''));
  222. $tpl->set ('{allow-water}',($config_rss['allow-water']== 'yes'?'checked': ''));
  223. $tpl->set ('{rewrite-news}',($config_rss['rewrite-news']== 'yes'?'checked': ''));
  224. $tpl->set ('{rewrite-data}','');
  225. $tpl->set ('{rewrite-no}','');
  226. $tpl->set ('{rewrite-con}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),'0'));
  227. $tpl->set ('{clear-short}',($config_rss['clear-short']== 'yes'?'checked': ''));
  228. $tpl->set ('{clear-full}','');
  229. $tpl->set ('{short-images}',($config_rss['short-images']== 'yes'?'checked': ''));
  230. $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']));
  231. $tpl->set ('{kol-image-short}','');
  232. $tpl->set ('{zip-image}','');
  233. $tpl->set ('{short-full}',($config_rss['short-full']== 'yes'?'checked': ''));
  234. $tpl->set ('{dop-watermark}',($config_rss['dop-watermark']== 'yes'?'checked': ''));
  235. $tpl->set ('{watermark-image-light}',$config_rss['watermark_image_light']);
  236. $tpl->set ('{watermark-image-dark}',$config_rss['watermark_image_dark']);
  237. $tpl->set ('{null}',($config_rss['null']== 'yes'?'checked': ''));
  238. $tpl->set ('{grab-pause}','');
  239. $tpl->set ('{add-pause}','');
  240. $tpl->set ('{cron-auto}','');
  241. $tpl->set ('{min-image}','');
  242. $tpl->set ('{text-html}','');
  243. $tpl->set ('{dim-date}','');
  244. $tpl->set ('{dim-sait}','');
  245. $tpl->set ('{dim-cat}','');
  246. $tpl->set ('{dim-week}','');
  247. $tpl->set ('{file-atach}','');
  248. $tpl->set ('{tor-torrage}','');
  249. $tpl->set ('{file-name}','');
  250. $tpl->set ('{file-video}','');
  251. $tpl->set ('{file-rar}','');
  252. $tpl->set ('{file-zip}','');
  253. $tpl->set ('{file-doc}','');
  254. $tpl->set ('{file-txt}','');
  255. $tpl->set ('{file-dle}','');
  256. $tpl->set ('{file-tor}','');
  257. $tpl->set ('{url-video}','');
  258. $tpl->set ('{url-rar}','');
  259. $tpl->set ('{url-zip}','');
  260. $tpl->set ('{url-doc}','');
  261. $tpl->set ('{url-txt}','');
  262. $tpl->set ('{url-dle}','');
  263. $tpl->set ('{url-tor}','');
  264. $tpl->set ('{tit-video}','');
  265. $tpl->set ('{tit-rar}','');
  266. $tpl->set ('{tit-zip}','');
  267. $tpl->set ('{tit-doc}','');
  268. $tpl->set ('{tit-txt}','');
  269. $tpl->set ('{tit-dle}','');
  270. $tpl->set ('{tit-tor}','');
  271. $tpl->set ('{pap-video}','');
  272. $tpl->set ('{pap-rar}','');
  273. $tpl->set ('{pap-zip}','');
  274. $tpl->set ('{pap-doc}','');
  275. $tpl->set ('{pap-txt}','');
  276. $tpl->set ('{pap-dle}','');
  277. $tpl->set ('{pap-tor}','');
  278. $tpl->set ('{full-url-and}','');
  279. $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']));
  280. $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']));
  281. $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']));
  282. $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']));
  283. $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']));
  284. $template =    '
  285. <div class="title_spoiler"><center><img id="image-full_1" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" />&nbsp;<a href="javascript:ShowOrHide(\'full_1\')">'.$lang_grabber['add_new_dop'].'</a></center></div>
  286. <div id="full_1" style="display:none">
  287. <table cellpadding="" cellspacing="0" width="98%" align="center">
  288.   <tr>
  289.   <td colspan="4" style="padding:4px; border-bottom:1px dashed #c4c4c4;  border-top:1px dashed #c4c4c4" ><center>'.$lang_grabber['rss_xfields_template'].'</center></td>
  290.  </tr>
  291.  <tr>
  292.   <td style="padding:4px"  align="center">'.$lang_grabber['rss_xfields'].'
  293.   <select name="rss_xfields_1" class="load_img">
  294.    '.sel (rss_xfields('1'),'').'
  295.   </select><br>
  296.   '.$lang_grabber['use_po_get'].'
  297.     <input type="checkbox" value="1" name="ret_xf_1" />
  298.       '.$lang_grabber['take_short-story'].'
  299.     <input type="checkbox" value="1" name="sh_fl_1"/>
  300.         '.$lang_grabber['img_size'].'
  301.     <input name="rs_sm_1" class="load_img" type="text" size="3" value="0">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
  302.   <br />
  303. '.$lang_grabber['pole_img'].'
  304.      <input type="checkbox" value="1" name="sh_im_1" />
  305.   '.$lang_grabber['img_size'].'
  306.     <input name="rs_im_1" class="load_img" type="text" size="10" value="0">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
  307.   <br />
  308.   '.$lang_grabber['kod_ost'].'
  309.     <input type="checkbox" value="1" name="sh_nw_1" />
  310. </td>
  311.  </tr>
  312.  </table>
  313.  
  314.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  315.  <tr align="left">
  316. <td width="17%" align="center" valign="middle"  style="padding:4px" ></td>
  317.   <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>
  318.   </td></tr>
  319. </table>
  320.  
  321.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  322. <tr>
  323.   <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>
  324.  </tr>
  325.  <tr align="left">
  326. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['expression'].'</td>
  327.   <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>
  328.   </td></tr>
  329. </table>
  330.  
  331.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  332.  <tr align="left">
  333. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['paste'].'</td>
  334.   <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>
  335.   </td></tr>
  336. </table>
  337. </div>
  338. <a style="padding:10px" href="'.$PHP_SELF .'?mod=xfields&xfieldsaction=configure" target="_blank">'.$lang_grabber['list_dop_pole'].'</a><br /><br />';
  339. $tpl->set ('{xfields-template}',$template);
  340. $tpl->set ('{x}',gen_x ($config_rss['x']));
  341. $tpl->set ('{y}',gen_y ($config_rss['y']));
  342. $tpl->set ('{margin}',$config_rss['margin']);
  343. if (@file_exists ($rss_plugins.'sinonims.php') )
  344. {
  345. $sin =  '
  346.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  347.   <td style="padding:4px"  width="304">'.$lang_grabber['sinonims'].':</td>
  348.   <td width="768" style="padding:4px">
  349. <input type="checkbox" name="sinonim" value="1" '.($config_rss['sinonim'] == 'no'?'': 'checked').'/>
  350.    <select name="sinonim_sel" class="load_img">'.
  351. sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$config_rss['sinonim-sel']).'
  352.   </select>
  353.  </td>
  354.  </tr>';
  355. }
  356. if(@file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
  357. {
  358. $sin .=  '
  359.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  360.   <td style="padding:4px"  width="304">'.$lang_grabber['crosspost'].':</td>
  361.   <td width="768" style="padding:4px">
  362. <input type="checkbox" name="cross_post" value="1" />
  363.  </td>
  364.  </tr>';
  365. }
  366. if((@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
  367. {
  368. $sin .=  '
  369.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  370.   <td style="padding:4px"  width="304">'.$lang_grabber['twitter'].':</td>
  371.   <td width="768" style="padding:4px">
  372. <input type="checkbox" name="twitter_post" value="1" />
  373.  </td>
  374.  </tr>';
  375. }
  376. $tpl->set ('{sinonim}',$sin);
  377. $tpl->set ('{title-prob}','');
  378. $tpl->set ('{title-gener}','');
  379. $tpl->set ('{convert-utf}',($config_rss['convert']== 'yes'?'checked': ''));
  380. $tpl->set ('{no-prow}',dubl_news ($config_rss['no_prow']));
  381. $tpl->set ('{pings}',($config_rss['allow_post']));
  382. $tpl->set ('{show_autor}',($config_rss['show_autor']== 'yes'?'checked': ''));
  383. $tpl->set ('{show_tegs}',($config_rss['show_tegs']== 'yes'?'checked': ''));
  384. $tpl->set ('{show_date}',($config_rss['show_date']== 'yes'?'checked': ''));
  385. $tpl->set ('{show_code}',($config_rss['show_code']== 'yes'?'checked': ''));;
  386. $tpl->set ('{show_date}',($config_rss['show_date']== 'yes'?'checked': ''));
  387. $tpl->set ('{show_code}',($config_rss['show_code']== 'yes'?'checked': ''));
  388. $tpl->set ('{show_down}',($config_rss['show_down']== 'yes'?'checked': ''));
  389. $tpl->set ('{show_f}',($config_rss['show_f']== 'yes'?'checked': ''));
  390. $tpl->set ('{show_symbol}',($config_rss['show_symbol']== 'yes'?'checked': ''));
  391. $tpl->set ('{show-url}',($config_rss['show_url']== 'yes'?'checked': ''));
  392. $tpl->set ('{show_date_expires}',($config_rss['show_date_expires']== 'yes'?'checked': ''));
  393. $tpl->set ('{show_metatitle}',($config_rss['show_metatitle']== 'yes'?'checked': ''));
  394. $tpl->set ('{show_metadescr}',($config_rss['show_metadescr']== 'yes'?'checked': ''));
  395. $tpl->set ('{show_keywords}',($config_rss['show_keywords']== 'yes'?'checked': ''));
  396. $tpl->set ('{symbol}','');
  397. $tpl->set ('{end-template}','');
  398. $tpl->set ('{auto-symbol}','');
  399. $tpl->set ('{auto-numer}',sel (array(1 =>'1',2 =>'2',3 =>'3'),''));
  400. $tpl->set ('{tags}','');
  401. $tpl->set ('{teg-fix}','');
  402. $tpl->set ('{meta-title}','');
  403. $tpl->set ('{auto-metatitle}',($config_rss['auto_metatitle']== 'yes'?'checked': ''));
  404. $tpl->set ('{meta-descr}','');
  405. $tpl->set ('{key-words}','');
  406. $tpl->set ('{prox}','');
  407. $tpl->set ('{start-template}','<div id={skip}news-id-{skip}>{get}</div>');
  408. $tpl->set ('{delate}','');
  409. $tpl->set ('{inser}','');
  410. $tpl->set ('{cookies}','');
  411. $tpl->set ('{keywords}','');
  412. $tpl->set ('{xdescr}','');
  413. $tpl->set ('{stkeywords}','');
  414. $tpl->set ('{date}','');
  415. $tpl->set ('{start}','');
  416. $tpl->set ('{finish}','');
  417. $tpl->set ('{kol-cron}','');
  418. $tpl->set ('{tags-kol}','');
  419. $tpl->set ('{dop-full}','');
  420. $tpl->set ('{groups}',get_groups(explode(',',$config_rss['reg_group'])));
  421. $tpl->set ('{Autors}','');
  422. $tpl->set ('{link-start-del}','');
  423. $tpl->set ('{link-finish-del}','');
  424. $tpl->set ('{ful-start}','');
  425. $tpl->set ('{start-title}','');
  426. $tpl->set ('{start-title-f}','');
  427. $tpl->set ('{s-title}','');
  428. $tpl->set ('{end-title}','');
  429. $tpl->set ('{sfr-short}','');
  430. $tpl->set ('{efr-short}','');
  431. $tpl->set ('{sfr-full}','');
  432. $tpl->set ('{efr-full}','');
  433. $tpl->set ('{s-del}','');
  434. $tpl->set ('{end-del}','');
  435. $tpl->set ('{start-short}','<div id={skip}news-id-{skip}>{get}</div>');
  436. $tpl->set ('{end-short}','');
  437. $tpl->set ('{sart-link}','');
  438. $tpl->set ('{step-page}','');
  439. $tpl->set ('{end-link}','');
  440. $tpl->set ('{sart-cat}','');
  441. $tpl->set ('{shab-data}','');
  442. $tpl->set ('{full-link}','');
  443. $tpl->set ('{so}','');
  444. $tpl->set ('{po}','');
  445. $tpl->set ('{zhv-code}','');
  446. $tpl->set ('{lang-title}','checked');
  447. $tpl->set ('{lang-title-komb}','');
  448. $tpl->set ('{lang-on}','');
  449. $tpl->set ('{lang-in}',slected_lang ('ru'));
  450. $tpl->set ('{lang-out}',slected_lang ('en'));
  451. $tpl->set ('{lang-outf}',slected_lang (''));
  452. $tpl->set ('{add-full}','');
  453. include_once ($rss_plugins.'inserttag.php');
  454. $tpl->set ('{inserttag}',$bb_js);
  455. $form .= "
  456. <script>
  457.    $(function(){
  458.        $('#tags').autocomplete({
  459.            serviceUrl:'engine/ajax/tags_rss.php',
  460.            minChars:3,
  461.            delimiter: /(,|;)\s*/,
  462.            maxHeight:400,
  463.            width:348,
  464.            deferRequestBy: 300
  465.          });
  466.  
  467.    });
  468. </script>
  469. <script language=\"javascript\" type=\"text/javascript\">
  470. var skip = 0;
  471. var get = 0;
  472. var frag = 0;
  473. var zagolovok = 0;
  474.  
  475.  
  476. function simpletags(thetag)
  477. {
  478.                doInsert(\"{\"+thetag+\"}\", \"\", false);
  479. }
  480. function ShowOrHideg( id ) {
  481.      var item = document.getElementById(id);
  482.      if ( document.getElementById('image-'+ id) ) {
  483.        var image = document.getElementById('image-'+ id);
  484.      } else {
  485.        var image = null;
  486.      }
  487.      if (!item) {
  488.        retun;
  489.      }  else {
  490.        if (item.style) {
  491.            if (item.style.display == \"none\") {
  492.                item.style.display = \"\";
  493.                image.src = './engine/inc/plugins/images/minus.gif';
  494.            } else {
  495.                item.style.display = \"none\";
  496.                image.src = './engine/inc/plugins/images/plus.gif';
  497.            }
  498.         } else{ item.visibility = \"show\"; }
  499.      }
  500. };
  501. </script>
  502.  
  503. ";
  504. $tpl->set ('{opt_sys_yes}',$lang['opt_sys_yes']);
  505. $tpl->set ('{opt_sys_no}',$lang['opt_sys_no']);
  506. $tpl->set ('{BB_code}',$add_bb);
  507. $tpl->set ('{BB_codez}',$add_bbz);
  508. $tpl->set ('{BB_codezz}',$add_bbzz);
  509. foreach ($lang_grabber as $key =>$value)$tpl->set ('{'.$key.'}',$value);
  510. $tpl->copy_template = '<form method="post"><input type="hidden" name="action" value="channel" /><input type="hidden" name="subaction" value="doadd" />'.$tpl->copy_template .$form.'
  511.        <input align="left" class="btn btn-success" type="submit" value=" '.$lang_grabber['save'].' " >&nbsp;
  512.        <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" /></form>';
  513. $tpl->compile ('rss');
  514. echo $tpl->result['rss'];
  515. closetable ();
  516. echofooter ();$db->close;return 1;}
  517. if ($config_rss['get_proxy'] == 'yes') get_proxy();
  518. $config_rss['get_prox'] = $tab_id;
  519. if (($action == 'channel') and ($subaction == 'doadd')){
  520. $stop = false;
  521. $rss_url = stripslashes ($_POST['rss_url']);
  522. if ($_POST['category'] != ''){
  523. $category_post = $db->safesql( implode( ',',$_POST['category']));
  524. }else{$category_post = '0';}
  525. $category = $category_post.'='.intval ($_POST['rss_priv']);
  526. $allow_more = intval ($_POST['allow_more']);
  527. $allow_mod = intval ($_POST['allow_mod']);
  528. $allow_main = intval ($_POST['allow_main']);
  529. $allow_comm = intval ($_POST['allow_comm']);
  530. $allow_rate = intval ($_POST['allow_rate']);
  531. $auto = intval ($_POST['auto']);
  532. $load_images = $db->safesql ($_POST['load_img']);
  533. $thumb_images = intval ($_POST['thumb_img']);
  534. $allow_watermark = intval ($_POST['allow_watermark']);
  535. $date_format = intval ($_POST['news_date']);
  536. $ctp = intval ($_POST['so']).'='.intval ($_POST['po']);
  537. $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']);
  538. $full_link = stripslashes ($_POST['full_link']);
  539. $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']);
  540. $start_template = $db->safesql ($_POST['start_template']);
  541. $finish_template =  $db->safesql (str_replace ('
  542. ','|||',$_POST['finish_template']));
  543. $dop_full = $db->safesql ($_POST['dop_full']);
  544. $start = $db->safesql (str_replace ('
  545. ','|||',$_POST['start']));
  546. $finish = $db->safesql (str_replace ('
  547. ','|||',$_POST['finish']));
  548. $delate = $db->safesql (str_replace ('
  549. ','|||',$_POST['delate']));
  550. $inser = $db->safesql (str_replace ('
  551. ','|||',$_POST['inser']));
  552. $symbol = $db->safesql ($_POST['symbols']);
  553. $ftags = $db->safesql ($_POST['tags']);
  554. $metatitle = $db->safesql ($_POST['meta_title']);
  555. $meta_descr = $db->safesql ($_POST['meta_descr']);
  556. $key_words = $db->safesql ($_POST['key_words']);
  557. $ful_start = $db->safesql ($_POST['ful_start']);
  558. $ful_end = $db->safesql ($_POST['ful_end']);
  559. $start_title = $db->safesql ($_POST['start_title']);
  560. $stitles = $db->safesql (str_replace ('
  561. ','|||',$_POST['s_del']));
  562. $ftitles = $db->safesql (str_replace ('
  563. ','|||',$_POST['end_del']));
  564. $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']);
  565. $start_short = $db->safesql ($_POST['start_short']);
  566. $end_short = intval ($_POST['end_short']).'='.intval ($_POST['hide']).'='.intval ($_POST['leech']).'='.intval ($_POST['rewrite_news']);
  567. $sart_link = $db->safesql ($_POST['sart_link']);
  568. $end_link = intval ($_POST['end_link']);
  569. $sart_cat = $db->safesql ($_POST['sart_cat']).'|||'.$db->safesql ($_POST['shab_data']).'|||'.$db->safesql (str_replace ('
  570. ','===',$_POST['zhv_code']));
  571. $end_cat = $db->safesql ($_POST['end_cat']);
  572. $xdescr = $db->safesql($_POST['rss_xdescr']);
  573. $date = $db->safesql(trim($_POST['date'])).'='.intval ($_POST['dim_week']).'='.intval ($_POST['dim_date']).'='.intval ($_POST['dim_sait']).'='.intval ($_POST['dim_cat']);
  574. $cookies = $db->safesql (str_replace ('
  575. ','|||',$_POST['cookies']));
  576. $keywords = $db->safesql(str_replace ('
  577. ','|||',$_POST['keywords'])).'==='.$db->safesql($_POST['sfr_short']).'==='.$db->safesql($_POST['sfr_full']);
  578. $stkeywords = $db->safesql (str_replace ('
  579. ','|||',$_POST['stkeywords'])).'==='.$db->safesql($_POST['efr_short']).'==='.$db->safesql($_POST['efr_full']);
  580. if ($_POST['groups'] != '')$autor_grups = implode( ',',$_POST['groups']);
  581. $Autors = $db->safesql (str_replace ('
  582. ','|||',$_POST['Autors'])).'='.$autor_grups;
  583. $proxy = '';
  584. $kategory = $db->safesql (str_replace ('
  585. ','|||',$_POST['kategory']));
  586. 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']);
  587. if (trim ($rss_url) == '')
  588. {
  589. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url'],'javascript:history.go(-1)');
  590. return 1;
  591. }
  592. if (!(ereg ('http://',$rss_url)) or reset_url($rss_url) == '')
  593. {
  594. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url_msg'],'javascript:history.go(-1)');
  595. return 1;
  596. }
  597. $rss_url = $db->safesql ($rss_url);
  598. $inf = $db->super_query ('SELECT id,title FROM '.PREFIX ."_rss WHERE url = '".trim($rss_url)."'");
  599. $rss_result = get_rss_channel_info ($rss_url,intval ($_POST['proxy']),$_POST['charset']);
  600. if ($rss_result['title'] != '')
  601. {
  602. $channel_title = $rss_result['title'];
  603. $channel_descr = $rss_result['description'];
  604. $rss = '1';
  605. }
  606. else
  607. {
  608. $channel_title =    $rss_result['html'];
  609. $channel_descr = $rss_result['html'];
  610. $rss = '0';
  611. }
  612. if ($rss_result['charset'] != '') $_POST['charset'] = $rss_result['charset'];
  613. if ($rss == '1'){
  614. $start_short = '';
  615. $sart_link = '';
  616. $ctp = '';
  617. }
  618. $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']);
  619. $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']);
  620. if ($stop == false)
  621. {
  622. $sql_result = $db->query ('SELECT url FROM '.PREFIX .'_rss');
  623. $pnum = $db->num_rows ($sql_result) +1;
  624. $channel_title = $db->safesql ($channel_title);
  625. $channel_descr = $db->safesql ($channel_descr);
  626. $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')";
  627. $db->query ($sql_query);
  628. $rss_id = $db->insert_id();
  629. if (trim ($channel_title) != '')
  630. {
  631. $title = stripslashes (strip_tags_smart ($channel_title));
  632. if (50 <strlen ($title))
  633. {
  634. $title = substr ($title,0,50) .'...';
  635. }
  636. }
  637. else
  638. {
  639. $title = $lang_grabber['no_title'];
  640. }
  641. if ($rss == 1){
  642. $mgs = $lang_grabber['channel'].' &#8470;'.$pnum.' <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['add_msg_rss'].'</font><br />';
  643. 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');
  644. return 1;
  645. }else{
  646. $mgs = $lang_grabber['channel'].' &#8470; <b>'.$pnum.'</b> => <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['add_msg_html'].'</font><br />';
  647. 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');
  648. $db->close;
  649. return 1;
  650. }
  651. }
  652. }
  653. if (($action == 'channel') and ($subaction == 'do_change')){
  654. if (isset ($id))
  655. {
  656. $stop = false;
  657. if (!((!(trim ($id) == '') AND !($id == 0))))
  658. {
  659. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['channel_msg_id'],'javascript:history.go(-1)');
  660. return 1;
  661. }
  662. $row = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$id'");
  663. if ($_POST['category'] != ''){
  664. $category_post = $db->safesql( implode( ',',$_POST['category']));
  665. }else{$category_post = '0';}
  666. $category = $category_post.'='.intval ($_POST['rss_priv']);
  667. $allow_main = intval ($_POST['allow_main']);
  668. $allow_mod = intval ($_POST['allow_mod']);
  669. $allow_comm = intval ($_POST['allow_comm']);
  670. $allow_load = $db->safesql ($_POST['load_img']);
  671. $thumb_images = intval ($_POST['thumb_img']);
  672. $allow_rate = intval ($_POST['allow_rate']);
  673. $allow_auto = intval ($_POST['auto']);
  674. $allow_more = intval ($_POST['allow_more']);
  675. $allow_water = intval ($_POST['allow_watermark']);
  676. $date_format = intval ($_POST['news_date']);
  677. $symbol = $db->safesql ($_POST['symbols']);
  678. $ftags = $db->safesql ($_POST['tags']);
  679. $metatitle = $db->safesql ($_POST['meta_title']);
  680. $meta_descr = $db->safesql ($_POST['meta_descr']);
  681. $key_words = $db->safesql ($_POST['key_words']);
  682. $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']);
  683. $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']);
  684. $ctp = intval ($_POST['so']).'='.intval ($_POST['po']);
  685. $full_link = stripslashes ($_POST['full_link']);
  686. $date = $db->safesql(trim($_POST['date'])).'='.intval ($_POST['dim_week']).'='.intval ($_POST['dim_date']).'='.intval ($_POST['dim_sait']).'='.intval ($_POST['dim_cat']);
  687. $original_rss_url = $row['url'];
  688. $rss_url = $db->safesql ($_POST['rss_url']);
  689. $rss = intval ($_POST['rss_html']);
  690. if (trim ($rss_url) == '')
  691. {
  692. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url'],'javascript:history.go(-1)');
  693. return 1;
  694. }
  695. if (!(ereg ('http://',$rss_url)) or reset_url($rss_url) == '')
  696. {
  697. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['error_url_msg'],'javascript:history.go(-1)');
  698. return 1;
  699. }
  700. if ($original_rss_url != $rss_url)
  701. {
  702. $inf = $db->super_query ('SELECT title FROM '.PREFIX ."_rss WHERE url = '".trim($rss_url)."'");
  703. $rss_result = get_rss_channel_info ($rss_url,intval ($_POST['proxy']),$_POST['charset']);
  704. if ($rss_result['title'] != '')
  705. {
  706. $channel_title = $rss_result['title'];
  707. $channel_descr = $rss_result['description'];
  708. $rss = '1';
  709. }
  710. else
  711. {
  712. $channel_title = $rss_result['html'];
  713. $channel_descr = $rss_result['html'];
  714. $rss = '0';
  715. }
  716. }
  717. else
  718. {
  719. $channel_title = $db->safesql($_POST['rss_title']);
  720. }
  721. if ($stop == false)
  722. {
  723. $cookies = $db->safesql (str_replace ('
  724. ','|||',$_POST['cookies']));
  725. $keywords = $db->safesql(str_replace ('
  726. ','|||',$_POST['keywords'])).'==='.$db->safesql($_POST['sfr_short']).'==='.$db->safesql($_POST['sfr_full']);
  727. $stkeywords = $db->safesql (str_replace ('
  728. ','|||',$_POST['stkeywords'])).'==='.$db->safesql($_POST['efr_short']).'==='.$db->safesql($_POST['efr_full']);
  729. if ($_POST['groups'] != '')$autor_grups = implode( ',',$_POST['groups']);
  730. $Autors = $db->safesql (str_replace ('
  731. ','|||',$_POST['Autors'])).'='.$autor_grups;
  732. $xdescr = $db->safesql ($_POST['rss_xdescr']);
  733. $start_template = $db->safesql ($_POST['start_template']);
  734. $finish_template =  $db->safesql (str_replace ('
  735. ','|||',$_POST['finish_template']));
  736. $delate = $db->safesql (str_replace ('
  737. ','|||',$_POST['delate']));
  738. $inser = $db->safesql (str_replace ('
  739. ','|||',$_POST['inser']));
  740. $start =  $db->safesql(str_replace ('
  741. ','|||',$_POST['start']));
  742. $finish = $db->safesql( str_replace ('
  743. ','|||',$_POST['finish']));
  744. $ful_start = $db->safesql ($_POST['ful_start']);
  745. $ful_end = $db->safesql ($_POST['ful_end']);
  746. $start_title = $db->safesql ($_POST['start_title']);
  747. $stitles = $db->safesql (str_replace ('
  748. ','|||',$_POST['s_del']));
  749. $ftitles = $db->safesql (str_replace ('
  750. ','|||',$_POST['end_del']));
  751. $kategory = $db->safesql (str_replace ('
  752. ','|||',$_POST['kategory']));
  753. if ($rss_result['charset'] != '') $_POST['charset'] = $rss_result['charset'];
  754. $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']);;
  755. $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']);
  756. $start_short = $db->safesql ($_POST['start_short']);
  757. $end_short = intval ($_POST['end_short']).'='.intval ($_POST['hide']).'='.intval ($_POST['leech']).'='.intval ($_POST['rewrite_news']);
  758. $sart_link = $db->safesql ($_POST['sart_link']);
  759. $end_link = intval ($_POST['end_link']);
  760. $sart_cat = $db->safesql ($_POST['sart_cat']).'|||'.$db->safesql ($_POST['shab_data']).'|||'.$db->safesql (str_replace ('
  761. ','===',$_POST['zhv_code']));
  762. $end_cat = $db->safesql ($_POST['end_cat']);
  763. $dop_full = $db->safesql ($_POST['dop_full']);
  764. if ($rss == '1'){
  765. $start_short = '';
  766. $sart_link = '';
  767. $ctp = '';
  768. }
  769. for ($x=0;$x++<$_POST['kol_xfields'];){
  770. 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]);
  771. }
  772. }
  773. if($templ)$xfields_template = implode ('|||',$templ);
  774. else $xfields_template = '';
  775. $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']);
  776. $channel_title = $db->safesql ($channel_title);
  777. $channel_descr = $db->safesql ($channel_descr);
  778. $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'");
  779. if (!$inf)header('Status: 204 ');
  780. if (trim ($channel_title) != '')
  781. {
  782. $title = stripslashes (strip_tags_smart ($channel_title));
  783. if (50 <strlen ($title))
  784. {
  785. $title = substr ($title,0,50) .'...';
  786. }
  787. }
  788. else
  789. {
  790. $title = $lang_grabber['no_title'];
  791. }
  792. $mgs = $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$rss_url.'"</font> <font color="red">'.$lang_grabber['edit_channel_ok'].'</font><br />';
  793. 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> &nbsp;&nbsp;<a style="text-decoration: none;color:#fff;" class="btn btn-warning" href="javascript:history.go(-1)">'.$lang_grabber['back'].'</a>');
  794. $db->close;
  795. return 1;
  796. }
  797. }
  798. }
  799. if (($action == 'channel') and ($subaction == 'edit')){
  800. if (isset ($id))
  801. {
  802. if (!((!(trim ($id) == '') AND !($id == 0))))
  803. {
  804. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['channel_msg_id'],'javascript:history.go(-1)');
  805. return 1;
  806. }
  807. $rss_channel_info = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$id'");
  808. $cookies = str_replace ('|||','
  809. ',stripslashes($rss_channel_info['cookies']));
  810. $keywordsd = explode('===',$rss_channel_info['keywords']);
  811. $keywords = str_replace ('|||','
  812. ',stripslashes ($keywordsd[0]));
  813. $stkeywordsd = explode('===',$rss_channel_info['stkeywords']);
  814. $stkeywords = str_replace ('|||','
  815. ',stripslashes ($stkeywordsd[0]));
  816. $Autor = explode('=',$rss_channel_info['Autors']);
  817. $Autors = str_replace ('|||','
  818. ',stripslashes ($Autor['0']));
  819. $short_story = explode('=',$rss_channel_info['short_story']);
  820. $date = explode('=',$rss_channel_info['date']);
  821. $delate = str_replace ('|||','
  822. ',stripslashes ($rss_channel_info['delate']));
  823. $inser = str_replace ('|||','
  824. ',stripslashes ($rss_channel_info['inser']));
  825. $start = str_replace ('|||','
  826. ',$rss_channel_info['start']);
  827. $finish = str_replace ('|||','
  828. ',$rss_channel_info['finish']);
  829. $end_title = explode ('==',$rss_channel_info['end_title']);
  830. $hide_leech = explode('=',$rss_channel_info['end_short']);
  831. $ctp = explode ('=',$rss_channel_info['ctp']);
  832. $dop_nast = explode ('=',$rss_channel_info['dop_nast']);
  833. $dnast = explode ('=',$rss_channel_info['dnast']);
  834. $categoryes = explode ('=',$rss_channel_info['category']);
  835. $stitles = str_replace ('|||','
  836. ',$end_title[2]);
  837. $ftitles = str_replace ('|||','
  838. ',$end_title[3]);
  839. $kategory = str_replace ('|||','
  840. ',$rss_channel_info['kategory']);
  841. if(strlen(stripslashes ($date[0])) == 10) $date[0] = '';
  842. $files = explode('==',$rss_channel_info['files']);
  843. echoheader ('','');
  844. if (trim ($rss_channel_info['title']) != '')
  845. {
  846. $channel_name = '</br> <font color=green> &#8470;'.$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>';
  847. }
  848. $channel_inf = array();
  849. $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
  850. $run[0] = '';
  851. while ($channel_info = $db->get_row($sql_result)) {
  852. if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] =  $channel_info['title'];
  853. else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
  854. }
  855. foreach($channel_inf as $value)
  856. {
  857. if (count($value) != '0'){
  858. foreach($value as $kkey=>$key)
  859. {
  860. $run[$kkey] = $key;
  861. }
  862. }
  863. }
  864. opentable ('<a href='.$PHP_SELF .'?mod=rss>'.$lang_grabber['index_page'] .$lang_grabber['change_channel'] .$channel_name);
  865. $tpl->load_template ('rss_addchannel.tpl');
  866. $tpl->set ('{file-video}',($files[0] == 0 ?'': 'checked'));
  867. $tpl->set ('{file-rar}',($files[2] == 0 ?'': 'checked'));
  868. $tpl->set ('{file-zip}',($files[4] == 0 ?'': 'checked'));
  869. $tpl->set ('{file-doc}',($files[6] == 0 ?'': 'checked'));
  870. $tpl->set ('{file-txt}',($files[8] == 0 ?'': 'checked'));
  871. $tpl->set ('{file-dle}',($files[10] == 0 ?'': 'checked'));
  872. $tpl->set ('{file-tor}',($files[26] == 0 ?'': 'checked'));
  873. $tpl->set ('{url-video}',($files[12] == 0 ?'': 'checked'));
  874. $tpl->set ('{url-rar}',($files[13] == 0 ?'': 'checked'));
  875. $tpl->set ('{url-zip}',($files[14] == 0 ?'': 'checked'));
  876. $tpl->set ('{url-doc}',($files[15] == 0 ?'': 'checked'));
  877. $tpl->set ('{url-txt}',($files[16] == 0 ?'': 'checked'));
  878. $tpl->set ('{url-dle}',($files[17] == 0 ?'': 'checked'));
  879. $tpl->set ('{url-tor}',($files[27] == 0 ?'': 'checked'));
  880. $tpl->set ('{tit-video}',($files[18] == 0 ?'': 'checked'));
  881. $tpl->set ('{tit-rar}',($files[19] == 0 ?'': 'checked'));
  882. $tpl->set ('{tit-zip}',($files[20] == 0 ?'': 'checked'));
  883. $tpl->set ('{tit-doc}',($files[21] == 0 ?'': 'checked'));
  884. $tpl->set ('{tit-txt}',($files[22] == 0 ?'': 'checked'));
  885. $tpl->set ('{tit-dle}',($files[23] == 0 ?'': 'checked'));
  886. $tpl->set ('{tit-tor}',($files[28] == 0 ?'': 'checked'));
  887. $tpl->set ('{file-atach}',($files[24] == 0 ?'': 'checked'));
  888. $tpl->set ('{file-name}',$files[25]);
  889. $tpl->set ('{tor-torrage}',($files[30] == 0 ?'': 'checked'));
  890. $tpl->set ('{pap-video}',$files[1]);
  891. $tpl->set ('{pap-rar}',$files[3]);
  892. $tpl->set ('{pap-zip}',$files[5]);
  893. $tpl->set ('{pap-doc}',$files[7]);
  894. $tpl->set ('{pap-txt}',$files[9]);
  895. $tpl->set ('{pap-dle}',$files[11]);
  896. $tpl->set ('{pap-tor}',$files[29]);
  897. $tpl->set ('{rss_html}',($rss_channel_info['rss'] == 0 ?'': 'checked'));
  898. $tpl->set ('{stkeywords}',$stkeywords);
  899. $tpl->set ('{charsets}',$dop_nast[14]);
  900. $tpl->set ('{dubl-host}',($dop_nast[15] == 0 ?'': 'checked'));
  901. $tpl->set ('{cache-link}',($dnast[27] == 0 ?'': 'checked'));
  902. $tpl->set ('{one-serv}',($dop_nast[11] == 0 ?'': 'checked'));
  903. $tpl->set ('{title}',$rss_channel_info['title']);
  904. $tpl->set ('{discr}',stripslashes ($rss_channel_info['descr']));
  905. $tpl->set ('{address}',stripslashes ($rss_channel_info['url']));
  906. $tpl->set ('{date-format}',gen_date_format ($rss_channel_info['date_format']));
  907. $tpl->set ('{category}',categorynewsselection (explode(',',$categoryes[0]),0));
  908. $tpl->set ('{rss-priv}',sel ($run,$categoryes[1]));
  909. $tpl->set ('{groups}',get_groups(explode(',',$Autor['1'])));
  910. $tpl->set ('{load-images}',($rss_channel_info['load_img'] == 0 ?'': 'checked'));
  911. $tpl->set ('{thumb-images}',($rss_channel_info['thumb_img'] == 0 ?'': 'checked'));
  912. $tpl->set ('{allow-main}',($rss_channel_info['allow_main']  == 0 ?'': 'checked'));
  913. $tpl->set ('{allow-mod}',($rss_channel_info['allow_mod'] == 0 ?'': 'checked'));
  914. $tpl->set ('{allow-comm}',($rss_channel_info['allow_comm'] == 0 ?'': 'checked'));
  915. $tpl->set ('{allow-rate}',($rss_channel_info['allow_rate'] == 0 ?'': 'checked'));
  916. $tpl->set ('{allow-full}',($rss_channel_info['allow_more'] == 0 ?'': 'checked'));
  917. $tpl->set ('{allow-auto}',($rss_channel_info['allow_auto'] == 0 ?'': 'checked'));
  918. $tpl->set ('{allow-water}',($rss_channel_info['allow_watermark'] == 0 ?'': 'checked'));
  919. $tpl->set ('{show_autor}',($dop_nast[5] == 0 ?'': 'checked'));
  920. $tpl->set ('{show_tegs}',($dop_nast[6] == 0 ?'': 'checked'));
  921. $tpl->set ('{show_date}',($dop_nast[7] == 0 ?'': 'checked'));
  922. $tpl->set ('{show_code}',($dop_nast[8] == 0 ?'': 'checked'));
  923. $tpl->set ('{show_down}',($dop_nast[13] == 0 ?'': 'checked'));
  924. $tpl->set ('{show_f}',($dop_nast[9] == 0 ?'': 'checked'));
  925. $tpl->set ('{show_symbol}',($dnast[2] == 0 ?'': 'checked'));
  926. $tpl->set ('{show_metatitle}',($dnast[3] == 0 ?'': 'checked'));
  927. $tpl->set ('{show_metadescr}',($dnast[4] == 0 ?'': 'checked'));
  928. $tpl->set ('{show_keywords}',($dnast[5] == 0 ?'': 'checked'));
  929. $tpl->set ('{wat-host}',($dnast[15] == 0 ?'': 'checked'));
  930. $tpl->set ('{rewrite-data}',($dnast[17] == 0 ?'': 'checked'));
  931. $tpl->set ('{show-url}',($dnast[6] == 0 ?'': 'checked'));
  932. $tpl->set ('{cron-auto}',$dnast[16]);
  933. $tpl->set ('{kol-cron}',$dnast[19]);
  934. $tpl->set ('{tags-kol}',$dnast[20]);
  935. $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]));
  936. $tpl->set ('{tags-auto}',($dnast[8] == 0 ?'': 'checked'));
  937. $tpl->set ('{tags-zag}',($dnast[21] == 0 ?'': 'checked'));
  938. $tpl->set ('{auto-metatitle}',($dnast[9] == 0 ?'': 'checked'));
  939. $tpl->set ('{data-deap}',$dnast[10]);
  940. $tpl->set ('{max-image}',$dnast[37]);
  941. $tpl->set ('{deap}',deap ($dnast[11] == 0 ?'yes': 'no'));
  942. $tpl->set ('{symbol}',$rss_channel_info['symbol']);
  943. $tpl->set ('{auto-symbol}',($dnast[12] == 0 ?'': 'checked'));
  944. $tpl->set ('{auto-numer}',sel (array(1 =>'1',2 =>'2',3 =>'3'),$dnast[13] ));
  945. $tpl->set ('{show_date_expires}',($dnast[14] == 0 ?'': 'checked'));
  946. $tpl->set ('{tags}',$rss_channel_info['ftags']);
  947. $tpl->set ('{meta-title}',$rss_channel_info['metatitle']);
  948. $tpl->set ('{meta-descr}',$rss_channel_info['meta_descr']);
  949. $tpl->set ('{key-words}',$rss_channel_info['key_words']);
  950. $tpl->set ('{hide}',($hide_leech[1] == 0 ?'': 'checked'));
  951. $tpl->set ('{leech}',($hide_leech[2] == 0 ?'': 'checked'));
  952. $tpl->set ('{leech-shab}',stripslashes ($dnast[25]));
  953. $tpl->set ('{rewrite-news}',($hide_leech[3] == 0 ?'': 'checked'));
  954. $tpl->set ('{rewrite-con}',sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$dnast[29]));
  955. $tpl->set ('{rewrite-no}',($dnast[30] == 0 ?'': 'checked'));
  956. $tpl->set ('{leech-dop}',($dnast[31] == 0 ?'': 'checked'));
  957. $tpl->set ('{convert-utf}',($dnast[32] == 0 ?'': 'checked'));
  958. $tpl->set ('{title-gener}',($dnast[33] == 0 ?'': 'checked'));
  959. $tpl->set ('{clear-short}',($short_story[0] == 0 ?'': 'checked'));
  960. $tpl->set ('{clear-full}',($short_story[17] == 0 ?'': 'checked'));
  961. $tpl->set ('{short-images}',($short_story[1] == 0 ?'': 'checked'));
  962. $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]));
  963. $tpl->set ('{kol-image-short}',$dnast[39]);
  964. $tpl->set ('{zip-image}',($dnast[40] == 0 ?'': 'checked'));
  965. $tpl->set ('{min-image}',$dnast[38]);
  966. $tpl->set ('{short-full}',($short_story[2] == 0 ?'': 'checked'));
  967. $tpl->set ('{pings}',($short_story[4] == 0 ?'': 'checked'));
  968. $tpl->set ('{teg-fix}',stripslashes ($short_story[5]));
  969. $tpl->set ('{cat-nul}',($short_story[6] == 0 ?'': 'checked'));
  970. $tpl->set ('{text-html}',($short_story[9] == 0 ?'': 'checked'));
  971. $tpl->set ('{dim-week}',($date[1] == 0 ?'': 'checked'));
  972. $tpl->set ('{dim-date}',($date[2] == 0 ?'': 'checked'));
  973. $tpl->set ('{dim-sait}',($date[3] == 0 ?'': 'checked'));
  974. $tpl->set ('{dim-cat}',($date[4] == 0 ?'': 'checked'));
  975. $tpl->set ('{title-prob}',($short_story[11] == 0 ?'': 'checked'));
  976. $tpl->set ('{no-prow}',dubl_news ($short_story[12]));
  977. $tpl->set ('{grab-pause}',$dop_nast[19]);
  978. $tpl->set ('{add-pause}',$dop_nast[21]);
  979. $tpl->set ('{kol-short}',$dop_nast[22]);
  980. $tpl->set ('{sim-short}',$dop_nast[24]);
  981. $tpl->set ('{starter-page}',$dop_nast[25]);
  982. $tpl->set ('{page-break}',$dop_nast[23]);
  983. $tpl->set ('{image-align}',gen_x ($dnast[0],4));
  984. $tpl->set ('{image-align-full}',gen_x ($dnast[1],4));
  985. $tpl->set ('{image-align-post}',gen_x ($dnast[36] == ''?$dnast[1]:$dnast[36],4));
  986. $tpl->set ('{start-template}',str_replace ('&','&amp;',stripslashes ($rss_channel_info['start_template'])));
  987. $tpl->set ('{end-template}',str_replace ('&','&amp;',stripslashes (str_replace ('|||','
  988. ',$rss_channel_info['finish_template']))));
  989. $finish = str_replace ('|||','
  990. ',$rss_channel_info['finish']);
  991. $tpl->set ('{x}',gen_x ($dop_nast[3]));
  992. $tpl->set ('{y}',gen_y ($dop_nast[4]));
  993. $tpl->set ('{delate}',stripslashes (@htmlspecialchars($delate,ENT_QUOTES )));
  994. $tpl->set ('{inser}',stripslashes (@htmlspecialchars($inser,ENT_QUOTES )));
  995. $tpl->set ('{start}',stripslashes (@htmlspecialchars($start,ENT_QUOTES )));
  996. $tpl->set ('{finish}',stripslashes (@htmlspecialchars($finish,ENT_QUOTES )));
  997. $tpl->set ('{full-link}',stripslashes (@htmlspecialchars($rss_channel_info['full_link'],ENT_QUOTES )));
  998. $tpl->set ('{dop-full}',stripslashes (@htmlspecialchars($rss_channel_info['dop_full'],ENT_QUOTES )));
  999. $tpl->set ('{so}',$ctp[0]);
  1000. $tpl->set ('{po}',$ctp[1]);
  1001. $tpl->set ('{dop-watermark}',($dop_nast[0] == 0 ?'': 'checked'));
  1002. $tpl->set ('{watermark-image-light}',stripslashes ($dnast[23]));
  1003. $tpl->set ('{watermark-image-dark}',stripslashes ($dnast[24]));
  1004. $tpl->set ('{add-full}',($short_story[20] == 0 ?'': 'checked'));
  1005. $tpl->set ('{lang-title}',($dnast[34] == 1 ?'': 'checked'));
  1006. $tpl->set ('{lang-title-komb}',($dnast[35] == 0 ?'': 'checked'));
  1007. $tpl->set ('{lang-on}',($short_story[13] == 0 ?'': 'checked'));
  1008. $tpl->set ('{lang-in}',slected_lang($short_story[14] == ''?'ru': $short_story[14]));
  1009. $tpl->set ('{lang-out}',slected_lang ($short_story[15] == ''?'en': $short_story[15]));
  1010. $tpl->set ('{lang-in}',slected_lang($short_story[14] == ''?'ru': $short_story[14]));
  1011. $tpl->set ('{lang-outf}',slected_lang ($short_story[18] == ''?'': $short_story[18]));
  1012. $tpl->set ('{cat-sp}',($short_story[16] == 0 ?'': 'checked'));
  1013. $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]));
  1014. $tpl->set ('{full-url-and}',($dop_nast[18] == 0 ?'': 'checked'));
  1015. $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]));
  1016. $tpl->set ('{log-pas}',($short_story[8] == 0 ?'': 'checked'));
  1017. $tpl->set ('{log-cookies}',($short_story[21] == 1 ?'': 'checked'));
  1018. $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]));
  1019. $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]));
  1020. $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]));
  1021. $tpl->set ('{prox}',($dop_nast[2] == 0 ?'': 'checked'));
  1022. $tpl->set ('{null}',($dop_nast[10] == 0 ?'': 'checked'));
  1023. $tpl->set ('{load-img}',server_host($rss_channel_info['load_img']));
  1024. $tpl->set ('{margin}',intval($dop_nast[12]));
  1025. $tpl->set ('{xdescr}',htmlspecialchars($rss_channel_info['xdescr'],ENT_QUOTES));
  1026. $tpl->set ('{ful-start}',stripslashes ($rss_channel_info['ful_start']));
  1027. $tpl->set ('{ful-end}',stripslashes ($rss_channel_info['ful_end']));
  1028. $tpl->set ('{start-title}',stripslashes ($rss_channel_info['start_title']));
  1029. $tpl->set ('{start-title-f}',($dnast[22] == 0 ?'': 'checked'));
  1030. $tpl->set ('{end-title}',stripslashes ($end_title[1]));
  1031. $tpl->set ('{s-title}',stripslashes ($end_title[0]));
  1032. $tpl->set ('{link-start-del}',stripslashes ($end_title[4]));
  1033. $tpl->set ('{link-finish-del}',stripslashes ($end_title[5]));
  1034. $tpl->set ('{sfr-short}',stripslashes ($keywordsd[1]));
  1035. $tpl->set ('{efr-short}',stripslashes ($stkeywordsd[1]));
  1036. $tpl->set ('{sfr-full}',stripslashes ($keywordsd[2]));
  1037. $tpl->set ('{efr-full}',stripslashes ($stkeywordsd[2]));
  1038. $tpl->set ('{end-del}',stripslashes ($ftitles));
  1039. $tpl->set ('{s-del}',stripslashes ($stitles));
  1040. $tpl->set ('{start-short}',stripslashes ($rss_channel_info['start_short']));
  1041. $tpl->set ('{end-short}',($hide_leech[0] == 0 ?'': 'checked'));
  1042. $tpl->set ('{sart-link}',stripslashes ($rss_channel_info['sart_link']));
  1043. $tpl->set ('{step-page}',$dop_nast[20]);
  1044. $tpl->set ('{end-link}',($rss_channel_info['end_link'] == 0 ?'': 'checked'));
  1045. $sart_cat = explode('|||',$rss_channel_info['sart_cat']);
  1046. $tpl->set ('{sart-cat}',stripslashes ($sart_cat[0]));
  1047. $tpl->set ('{shab-data}',stripslashes ($sart_cat[1]));
  1048. $tpl->set ('{zhv-code}',stripslashes (@htmlspecialchars(str_replace ('===','
  1049. ',$sart_cat[2]),ENT_QUOTES)));
  1050. $tpl->set ('{end-cat}',stripslashes ($rss_channel_info['end_cat']));
  1051. $tpl->set ('{date}',stripslashes ($date[0]));
  1052. $tpl->set ('{cookies}',$cookies);
  1053. $tpl->set ('{keywords}',$keywords);
  1054. $tpl->set ('{Autors}',$Autors);
  1055. $tpl->set ('{kategory}',$kategory);
  1056. $xfields_template = explode ('|||',$rss_channel_info['xfields_template']);
  1057. $list = rss_xfields(1);
  1058. $template = '';
  1059. $x= 1;
  1060. foreach ($xfields_template as $value){
  1061. if ($value != ''){
  1062. $key = explode ('==',$value);
  1063. if ($list[$key[0]] == '')$list[$key[0]] = $lang_grabber['list_dop_pole'];
  1064. $template .= '
  1065.  
  1066. <div class="title_spoiler"><center><img id="image-full_'.$x.'" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" />&nbsp;<a href="javascript:ShowOrHideg(\'full_'.$x.'\')"><b>'.$list[$key[0]].' ['.$key[0].']</b></a></center></div>
  1067.  
  1068. <div id="full_'.$x.'" style="display:none">
  1069. <table cellpadding="" cellspacing="0" width="98%" align="center">
  1070. <!-- <tr>
  1071.   <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>
  1072.  </tr> -->
  1073.  <tr>
  1074.   <td style="padding:4px"  align="center">'.$lang_grabber['rss_xfields'].'
  1075.   <select name="rss_xfields_'.$x.'" class="load_img">
  1076.    '.sel (rss_xfields('1'),$key[0]).'
  1077.   </select><br>
  1078.   '.$lang_grabber['use_po_get'].'
  1079. <input type="checkbox" name="ret_xf_'.$x.'" value="1" '.($key[2] == 0 ?'': 'checked').' />
  1080.    '.$lang_grabber['take_short-story'].'
  1081. <input type="checkbox" name="sh_fl_'.$x.'" value="1" '.($key[3] == 0 ?'': 'checked').' />
  1082.          '.$lang_grabber['kol-vo'].'
  1083.     <input name="rs_sm_'.$x.'" class="load_img" type="text" size="3" value="'.$key[8].'">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
  1084.       <br />
  1085.   '.$lang_grabber['pole_img'].'
  1086. <input type="checkbox" name="sh_im_'.$x.'" value="1" '.($key[4] == 0 ?'no': 'checked').' />
  1087.   '.$lang_grabber['img_size'].'
  1088.     <input name="rs_im_'.$x.'" class="load_img" type="text" size="10" value="'.$key[7].'">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
  1089.      <br>
  1090. '.$lang_grabber['kod_ost'].'
  1091. <input type="checkbox" name="sh_nw_'.$x.'" value="1" '.($key[9] == 0 ?'': 'checked').' />
  1092.      </td>
  1093.  </tr>
  1094.  </table>
  1095.  
  1096.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1097.  <tr align="left">
  1098. <td width="17%" align="center" valign="middle"  style="padding:4px" ></td>
  1099.   <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>
  1100.   </td></tr>
  1101. </table>
  1102.  
  1103.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1104. <tr>
  1105.   <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>
  1106.  </tr>
  1107.  <tr align="left">
  1108. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['expression'].'</td>
  1109.   <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>
  1110.   </td></tr>
  1111. </table>
  1112.  
  1113.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1114.  <tr align="left">
  1115. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['paste'].'</td>
  1116.   <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>
  1117.   </td></tr>
  1118. </table>
  1119. </div>
  1120. ';
  1121. $x++;
  1122. }
  1123. }
  1124. $template .=    '
  1125.  
  1126. <!-- <div><a href="javascript:ShowOrHide(\'full_'.$x.'\');"><center>'.$lang_grabber['add_new_dop'].'</center></a></div> -->
  1127.  
  1128. <div class="title_spoiler"><center><img id="image-full_'.$x.'" style="vertical-align: middle;border: none;" alt="" src="./engine/inc/plugins/images/plus.gif" />&nbsp;<a href="javascript:ShowOrHideg(\'full_'.$x.'\')">'.$lang_grabber['add_new_dop'].'</a></center></div>
  1129.  
  1130. <div id="full_'.$x.'" style="display:none">
  1131. <table cellpadding="" cellspacing="0" width="98%" align="center">
  1132. <!--    <tr>
  1133.   <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>
  1134.  </tr> -->
  1135.  <tr>
  1136.   <td style="padding:4px"  align="center">'.$lang_grabber['rss_xfields'].'
  1137.   <select name="rss_xfields_'.$x.'" class="load_img">
  1138.    '.sel (rss_xfields('1'),'').'
  1139.   </select><br>
  1140.   '.$lang_grabber['use_po_get'].'
  1141. <input type="checkbox" name="ret_xf_'.$x.'" value="1"/>
  1142.   '.$lang_grabber['take_short-story'].'
  1143.     <input type="checkbox"  name="sh_fl_'.$x.'" value="1"/>
  1144.      '.$lang_grabber['kol-vo'].'
  1145.     <input name="rs_sm_'.$x.'" class="load_img" type="text" size="3" value="0">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['help_kol_xf_word'].'\', this, event, \'500px\')">[?]</a>
  1146.   <br />
  1147.   '.$lang_grabber['pole_img'].'
  1148.      <input type="checkbox" name="sh_im_'.$x.'" value="1"/>
  1149.   <br>
  1150.   '.$lang_grabber['img_size'].'
  1151.     <input name="rs_im_'.$x.'" class="load_img" type="text" size="10" value="">&nbsp;<a href="#" class="hintanchor" onMouseover="showhint(\''.$lang_grabber['opt_sys_maxsided'].'\', this, event, \'500px\')">[?]</a>
  1152. '.$lang_grabber['kod_ost'].'
  1153.     <input type="checkbox" name="sh_nw_'.$x.'" value="1"/>
  1154.   </select>
  1155. </td>
  1156.  </tr>
  1157.  </table>
  1158.  
  1159.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1160.  <tr align="left">
  1161. <td width="17%" align="center" valign="middle"  style="padding:4px" ></td>
  1162.   <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>
  1163.   </td></tr>
  1164. </table>
  1165.  
  1166.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1167. <tr>
  1168.   <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>
  1169.  </tr>
  1170.  <tr align="left">
  1171. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['expression'].'</td>
  1172.   <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>
  1173.   </td></tr>
  1174. </table>
  1175.  
  1176.  
  1177.   <table cellpadding="" cellspacing="0" width="98%" align="center">
  1178.  <tr align="left">
  1179. <td width="17%" align="center" valign="middle"  style="padding:4px" >'.$lang_grabber['paste'].'</td>
  1180.   <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>
  1181.   </td></tr>
  1182. </table>
  1183. </div>
  1184. <a style="padding:10px" href="'.$PHP_SELF .'?mod=xfields&xfieldsaction=configure" target="_blank">'.$lang_grabber['list_dop_pole'].'</a><br /><br />';
  1185. $tpl->set ('{kol-xfields}',$x);
  1186. $tpl->set ('{xfields-template}',$template);
  1187. if (@file_exists ($rss_plugins.'sinonims.php') )
  1188. {
  1189. $sin =  '
  1190.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  1191.   <td style="padding:4px"  width="304">'.$lang_grabber['sinonims'].':</td>
  1192.   <td width="768" style="padding:4px">
  1193.  <input type="checkbox" name="sinonim" value="1" '.($short_story[3] == 0 ?'': 'checked').' value="1"/>
  1194.   <select name="sinonim_sel" class="load_img">'.
  1195. sel (array ('0'=>$lang_grabber['thumb_shortfull'],'1'=>$lang_grabber['thumb_short'],'2'=>$lang_grabber['thumb_full']),$short_story[19]).'
  1196.   </select>
  1197.  </td>
  1198.  </tr>';
  1199. }
  1200. if(@file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
  1201. {
  1202. $sin .=  '
  1203.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  1204.   <td style="padding:4px"  width="304">'.$lang_grabber['crosspost'].':</td>
  1205.   <td width="768" style="padding:4px">
  1206.   <input type="checkbox" name="cross_post" '.($dnast[26] == 0 ?'': 'checked').' value="1"/>
  1207.  </td>
  1208.  </tr>';
  1209. }
  1210. if((@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
  1211. {
  1212. $sin .=  '
  1213.  <tr style="border-bottom:1px dashed #c4c4c4; border-top:1px dashed #c4c4c4">
  1214.   <td style="padding:4px"  width="304">'.$lang_grabber['twitter'].':</td>
  1215.   <td width="768" style="padding:4px">
  1216.   <input type="checkbox" name="twitter_post" '.($dnast[28] == 0 ?'': 'checked').' value="1"/>
  1217.  </td>
  1218.  </tr>';
  1219. }
  1220. $tpl->set ('{sinonim}',$sin);
  1221. $tpl->set ('{opt_sys_yes}',$lang['opt_sys_yes']);
  1222. $tpl->set ('{opt_sys_no}',$lang['opt_sys_no']);
  1223. foreach ($lang_grabber as $key =>$value){$tpl->set ('{'.$key.'}',$value);}
  1224. $form = '   <form method="post" >
  1225.    <input type="hidden" name="id" value="'.$id .'" />
  1226.    <input type="hidden" name="action" value="channel" />
  1227.    <input type="hidden" name="subaction" value="do_change" />';
  1228. include_once ($rss_plugins.'inserttag.php');
  1229. $tpl->set ('{inserttag}',$bb_js);
  1230. $form .= "
  1231. <script>
  1232.    $(function(){
  1233.        $('#tags').autocomplete({
  1234.            serviceUrl:'engine/ajax/tags_rss.php',
  1235.            minChars:3,
  1236.            delimiter: /(,|;)\s*/,
  1237.            maxHeight:400,
  1238.            width:348,
  1239.            deferRequestBy: 300
  1240.          });
  1241.  
  1242.    });
  1243.  
  1244. function simpletags(thetag)
  1245. {
  1246.                doInsert(\"{\"+thetag+\"}\", \"\", false);
  1247. }
  1248.  
  1249. function ShowOrHideg( id ) {
  1250.      var item = document.getElementById(id);
  1251.      if ( document.getElementById('image-'+ id) ) {
  1252.        var image = document.getElementById('image-'+ id);
  1253.      } else {
  1254.        var image = null;
  1255.      }
  1256.      if (!item) {
  1257.        retun;
  1258.      }  else {
  1259.        if (item.style) {
  1260.            if (item.style.display == \"none\") {
  1261.                item.style.display = \"\";
  1262.                image.src = './engine/inc/plugins/images/minus.gif';
  1263.            } else {
  1264.                item.style.display = \"none\";
  1265.                image.src = './engine/inc/plugins/images/plus.gif';
  1266.            }
  1267.         } else{ item.visibility = \"show\"; }
  1268.      }
  1269. };
  1270. </script>
  1271. ";
  1272. $tpl->set ('{BB_code}',$add_bb);
  1273. $tpl->set ('{BB_codez}',$add_bbz);
  1274. $tpl->set ('{BB_codezz}',$add_bbzz);
  1275. $tpl->copy_template = $form .$tpl->copy_template .'
  1276.            <input align="left" class="btn btn-success" type="submit" OnClick="alert(\''.$lang_grabber['channel'].' '.$lang_grabber['edit_channel_ok'].'\')" value=" '.$lang_grabber['save'].' " >&nbsp;
  1277.            <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" /></form>';
  1278. $tpl->compile ('rss');
  1279. echo $tpl->result['rss'];
  1280. closetable ();
  1281. echofooter ();
  1282. $db->close;
  1283. return 1;
  1284. }
  1285. }
  1286. if ($action == 'doaddnews')
  1287. {
  1288. echoheader ('','');
  1289. opentable ($lang_grabber['add_news']);
  1290. if ($_POST['channels'])
  1291. {
  1292. foreach ($_POST['channels'] as $ckey=>$channel_id)
  1293. {
  1294. $xfield = array();
  1295. $xdoe_channel = array();
  1296. $news_per_channel = intval ($_POST['news-per-channel-'.$channel_id]);
  1297. $channel_info = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id ='$channel_id'");
  1298. if (trim ($channel_info['title']) != '')
  1299. {
  1300. $tit = stripslashes (strip_tags_smart ($channel_info['title']));
  1301. if (50 <strlen ($tit))
  1302. {
  1303. $tit = substr ($tit,0,50) .'...';
  1304. }
  1305. }
  1306. else
  1307. {
  1308. $URL = get_urls(trim($channel_info['url']));
  1309. $tit = $URL['host'];
  1310. }
  1311. echo '<b style="color:green;align:left;"> &#8470;'.$channel_info['xpos'].' - '.$tit.'</b><br>';
  1312. $dop_nast = explode ('=',$channel_info['dop_nast']);
  1313. $dates = explode ('=',$channel_info['date']);
  1314. $dnast = explode ('=',$channel_info['dnast']);
  1315. $dop_sort = explode ('=',$channel_info['short_story']);
  1316. $rss_files = explode('==',$channel_info['files']);
  1317. if ($news_per_channel == 0){
  1318. $firt = array();
  1319. foreach ($_POST as $key_con =>$dsfa)if (preg_match('#mod#i',$key_con))$firt[] = 1;
  1320. $news_per_channel = count($firt)+1;
  1321. }
  1322. $n = $news_per_channel -1;
  1323. $nn = 0;
  1324. for ($di = 1;$di <$news_per_channel;++$di)
  1325. {
  1326. $cp_output = '';
  1327. $xdoe_files = array();
  1328. $xdoe = array();
  1329. if (intval($dop_nast[21]) != 0) sleep ($dop_nast[21]);
  1330. $news_selected = $_POST['sel_'.$di.$channel_id];
  1331. if ($news_selected == 1)
  1332. {
  1333. $tegs =$_POST['tags_'.$di.$channel_id];
  1334. if ( count($_POST['category'.$di.$channel_id.'_']))
  1335. {
  1336. $category_list = $db->safesql( implode( ',',$_POST['category'.$di.$channel_id.'_'] ) );
  1337. }else{$category_list = '0';}
  1338. $title = trim ($_POST['title_'.$di.$channel_id]);
  1339. $_POST['title'] = html_entity_decode($title);
  1340. $alt_name = totranslit ($title);
  1341. $short_story = $_POST['short_'.$di.$channel_id];
  1342. $full_story = $_POST['full_'.$di.$channel_id];
  1343. $sinonims_val = ($_POST['sinonims_'.$di.$channel_id] == 1 ?1 : 0);
  1344. $crosspost_val = ($_POST['crosspost_'.$di.$channel_id] == 1 ?1 : 0);
  1345. $twitter_val = ($_POST['twitter_'.$di.$channel_id] == 1 ?1 : 0);
  1346. $rewrite = ($_POST['rewrite_'.$di.$channel_id] == 1 ?1 : 0);
  1347. $approve = ($_POST['mod_'.$di.$channel_id] == 1 ?1 : 0);
  1348. $allow_comm = ($_POST['comm_'.$di.$channel_id] == 1 ?1 : 0);
  1349. $allow_main = ($_POST['main_'.$di.$channel_id] == 1 ?1 : 0);
  1350. $allow_rate = intval ($channel_info['allow_rate']);
  1351. $allow_more = intval ($channel_info['allow_more']);
  1352. $thistime =   $_POST['date-from-channel_'.$di.$channel_id];
  1353. $news_full_link = $_POST['news-full-link_'.$di.$channel_id];
  1354. $serv = $_POST['serv_'.$di.$channel_id];
  1355. $full_news_link = $_POST['news_link_'.$di.$channel_id];
  1356. $radikal = ($_POST['radikal_'.$di.$channel_id]== 1 ?1 : 0);
  1357. $xfield = $_POST['xfield'.$di.$channel_id.'_'];
  1358. $author = $db->safesql ($_POST['autor_'.$di.$channel_id]);
  1359. $meta_title = $db->safesql ($_POST['meta_title'.$di.$channel_id]);
  1360. $descr = $db->safesql ($_POST['descr'.$di.$channel_id]);
  1361. $keywords = $db->safesql ($_POST['keywords'.$di.$channel_id]);
  1362. $mets = ($_POST['met_'.$di.$channel_id] == 1 ?1 : 0);
  1363. $expires = $_POST['expires_'.$di.$channel_id];
  1364. $dimages = '';
  1365. if ($mets == 1)$meta_title = $db->safesql (trim($meta_title.' '.$title));else $meta_title = $db->safesql (trim($meta_title));
  1366. $alt_name = $db->safesql (totranslit( stripslashes( $title ),true,false ));
  1367. $catalog_url = $db->safesql( substr( htmlspecialchars( strip_tags_smart( stripslashes( trim( $_POST['symbol'.$di.$channel_id] ) ) ) ),0,3 ) );
  1368. $stop = false;
  1369. if ($category_list =='0'and $dop_sort[6] == 0) $stop = true;
  1370. if ($title != ''and !$stop){
  1371. $safeTitle = $db->safesql ($title);
  1372. if ($dop_sort[12] == 0) {$where = " WHERE title like '%".$safeTitle."%'";}
  1373. elseif ($dop_sort[12] == 1 and $full_news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($full_news_link)."%'";}
  1374. elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
  1375. 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)."%'";}
  1376. else {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
  1377. $sql_Title = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
  1378. if ($db->num_rows ($sql_Title) == 0 or $rewrite == 1 or $dop_sort[12] == 0)
  1379. {
  1380. $xfields = '';
  1381. $filecontents = array();
  1382. if( !empty( $xfield )) {
  1383. ob_implicit_flush();
  1384. foreach ( $xfield as $xfielddataname =>$xfielddatavalue ) {
  1385. if( $xfielddatavalue == '') {
  1386. continue;
  1387. }
  1388. $xfields_im = false;
  1389. $xfte = array();
  1390. $xfte = explode ('|||',$channel_info['xfields_template']);
  1391. foreach($xfte as $value)
  1392. {
  1393. $key = explode ('==',$value);
  1394. if ($key[0] == $xfielddataname and $key[4] == 1){
  1395. $xfields_im = true;
  1396. break;
  1397. }
  1398. }
  1399. $xfielddatavalue = stripslashes($xfielddatavalue);
  1400. if ($serv != '0')
  1401. {
  1402. $full_images = array();
  1403. $di_control = new image_controller ();
  1404. $di_control->post = '';
  1405. if ($xfields_im == true)$xfielddatavalue='[img]'.$xfielddatavalue.'[/img]';
  1406. $di_control->short_story = $xfielddatavalue;
  1407. $di_control->proxy = $dop_nast[2];
  1408. $di_control->dubl =$dop_nast[15];
  1409. if ($dates[0] != ''and strlen($dates[0]) != 10){
  1410. $di_control->post = '/'.$dates[0] ;
  1411. }
  1412. if (intval($key[7]) != 0)$di_control->post .= '/th_post';
  1413. if ($dates[1] == 1 or $config_rss['alt_name'] == 'yes')$di_control->dim_week = $alt_name;
  1414. $di_control->dim_date =$dates[2];
  1415. $di_control->dim_sait =$dates[3];
  1416. $di_control->dim_cat =$dates[4];
  1417. $di_control->wat_h =$dnast[15];
  1418. if (intval($key[7]) != 0)$di_control->max_up_side = $key[7];
  1419. else $di_control->max_up_side = $config['max_up_side'];
  1420. if (intval($dnast[37]) != 0)$di_control->max_image = $dnast[37];
  1421. else $di_control->max_image = $config['max_image'];
  1422. $di_control->min_image = $dnast[38];
  1423. 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]."'");
  1424. $di_control->cat = $di_control_cat ['alt_name'];
  1425. if ($channel_info['allow_watermark'] == 1)
  1426. {
  1427. $di_control->allow_watermark = true;
  1428. if ($dop_nast[0] == 1)
  1429. {
  1430. if (trim($dnast[23]) != '')$config_rss ['watermark_image_light']=$dnast[23];
  1431. if (trim($dnast[24]) != '')$config_rss['watermark_image_dark']=$dnast[24];
  1432. $di_control->watermark_image_light = ROOT_DIR .$config_rss ['watermark_image_light'];
  1433. $di_control->watermark_image_dark = ROOT_DIR .$config_rss['watermark_image_dark'];
  1434. }
  1435. }
  1436. $di_control->x = $dop_nast[3];
  1437. $di_control->y = $dop_nast[4];
  1438. $di_control->margin = $dop_nast[12];
  1439. if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
  1440. $di_control->rewrite = $rewrite;
  1441. }
  1442. if ($dop_nast[11] == 1)$di_control->shs = true;
  1443. $db->close;
  1444. $pro = $di_control->process($serv);
  1445. if (count($pro) != 0) {
  1446. $xdoe[] = implode('<br />',$pro);
  1447. }
  1448. if (count ($di_control->upload_images) != 0)
  1449. {
  1450. $folder_prefix = trim($di_control->post.$di_control->pap_data,'/');
  1451. $dim = '|||'.$folder_prefix.'/';
  1452. $dimage = implode ($dim,$di_control->upload_images);
  1453. $dimages = $db->safesql ($folder_prefix.'/'.$dimage);
  1454. }
  1455. $xfielddatavalue = $di_control->short_story;
  1456. if (count($di_control->upload_image ) != 0 and intval($key[7]) == 0){
  1457. $short_story=strtr ($short_story,$di_control->upload_image);
  1458. $full_story=strtr ($full_story,$di_control->upload_image);
  1459. }
  1460. if ($xfields_im == true){
  1461. $xfielddatavalue=str_replace( '[thumb]','',$xfielddatavalue );
  1462. $xfielddatavalue=str_replace( '[/thumb]','',$xfielddatavalue );
  1463. $xfielddatavalue=str_replace( '[img]','',$xfielddatavalue );
  1464. $xfielddatavalue=str_replace( '[/img]','',$xfielddatavalue );
  1465. }
  1466. }
  1467. $config_code_bb = explode (',',$config_rss['code_bb'] );
  1468. if (in_array ($xfielddataname ,$config_code_bb) and @file_exists ($rss_plugins.'sinonims.php'))
  1469. {
  1470. include_once($rss_plugins.'sinonims.php');
  1471. preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#i",$xfielddatavalue,$nosinonims);
  1472. foreach ($nosinonims[1] as $key =>$value){
  1473. $noss['nosinonims_'.$key] = $value;
  1474. }
  1475. if (count($noss) != '')$xfielddatavalue=strtr ($xfielddatavalue,array_flip($noss));
  1476. if (preg_match('/\[sin\]/',$xfielddatavalue)){
  1477. $xfielddatavalue =preg_replace ("#\[sin\](.+?)\[\/sin\]#ie","sinonims('\\1')",$xfielddatavalue);
  1478. }else{$xfielddatavalue = sinonims ($xfielddatavalue);}
  1479. if (count($noss) != '')$xfielddatavalue=strtr ($xfielddatavalue,$noss);
  1480. }
  1481. $xfielddatavalue = $db->safesql( $parse->BB_Parse( $parse->process( $xfielddatavalue ),false ) );
  1482. $xfielddataname = $db->safesql( $xfielddataname );
  1483. $xfielddataname = str_replace( '|','&#124;',$xfielddataname );
  1484. $xfielddataname = str_replace( "\r\n",'__NEWL__',$xfielddataname );
  1485. $xfielddatavalue = str_replace( '|','&#124;',$xfielddatavalue );
  1486. $xfielddatavalue = str_replace( "\r\n",'__NEWL__',$xfielddatavalue );
  1487. $filecontents[] = "$xfielddataname|$xfielddatavalue";
  1488. }
  1489. if (count($filecontents) != 0) $xfields = implode( '||',$filecontents );
  1490. }
  1491. else
  1492. {
  1493. $xfields = '';
  1494. }
  1495. if ($channel_info['allow_more'] == 1 or $dop_sort[12] == 1  or $dop_sort[12] == 3)
  1496. {
  1497. if ($dnast[31] == 1)$xfields .='||source_leech|'.$db->safesql( $parse->BB_Parse( $parse->process( '[leech='.$full_news_link.']'.$channel_info['title'].'[/leech]'),false ) );
  1498. $xfields .= '||source_name|'.$channel_info['title'] .'||source_link|'.$full_news_link;
  1499. }
  1500. $xfields = $filecontents = trim($xfields,'||');
  1501. $news_id = '';
  1502. $date_time = strtotime ($thistime);
  1503. if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
  1504. $word = addcslashes(stripslashes($full_news_link),'"[]!-.#?*%\\()|/');
  1505. while ( $row = $db->get_row($sql_Title) ) {
  1506. if ($dop_sort[12] == 1  or $dop_sort[12] == 3)$xfi=true;
  1507. if(preg_match('#'.$word.'#i',$row['xfields']) or !$xfi or trim($row['xfields']) == ''){
  1508. if (parse_date($thistime) >parse_date ($row['date']) or $dnast[17] == 0){
  1509. $news_id = $row['id'];
  1510. $author = $row['autor'];
  1511. }else{$rewrite = 0;}
  1512. break;
  1513. }
  1514. }
  1515. if ($rewrite == 0)continue;
  1516. }
  1517. if ($db->num_rows ($sql_Title) >0 and $rewrite == 1 and $news_id == '')continue;
  1518. if ($serv != '0'or $dop_nast[11] == 1)
  1519. {
  1520. $di_control = new image_controller ();
  1521. $di_control->post = '';
  1522. $di_control->short_story = $short_story;
  1523. $di_control->full_story = $full_story;
  1524. $di_control->proxy = $dop_nast[2];
  1525. $di_control->dubl =$dop_nast[15];
  1526. if ($dates[0] != ''and strlen($dates[0]) != 10){$di_control->post = '/'.$dates[0] ;}
  1527. if ($dates[1] == 1 or $config_rss['alt_name'] == 'yes')$di_control->dim_week = $alt_name;
  1528. $di_control->dim_date =$dates[2];
  1529. $di_control->dim_sait =$dates[3];
  1530. $di_control->dim_cat =$dates[4];
  1531. $di_control->wat_h =$dnast[15];
  1532. if (intval($dnast[37]) != 0)$di_control->max_image = $dnast[37];
  1533. else $di_control->max_image = $config['max_image'];
  1534. $di_control->max_up_side = $config['max_up_side'];
  1535. $di_control->min_image = $dnast[38];
  1536. 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]."'");
  1537. $di_control->cat = $di_control_cat ['alt_name'];
  1538. if ($channel_info['allow_watermark'] == 1)
  1539. {
  1540. $di_control->allow_watermark = true;
  1541. if ($dop_nast[0] == 1)
  1542. {
  1543. if (trim($dnast[23]) != '')$config_rss ['watermark_image_light']=$dnast[23];
  1544. if (trim($dnast[24]) != '')$config_rss['watermark_image_dark']=$dnast[24];
  1545. $di_control->watermark_image_light = ROOT_DIR .$config_rss ['watermark_image_light'];
  1546. $di_control->watermark_image_dark = ROOT_DIR .$config_rss['watermark_image_dark'];
  1547. }
  1548. }
  1549. $di_control->x = $dop_nast[3];
  1550. $di_control->y = $dop_nast[4];
  1551. $di_control->margin = $dop_nast[12];
  1552. if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
  1553. $di_control->rewrite = $rewrite;
  1554. }
  1555. if ($dop_nast[11] == 1)$di_control->shs = true;
  1556. $db->close;
  1557. $pro = $di_control->process($serv);
  1558. if (count($pro) != 0) {
  1559. $xdoe[] = implode('<br />',$pro);
  1560. }
  1561. $short_story = $di_control->short_story;
  1562. $full_story = $di_control->full_story;
  1563. if (count ($di_control->upload_images) != 0)
  1564. {
  1565. $folder_prefix = trim($di_control->post.$di_control->pap_data,'/');
  1566. $dim = '|||'.$folder_prefix.'/';
  1567. $dimage = implode ($dim,$di_control->upload_images);
  1568. $dimages .= '|||'.$db->safesql ($folder_prefix.'/'.$dimage);
  1569. }
  1570. }
  1571. $dimages = trim($dimages ,'|||');
  1572. $short_story = add_short ($short_story);
  1573. $full_story = add_full ($full_story);
  1574. $f_d = array();
  1575. $f_u = array();
  1576. $down_files1 = array();
  1577. $down_files2 = array();
  1578. $down_erors1 = array();
  1579. $down_erors2 = array();
  1580. $s_story = array();
  1581. $f_story = array();
  1582. if ($rss_files[0] == 1){$f_d['video']['pap'] = $rss_files[1];$f_d['video']['name'] = $rss_files[12].'='.$rss_files[18];}
  1583. if ($rss_files[2] == 1){$f_d['rar']['pap'] = $rss_files[3];$f_d['rar']['name'] = $rss_files[13].'='.$rss_files[19];}
  1584. if ($rss_files[4] == 1){$f_d['zip']['pap'] = $rss_files[5];$f_d['zip']['name'] = $rss_files[14].'='.$rss_files[20];}
  1585. if ($rss_files[6] == 1){$f_d['doc']['pap'] = $rss_files[7];$f_d['doc']['name'] = $rss_files[15].'='.$rss_files[21];}
  1586. if ($rss_files[8] == 1){$f_d['txt']['pap'] = $rss_files[9];$f_d['txt']['name'] = $rss_files[16].'='.$rss_files[22];}
  1587. if ($rss_files[10] == 1){$f_d['dle']['pap'] = $rss_files[11];$f_d['dle']['name'] = $rss_files[17].'='.$rss_files[23];}
  1588. if ($rss_files[26] == 1){$f_d['tor']['pap'] = $rss_files[29];$f_d['tor']['name'] = $rss_files[27].'='.$rss_files[28];}
  1589. if (count($f_d) !=0 ){
  1590. $file_down = new file_down;
  1591. $file_down->short_story = $short_story;
  1592. $file_down->full_story = $full_story;
  1593. $file_down->alt_name = $alt_name;
  1594. $file_down->torrage = $rss_files[30];
  1595. $file_down->file_process($f_d);
  1596. $short_story = $file_down->short_story;
  1597. $full_story = $file_down->full_story;
  1598. $down_files1 = $file_down->down_files;
  1599. $down_erors1 = $file_down->eror;
  1600. }
  1601. $s_story = relace_news_don ($short_story,$alt_name,$rss_files[30]);
  1602. $f_story = relace_news_don ($full_story,$alt_name,$rss_files[30]);
  1603. $short_story = $s_story['story'];
  1604. $full_story = $f_story['story'];
  1605. $down_files2 = array_merge ($s_story['files'],$f_story['files']);
  1606. $down_erors2 = array_merge ($s_story['erors'],$f_story['erors']);
  1607. $down_files = array_diff(array_merge ($down_files1,$down_files2),array(''));
  1608. $down_erors = array_diff(array_merge ($down_erors1,$down_erors2),array(''));
  1609. if (count($down_erors)!=0)$xdoe_files[] = implode('<br />',$down_erors);
  1610. echo "
  1611.        <div id=\"progressbar\"></div>
  1612.  
  1613.        <script>
  1614. storyes($di, $n, '$title' );
  1615.    </script>";
  1616. ob_flush();
  1617. flush();
  1618. if (@file_exists ($rss_plugins.'sinonims.php') )
  1619. {
  1620. include_once($rss_plugins.'sinonims.php');
  1621. preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#is",$short_story,$nosinonimsshort_story);
  1622. foreach ($nosinonimsshort_story[1] as $key =>$value){
  1623. $nossshort_story['nosinonims_'.$key] = $value;
  1624. }
  1625. if (count($nossshort_story) != '')$short_story=strtr ($short_story,array_flip($nossshort_story));
  1626. if (preg_match('/\[sin\]/',$short_story)){
  1627. $short_story =preg_replace ("#\[sin\](.+?)\[\/sin\]#ise","sinonims('\\1')",$short_story);
  1628. }else{
  1629. if ($dop_sort[3] == 1 and $sinonims_val == 1 and ($dop_sort[19] == 0 or $dop_sort[19] == 1 ))$short_story = sinonims ($short_story);
  1630. }
  1631. if (count($nossshort_story) != '')$short_story=strtr ($short_story,$nossshort_story);
  1632. preg_match_all ("#\[nosin\](.+?)\[\/nosin\]#is",$full_story,$nosinonimsfull_story);
  1633. foreach ($nosinonimsfull_story[1] as $key =>$value){
  1634. $nossfull_story['nosinonims_'.$key] = $value;
  1635. }
  1636. if (count($nossfull_story) != '')$full_story=strtr ($full_story,array_flip($nossfull_story));
  1637. if (preg_match('/\[sin\]/',$full_story)){
  1638. $full_story =preg_replace ("#\[sin\](.+?)\[\/sin\]#ise","sinonims('\\1')",$full_story);
  1639. }else{
  1640. if ($dop_sort[3] == 1 and $sinonims_val == 1 and ($dop_sort[19] == 0 or $dop_sort[19] == 2 ))$full_story = sinonims ($full_story);
  1641. }
  1642. if (count($nossfull_story) != '')$full_story=strtr ($full_story,$nossfull_story);
  1643. }
  1644. if ($dop_sort[17] == 1 or intval($dop_sort[20]) == 1 or trim($full_story) != ''){
  1645. if ((trim($short_story) != ''or $dop_sort[0] == 1) and trim($title) != '') {
  1646. $short_story=strtr($short_story,array('[sin]'=>'','[/sin]'=>'','[nosin]'=>'','[/nosin]'=>'','biggrab '=>''));
  1647. $full_story =strtr($full_story,array('[sin]'=>'','[/sin]'=>'','[nosin]'=>'','[/nosin]'=>'','biggrab '=>''));
  1648. $title = stripslashes($title);
  1649. $short_story = stripslashes($short_story);
  1650. $full_story = stripslashes($full_story);
  1651. $title = $db->safesql($parse->process($title));
  1652. if (count($down_files) != 0)
  1653. {
  1654. if(@file_exists(ENGINE_DIR .'/inc/xbt.php'))preg_match("#version.*['\"](.*)['\"]#i",@file_get_contents(ENGINE_DIR .'/inc/xbt.php'),$ver_xbt);
  1655. foreach ($down_files as $name=>$image_name)
  1656. {
  1657. $id = '';
  1658. $word = addcslashes(stripslashes(($config_rss['http_url'] != ''?$config_rss['http_url']:$config['http_home_url']).'uploads/files/'.$image_name),'"[]!-.#?*%\\()|/');
  1659. if(substr($image_name,-8) == '.torrent'and @file_exists(ENGINE_DIR.'/modules/tracker/upload.php'))
  1660. {
  1661. if ($config_rss['xbt'] == 'no')
  1662. {
  1663. $short_story = preg_replace("#\[(url|leech)=".$word."\].*\[\/(url|leech)\]#iUs",'',$short_story);
  1664. $full_story = preg_replace("#\[(url|leech)=".$word."\].*\[\/(url|leech)\]#iUs",'',$full_story);
  1665. }
  1666. if($ver_xbt[1]=='2.6')$db->query( 'DELETE FROM '.PREFIX ."_files WHERE name='torrent.deleted'");
  1667. define('STANDART_UPL',true);
  1668. include ENGINE_DIR.'/modules/tracker/upload.php';
  1669. }else {
  1670. $tr_fild = $tr_info = '';
  1671. $onserver = $image_name;
  1672. }
  1673. if($ver_xbt[1]!='2.6'){
  1674. $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
  1675. $db->query( 'INSERT INTO '.PREFIX ."_files (news_id, name, onserver, author, date{$tr_fild}) values ('0', '$name', '$onserver', '$author', '$date_time'{$tr_info})");
  1676. $id = $db->insert_id();
  1677. }
  1678. if ($rss_files[25] != '')$name = ':'.$rss_files[25];
  1679. else $name = '';
  1680. $name = str_replace('{zagolovok}',$title,$name);
  1681. if($_GET['x'] == 1){
  1682. echo $onserver.'<br>';
  1683. echo '<textarea style="width:100%;height:240px;">'.@htmlspecialchars( $full_story,ENT_QUOTES ).'</textarea><br>';
  1684. }
  1685. if($rss_files[24] == 1 or $config_rss['xbt'] == 'yes')
  1686. {
  1687. $short_story = preg_replace("#\[(url|leech)=".$word."\].*?\[\/(url|leech)\]#is","[attachment=$id$name]",$short_story);
  1688. $full_story =preg_replace ("#\[(url|leech)=".$word."\].*?\[\/(url|leech)\]#is","[attachment=$id$name]",$full_story);
  1689. $full_story =str_replace ('[url='.stripslashes($word).']',"[attachment=$id$name]",$full_story);
  1690. }
  1691. }
  1692. }
  1693. if($dnast[40] == 1 and $dimages != ''){
  1694. $rss_archive = 0;
  1695. require_once $rss_plugins.'pclzip.php';
  1696. $ar_file = 'uploads/files/'.$alt_name.'_img.zip';
  1697. $ar_mages= 'uploads/posts/'.str_replace('|||',',uploads/posts/',$dimages);
  1698. classCreator::createPclZip();
  1699. $ar_archive = new PclZip($ar_file);
  1700. $ar_list = $ar_archive->create($ar_mages,PCLZIP_OPT_REMOVE_ALL_PATH);
  1701. if ($ar_list != 0){
  1702. $db->query( 'INSERT INTO '.PREFIX ."_files (news_id, name, onserver, author, date) values ('0', '".basename($ar_file)."', '".basename($ar_file)."', '$author', '$date_time')");
  1703. $rss_archive = $db->insert_id();
  1704. @rename (ROOT_DIR.'/'.$ar_file,ROOT_DIR.'/uploads/files/'.$rss_archive.'.zip');
  1705. $db->query('UPDATE '.PREFIX."_files set onserver='".$rss_archive.".zip' WHERE id='$rss_archive'");
  1706. if($rss_files[24] == 1){
  1707. if ($rss_files[25] != '')$name = ':'.$rss_files[25];
  1708. else $name = '{zagolovok}';
  1709. $full_story = $full_story."<br /><br />[attachment=$rss_archive$name]";
  1710. }else{
  1711. if ($rss_files[25] != '')$name = $rss_files[25];
  1712. else $name = '';
  1713. $full_story = $full_story.'<br /><br />[url='.$ar_file.']'.$name.'[/url]';
  1714. }
  1715. $full_story = str_replace('{zagolovok}',$title,$full_story);
  1716. }
  1717. }
  1718. if($_GET['x'] == 1){
  1719. echo stripslashes($word).'<br>';
  1720. echo '<textarea style="width:100%;height:240px;">'.@htmlspecialchars( $full_story,ENT_QUOTES ).'</textarea><br>';
  1721. }
  1722. $key_iframe = array_search('iframe',$parse->tagBlacklist);
  1723. unset ($parse->tagBlacklist[$key_iframe]);
  1724. $key_script = array_search('script',$parse->tagBlacklist);
  1725. unset ($parse->tagBlacklist[$key_script]);
  1726. if (($config_rss['create_images'] == 1 or $config_rss['create_images'] == 3) and intval( $config_rss['maxWidth'] ) !='0'){
  1727. $short_story = $db->safesql($parse->BB_Parse(create_images($parse->process($short_story) ,$title) ,false));
  1728. }else{
  1729. $short_story = $db->safesql($parse->BB_Parse($parse->process($short_story) ,false));
  1730. }
  1731. if (($config_rss['create_images'] == 2 or $config_rss['create_images'] == 3) and intval( $config_rss['maxWidth'] ) !='0'){
  1732. $full_story = $db->safesql($parse->BB_Parse(create_images($parse->process($full_story) ,$title) ,false));
  1733. }else{
  1734. $full_story = $db->safesql($parse->BB_Parse($parse->process($full_story) ,false));
  1735. }
  1736. $news_read = rand(intval($config_rss['rate_start']),intval($config_rss['rate_finish']));
  1737. if($allow_rate == 1){$vote_num = rand(0,$news_read);
  1738. $rating = rand($vote_num*(intval($config_rss['rate_bal'])-2),$vote_num*intval($config_rss['rate_bal']));
  1739. }
  1740. $rating = intval ($rating);
  1741. $short_story = unhtmlentities(str_replace ('%20',' ',str_replace ('&#111;','o',$short_story ) ));
  1742. $full_story = unhtmlentities(str_replace ('%20',' ',str_replace ('&#111;','o',$full_story ) ));
  1743. $safet = $parse->decodeBBCodes($_POST['title']);
  1744. $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
  1745. $full_story = preg_replace ("#<script(.+?)>(.+?)<\/script>#ies","script_br('\\1','\\2')",$full_story);
  1746. if ($db->num_rows ($sql_Title) >0 and $rewrite == 1){
  1747. if ($config['version_id'] >='7.2')$tes = ", tags='".$db->safesql($tegs)."'";
  1748. if ($config['version_id'] >'8.0')$fgs = ", metatitle='$meta_title', symbol='$catalog_url'";
  1749. if ($dnast[29] == 1)$shfu_re = "short_story='$short_story'";
  1750. elseif ($dnast[29] == 2)$shfu_re = "full_story='$full_story'";
  1751. else $shfu_re = "short_story='$short_story', full_story='$full_story'";
  1752. $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'");
  1753. $db->query ('UPDATE '.PREFIX ."_users SET lastdate = '$date_time' WHERE name ='$author'");
  1754. $db->query('UPDATE '.PREFIX ."_images SET images='$dimages', date='$date_time' WHERE news_id ='$news_id'");
  1755. }else{
  1756. if ($config['version_id'] >='7.2'){$te =", '".$db->safesql($tegs)."'";$tes = ', tags';}
  1757. if ($config['version_id'] >'8.0'){$fgrs = ", '$meta_title', '$catalog_url'";$fgs = ', metatitle, symbol';}
  1758. if ($config['version_id'] <'9.6'){
  1759. $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)");
  1760. $news_id = $db->insert_id();
  1761. }else{
  1762. $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)");
  1763. $news_id = $row = $db->insert_id();
  1764. $author_id = $db->super_query ('SELECT * FROM '.PREFIX ."_users WHERE name ='$author'");
  1765. $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']}')");
  1766. }
  1767. if( $approve == '1'and $crosspost_val == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php')) {
  1768. $_POST['crosspost_approve'] = true;
  1769. include ENGINE_DIR .'/inc/crosspost.addnews.php';
  1770. }
  1771. if($approve == '1'and $twitter_val == 1 and @file_exists(ENGINE_DIR.'/modules/twitter.php')) include ENGINE_DIR.'/modules/twitter.php';
  1772. $db->query ('UPDATE '.PREFIX ."_users SET news_num = news_num + 1, lastdate = '$date_time' WHERE name ='$author'");
  1773. }
  1774. $xdoe_channel[] = $news_id;
  1775. $nn++;
  1776. $safeT[] = '<b>'.$nn.'</b> . <b style="color:green;">'.$tit.'</b> &#x25ba; <a class="list" href="index.php?newsid='.$news_id.'" target="_blank"><b style="color:blue;">'.$safet.'</b></a> '.$ping_msg ;
  1777. if ($tegs != ''and $db->num_rows ($sql_Title) == 0) {
  1778. $tags = array();
  1779. $tegs = explode (',',$tegs);
  1780. $res = $db->super_query('SELECT * FROM '.PREFIX.'_tags LIMIT 1');
  1781. foreach ($tegs as $value) {
  1782. if (isset($res['alt_tag'])){
  1783. if (trim($value) != '') $tags[] = "('$news_id', '".$db->safesql(trim($value))."', '".$db->safesql(trim(totranslit($value)))."')";
  1784. }else{
  1785. if (trim($value) != '') $tags[] = "('$news_id', '".$db->safesql(trim($value))."')";
  1786. }
  1787. }
  1788. $tags = implode(', ',$tags);
  1789. if (isset($res['alt_tag']))$db->query('INSERT INTO '.PREFIX.'_tags (news_id, tag, alt_tag) VALUES '.$tags);
  1790. else $db->query('INSERT INTO '.PREFIX.'_tags (news_id, tag) VALUES '.$tags);
  1791. }
  1792. if (trim ($dimages) != ''and ($db->num_rows ($sql_Title) == 0 or $dop_sort[12] == 0))
  1793. {
  1794. $db->query('INSERT INTO '.PREFIX ."_images (images, news_id, author, date) VALUES   ('$dimages', '$news_id', '$author', '$date_time')");
  1795. }
  1796. $db->close;
  1797. $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
  1798. if (count($down_files) != 0 or $rss_archive != 0)
  1799. {
  1800. $db->query('UPDATE '.PREFIX."_files set news_id = '$news_id', author = '$author' WHERE news_id='0'");
  1801. }
  1802. if (intval($dnast[10]) != 0){
  1803. if ($expires != ''){$datede = strtotime ($expires);}else
  1804. {$datede = strtotime ($thistime) +$dnast[10] * 86400;}
  1805. $db->query( 'INSERT INTO '.PREFIX ."_post_log (news_id, expires, action) VALUES('$news_id', '$datede', '{$dnast[11]}')");
  1806. }
  1807. if($twitter_val == 1 and @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')) include ENGINE_DIR.'/modules/socialposting/posting.php';
  1808. if (sizeof($xdoe) or sizeof($xdoe_files)){
  1809. 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 />';
  1810. }else{
  1811. echo $nn.'. <a class="list" href="index.php?newsid='.$news_id.'" target="_blank"><b style="color:blue;">'.$safet.'</b></a> '.$ping_msg.'<br>';
  1812. }
  1813. if($cp_output != '')echo $cp_output.'<br>';
  1814. ob_flush();
  1815. flush();
  1816. }}}}}}
  1817. echo ((sizeof($xdoe_channel))?'':'<b style="color:red;">'.$lang_grabber['post_msg_no'].'</b><br /><br />');
  1818. }
  1819. $db->close;
  1820. if( $approve == '1'and $dop_sort[4] == 1 and @file_exists($rss_plugins.'ping/pingsite.txt')) {
  1821. $rss_lenta = new image_controller ();
  1822. $rss_lenta->download_host ($config['http_home_url'].'engine/ajax/rss_lenta.php','nn='.$nn);
  1823. include ( $rss_plugins.'ping/grabberping.php');
  1824. }
  1825. if($config_rss['sitemap'] == 'yes'and @file_exists($rss_plugins.'ping/sitemap.php')) {
  1826. include ( $rss_plugins.'ping/sitemap.php');
  1827. }
  1828. echo '<br /><a class=main href="'.$PHP_SELF .'?mod=rss">'.$lang_grabber['back'].'</a><br /><br /></center>';
  1829. closetable ();
  1830. echofooter ();
  1831. $db->free();
  1832. $db->close;
  1833. clear_cache ();
  1834. }else{
  1835. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  1836. }
  1837. return 1;
  1838. }
  1839. if (preg_match('/scan/i',$action))
  1840. {
  1841. $channel = $_POST['channel'];
  1842. $_POST['str_url'] = array_diff($_POST['str_url'],array(''));
  1843. $count_str_url = count($_POST['str_url']);
  1844. if ($count_str_url >'0'){
  1845. $_POST['str_news']=1;
  1846. $_POST['str_newf']=$count_str_url;
  1847. if (count ($channel) == 0)
  1848. {
  1849. $ur_keys=array();
  1850. foreach ($_POST['str_url'] as $ur_key)
  1851. {
  1852. $U = get_urls(trim($ur_key));
  1853. if (!in_array ($ur_keys,$sql_u['id']))$ur_keys[] = $U;
  1854. else continue;
  1855. $sql_u = $db->super_query  ('SELECT id FROM '.PREFIX ."_rss WHERE url like '%".$db->safesql ($U['host'])."%'");
  1856. if ($sql_u['id'] != ''and !in_array ($channel,$sql_u['id']))$channel[]=$sql_u['id'];
  1857. }
  1858. }
  1859. }
  1860. if (intval($_POST['str_news']) != 0){define('Y_GRAB_LIMIT',intval($_POST['str_news'])-1);
  1861. }else{define('Y_GRAB_LIMIT',0);}
  1862. if (intval($_POST['str_newf']) != 0)define('X_GRAB_LIMIT',intval($_POST['str_newf']));
  1863. else define('X_GRAB_LIMIT',strlen($action)>4?str_replace('scan','',$action):false);
  1864. if (count ($channel) == 0)
  1865. {
  1866. if ($count_str_url == '0')msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  1867. else msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['no_grab_url'],'javascript:history.go(-1)');
  1868. return 1;
  1869. }
  1870. $channel_list = @implode (',',$channel);
  1871. $rss_parser = new rss_parser ();
  1872. $sql = $db->query  ('SELECT * FROM '.PREFIX .('_rss WHERE id IN ('.$channel_list .') ORDER BY xpos,title ASC'));
  1873. $db->close;
  1874. $news_count = 1;
  1875. echoheader ('','');
  1876. echo '<form method=post name="news_form" id="news_form">';
  1877. if ($config_rss['button_nw'] == 'yes') $button_nw = '<button align="right" type="submit" class="btn" id="checkss" disabled> - '.$lang_grabber['no_news_selected'].' - </button>';
  1878. opentable ($lang_grabber['grab_msg'],$button_nw);
  1879. if ($config_rss['get_proxy'] == 'yes') get_proxy();
  1880. $config_rss['get_prox'] = $tab_id;
  1881. echo $bb_js."<script type=\"text/javascript\">
  1882. var sin_open = 0;
  1883. var nosin_open = 0;
  1884.    function find_relates ( id )
  1885.    {
  1886.        var ajax = new dle_ajax();
  1887.        ajax.onShow ('');
  1888.        var title = ajax.encodeVAR( document.getElementById('title_' + id).value);
  1889.        var varsString = 'title=' + title;
  1890.        ajax.requestFile ='engine/ajax/find_relates.php';
  1891.        ajax.element = 'related_news' + id;
  1892.        ajax.sendAJAX(varsString);
  1893. return false;
  1894.    }
  1895.  
  1896.    function start_sinonims (key, id )
  1897.    {
  1898.        var ajax = new dle_ajax();
  1899.        ajax.onShow ('');
  1900. if (key == 1)var title = ajax.encodeVAR( document.getElementById('short_' + id).value);
  1901. else var title = ajax.encodeVAR( document.getElementById('full' + id).value);
  1902.  
  1903.        var varsString = 'story=' + title;
  1904.        ajax.setVar(\"id\", id);
  1905.        ajax.setVar(\"key\", key);
  1906.        ajax.requestFile ='engine/ajax/start_sinonims.php';
  1907.  
  1908.        if (key == 1)ajax.element = 'sinonim_short' + id;
  1909. else ajax.element = 'sinonim_full' + id;
  1910.        ajax.method = 'POST';
  1911.        ajax.sendAJAX(varsString);
  1912. return false;
  1913.    }
  1914.  
  1915.    function auto_keywords ( key, id )
  1916.    {
  1917.        var ajax = new dle_ajax();
  1918.        ajax.onShow ('');
  1919.  
  1920.        var wysiwyg = '{$config['allow_admin_wysiwyg']}';
  1921.  
  1922.            var short_txt = ajax.encodeVAR( document.getElementById('short_' + id).value );
  1923.            var varsString = \"short_txt=\" + short_txt;
  1924.            ajax.setVar(\"full_txt\", ajax.encodeVAR( document.getElementById('full' + id).value ));
  1925.  
  1926.        ajax.setVar(\"key\", key);
  1927.        ajax.requestFile = \"engine/ajax/keywords.php\";
  1928.  
  1929.        if (key == 1) { ajax.element = 'autodescr' + id; }
  1930.        else { ajax.element = 'keywords' + id;}
  1931.  
  1932.        ajax.method = 'POST';
  1933.        ajax.sendAJAX(varsString);
  1934.  
  1935.        return false;
  1936.    };
  1937.  
  1938. </script>
  1939.  
  1940. ";
  1941. echo '
  1942.  
  1943.    
  1944. <input type="hidden" name="action" value="doaddnews" />
  1945. <div style="padding-top:5px;padding-bottom:2px;">
  1946. <table width="100%">
  1947.    <tr>
  1948.        <td style="padding:5px;" bgcolor="#FFFFFF">
  1949.    <script>
  1950.        var form = document.getElementById(\'news_form\');
  1951.  
  1952.        // ---------------------------------
  1953.        //  Check column
  1954.        // ---------------------------------
  1955.        function check_all ( permtype , master_box) {
  1956.        var ajax = new dle_ajax();
  1957.        ajax.onShow (\'\');
  1958.        var checkboxes = form.getElementsByTagName(\'input\');
  1959.        for (var i = 0; i < checkboxes.length; i++)
  1960.        {
  1961.            var element = checkboxes[i];
  1962.            if ( element && (element.id != \'mod\') && (element.id != \'main\') && (element.id != \'comm\') ) {
  1963.            var element_id = element.id;
  1964.            var a = element_id.replace( /^(.+?)_.+?$/, "$1" );
  1965.            if (a == permtype)
  1966.            {
  1967.             element.checked = master_box;
  1968.            }
  1969.            }
  1970.        }
  1971. ajax.onHide (\'\');
  1972.        return false;
  1973.        }
  1974.        // ---------------------------------
  1975.        //  Check all categories
  1976.        // ---------------------------------
  1977.        function check_cat() {
  1978.         var select_list = form.getElementsByTagName(\'select\');
  1979.         var value      = form.category.value;
  1980.         for (var i = 0; i < select_list.length; i++)
  1981.         {
  1982.            var element = select_list[i];
  1983.            element.value = value;
  1984.         }
  1985.         return false;
  1986.        }
  1987.  
  1988. function checkAll(field){
  1989.  nb_checked=0;
  1990.  for(n=0;n<field.length;n++)
  1991.    if(field[n].checked)nb_checked++;
  1992.    if(nb_checked==field.length){
  1993.      for(j=0;j<field.length;j++){
  1994.        field[j].checked=!field[j].checked;
  1995.        field[j].parentNode.parentNode.style.backgroundColor
  1996.          =field[j].backgroundColor==\'\'?\'#E8F9E6\':\'\';
  1997.      }
  1998.    }else{
  1999.      for(j=0;j<field.length;j++){
  2000.        field[j].checked = true;
  2001.        field[j].parentNode.parentNode.style.backgroundColor
  2002.          =\'#E8F9E6\';
  2003.      }document.news_form.select_all.checked=true;
  2004.    }
  2005. }
  2006.  
  2007. function selectRow(evnt,elmnt){
  2008.  var ch=elmnt.getElementsByTagName("TD")[10].firstChild;
  2009.  tg = document.all?evnt.srcElement:evnt.target;
  2010.  //if(tg.tagName!=\'INPUT\')ch.checked=!ch.checked;
  2011.  elmnt.style.backgroundColor=ch.checked?\'#E8F9E6\':\'\';
  2012. }
  2013.  
  2014.    function preview( id )
  2015.    {
  2016.        dd=window.open(\'\',\'prv\',\'height=400,width=750,resizable=1,scrollbars=1\');
  2017.        document.addnews.target=\'prv\';
  2018.        document.addnews.title.value = document.getElementById(\'title_\' + id).value;
  2019.        document.addnews.short_story.value = document.getElementById(\'short_\' + id).value;
  2020.        if (document.getElementById(\'full\' + id)) {
  2021.        document.addnews.full_story.value = document.getElementById(\'full\' + id).value;
  2022.        } else {
  2023.        document.addnews.full_story.value = "";
  2024.        }
  2025.        document.addnews.allow_br.value = 1;
  2026.        document.addnews.submit();
  2027.    }
  2028. function ShowOrHideEx(id, show) {
  2029.    var item = null;
  2030.    if (document.getElementById) {
  2031.        item = document.getElementById(id);
  2032.    } else if (document.all) {
  2033.        item = document.all[id];
  2034.    } else if (document.layers){
  2035.        item = document.layers[id];
  2036.    }
  2037.    if (item && item.style) {
  2038.        item.style.display = show ? "" : "none";
  2039.    }
  2040.    }
  2041.    function xfInsertText(text, element_id) {
  2042.    var item = null;
  2043.    if (document.getElementById) {
  2044.        item = document.getElementById(element_id);
  2045.    } else if (document.all) {
  2046.        item = document.all[element_id];
  2047.    } else if (document.layers){
  2048.        item = document.layers[element_id];
  2049.    }
  2050.    if (item) {
  2051.        item.focus();
  2052.        item.value = item.value + " " + text;
  2053.        item.focus();
  2054.    }
  2055.    }
  2056.  
  2057.    </script>
  2058. <link rel="stylesheet" type="text/css" media="all" href="engine/skins/calendar-blue.css" title="win2k-cold-1" />
  2059. <script type="text/javascript" src="engine/skins/calendar.js"></script>
  2060. <script type="text/javascript" src="engine/skins/calendar-en.js"></script>
  2061. <script type="text/javascript" src="engine/skins/calendar-setup.js"></script>
  2062. ';
  2063. echo "
  2064. <script>
  2065.  $(document).ready(function(e){
  2066.  
  2067.  $('#news_form').submit(function() {
  2068.    $(this).ajaxSubmit(options);
  2069.    // !!! Важно !!!
  2070.    // всегда возвращаем false, чтобы предупредить стандартные
  2071.    // действия браузера (переход на страницу form.php)
  2072.    return false;
  2073.  });
  2074.  
  2075.    function countChecked() {
  2076.      var n = $(\".sel:checked\").length;
  2077.      $(\"#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']."\")));
  2078. $('button').attr('disabled', n == 0 ? true : false);
  2079. if (n ==0 ){
  2080.     $(\"#checks\").toggleClass('btn-danger', true);
  2081.     $(\"#checks\").toggleClass('btn-success', false);
  2082.     }else{
  2083. $(\"#checks\").toggleClass('btn-danger',false);
  2084. $(\"#checks\").toggleClass('btn-success', true);
  2085. }
  2086.    }
  2087.    countChecked();
  2088.    $(\":checkbox\").click(countChecked);
  2089.  
  2090.    function countCheckeds() {
  2091.      var n = $(\".sel:checked\").length;
  2092.      $(\"#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']."\")));
  2093. $('button').attr('disabled', n == 0 ? true : false);
  2094. if (n ==0 ){
  2095.     $(\"#checkss\").toggleClass('btn-danger', true);
  2096.     $(\"#checkss\").toggleClass('btn-success', false);
  2097.     }else{
  2098. $(\"#checkss\").toggleClass('btn-danger',false);
  2099. $(\"#checkss\").toggleClass('btn-success', true);
  2100. }
  2101.    }
  2102.  
  2103.    countCheckeds();
  2104.    $(\":checkbox\").click(countCheckeds);
  2105.  
  2106.  });
  2107.  
  2108. function ShowOrHideg( id ) {
  2109.      var item = document.getElementById(id);
  2110.      if ( document.getElementById('image-'+ id) ) {
  2111.        var image = document.getElementById('image-'+ id);
  2112.      } else {
  2113.        var image = null;
  2114.      }
  2115.      if (!item) {
  2116.        retun;
  2117.      }  else {
  2118.        if (item.style) {
  2119.            if (item.style.display == \"none\") {
  2120.                item.style.display = \"\";
  2121.                image.src = './engine/inc/plugins/images/minus.gif';
  2122.            } else {
  2123.                item.style.display = \"none\";
  2124.                image.src = './engine/inc/plugins/images/plus.gif';
  2125.            }
  2126.         } else{ item.visibility = \"show\"; }
  2127.      }
  2128. };
  2129. </script>
  2130. ";
  2131. include ($rss_plugins.'inserttag.php');
  2132. echo $bb_js;
  2133. while ($row = $db->get_row ($sql))
  2134. {
  2135. $str_urls = array();
  2136. $i = 1;
  2137. $end_title = explode ('==',$row['end_title']);
  2138. $dop_sort = explode ('=',$row['short_story']);
  2139. $dop_nast = explode ('=',$row['dop_nast']);
  2140. $ctp = explode ('=',$row['ctp']);
  2141. $start_template = stripslashes ($row['start_template']);
  2142. $finish_template = explode ('|||',stripslashes ($row['finish_template']));
  2143. $dnast = explode ('=',$row['dnast']);
  2144. $sart_cat = explode('|||',$row['sart_cat']);
  2145. $cookies = str_replace('|||','; ',str_replace("\r",'',stripslashes(rtrim($row['cookies']))));
  2146. $allow_mod = ($row['allow_mod'] == 0 ?'checked': '');
  2147. $allow_main = ($row['allow_main'] == 1 ?'checked': '');
  2148. $allow_comm = ($row['allow_comm'] == 1 ?'checked': '');
  2149. $channel_id = $row['id'];
  2150. $hide_leech = explode('=',$row['end_short']);
  2151. $rewrite = ($hide_leech[3] == 1 ?'checked': '');
  2152. $met = ($dnast[9] == 1 ?'checked': '');
  2153. $config_rss['convert'] = (intval($dnast[32]) == 1 ?'yes': 'no');
  2154. $rss = $row['rss'];
  2155. $charsets = '';
  2156. $leech_shab = $dnast[25];
  2157. if (trim($dop_nast[14]) != ''or $dop_nast[14] != '0')$charsets = explode('/',$dop_nast[14]);
  2158. if (count ($ctp) == 0 and $rss == 1){$ctp[0] = 0;$ctp[1] = 0;}
  2159. if ($_POST['str_kans'] and $_POST['str_kanf'] and $rss != 1){
  2160. $ctp[0] = $_POST['str_kans'];
  2161. $ctp[1] = $_POST['str_kanf'];
  2162. }
  2163. $URL = get_urls(trim($row['url']));
  2164. if ($count_str_url >'0'){
  2165. foreach ($_POST['str_url'] as $kk=>$str_url){
  2166. if ($str_url ==''){unset ($_POST['str_url'][$kk]);continue;}
  2167. if (preg_match ('#'.str_replace('www.','','http://'.$URL['host']).'#i',str_replace('www.','',$str_url)))
  2168. {if (!(in_array ($str_url,$str_urls)))$str_urls[] = $str_url;
  2169. unset ($_POST['str_url'][$kk]);
  2170. }
  2171. }
  2172. $_POST['str_newf'] = count ($str_urls);
  2173. }
  2174. 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>';
  2175. echo '  <input type="hidden" name="channels[]" value="'.$channel_id .'" />
  2176.    <fieldset style="border:1px dashed #c4c4c4;">
  2177.    <legend><font color="#C0C0C0">&#8470;'.$row['xpos'].' - </font>'.$row['title'].'<br /><a href="http://'.$URL['host'].'" target="_blank"><font color="blue">http://'.$URL['host'].'</font></a>'.$text_str.'</legend>'.'';
  2178. $cron_job = ENGINE_DIR.'/cache/cron_job.txt';
  2179. if (@file_exists($cron_job))
  2180. {
  2181. $job = file($cron_job);
  2182. if ($job[0] == $row['id'])
  2183. {
  2184. $lang_grabber['no_news'] = $lang_grabber['job_on_cron'];
  2185. echo '
  2186.    <table cellpadding="4" cellspacing="0">
  2187.    <tr><td class="navigation" style="padding:4px">
  2188.     <b>'.$lang_grabber['job_on_cron'].'</b>
  2189.    </td></tr>
  2190.    </table>
  2191.    </fieldset>';
  2192. continue;
  2193. }
  2194. }
  2195. $news_per_channel = 1;
  2196. if ($ctp[1] >0 and intval($ctp[0]) == 0 ) $ctp[0] = '1';
  2197. for ($cv=$ctp[0];$cv<=$ctp[1];$cv++)
  2198. {
  2199. if (intval($dop_nast[20]) != '0'and intval($dop_nast[20]) != '1'){
  2200. if (intval($dop_nast[25]) == 0)$dop_nast[25] = '1';
  2201. $cvp = abs($cv * $dop_nast[20] -($dop_nast[20] -intval($dop_nast[25])));
  2202. }else{$cvp = abs($cv);}
  2203. if (count ($str_urls) == '0')
  2204. {
  2205. if ($cvp != 0 and $rss == 0)
  2206. {
  2207. if ($row['full_link'] == ''){
  2208. $rows = $row['url'].'/page/'.$cvp.'/';
  2209. }else {
  2210. $rows = str_replace ('{num}',$cvp,$row['full_link']);
  2211. }
  2212. if ($cvp == 0 or $cvp == 1 ) $pg = $lang_grabber['pst_st'];else $pg = $lang_grabber['pst'].$cvp;
  2213. echo '<table width="100%">
  2214. <tr>
  2215.        <td ><a href="'.$rows.'" target="_blank"><b><font color="orange">'.$pg.'</font></b></a></td>
  2216. </tr>
  2217. </table>';
  2218. $URL = get_urls(trim($rows));
  2219. }
  2220. if ($rss == 1){
  2221. $rss_parser->default_cp = $dop_nast[14];
  2222. $rss_result = $rss_parser->Get ($row['url'],$dop_nast[2]);
  2223. }else{
  2224. $URLitems = get_full ($URL[scheme],$URL['host'],$URL['path'],$URL['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
  2225. if (trim($dop_nast[14]) == ''or $dop_nast[14] == '0')$chariks = charset($URLitems);else $chariks = $charsets[0];
  2226. if ($row['ful_start'] != ''){
  2227. $row_ful_start = explode("\r\n",$row['ful_start']);
  2228. if ($row_ful_start[1] != ''){$URLitems = get_page ($URLitems,$row_ful_start[1]);
  2229. $URLitems = $URLitems[0];
  2230. }
  2231. $rss_result = get_page ($URLitems,$row_ful_start[0]);
  2232. }else{
  2233. $rss_result = get_dle($URLitems);
  2234. }
  2235. }
  2236. $time_stamp = time () +$config['date_adjust'] * 60;
  2237. $time = date ('Y-m-d H:i:s',$time_stamp);
  2238. }else {$rss_result = $str_urls;$rss = 0;}
  2239. if ($rss_result)
  2240. {
  2241. if ($rss == 1){
  2242. if (X_GRAB_LIMIT) {
  2243. if ($rss_result['items_count'] >X_GRAB_LIMIT) $grab_lis = X_GRAB_LIMIT -$rss_result['items_count'];
  2244. else $grab_lis = X_GRAB_LIMIT;
  2245. $rss_result['items'] = array_slice($rss_result['items'],Y_GRAB_LIMIT,$grab_lis);
  2246. }
  2247. $rss_result = $rss_result['items'];
  2248. }else{
  2249. if (X_GRAB_LIMIT&&count($rss_result)>X_GRAB_LIMIT) {
  2250. if (count($rss_result) >X_GRAB_LIMIT) $grab_lis = X_GRAB_LIMIT -count($rss_result);
  2251. else $grab_lis = X_GRAB_LIMIT;
  2252. $rss_result = array_slice($rss_result,Y_GRAB_LIMIT,$grab_lis);
  2253. }
  2254. }
  2255. $news_str_channel = 1;
  2256. $result = count($rss_result);
  2257. echo ' <input type="hidden" name="news-per-result-'.$channel_id .'"   value="'.$result.'" />';
  2258. if($config_rss['reverse'] == 'no')$rss_result = array_reverse($rss_result,true);
  2259. foreach ($rss_result as $skey=>$item)
  2260. {
  2261. echo ' <input type="hidden" name="news-result" value="1" />';
  2262. $skey = $skey +1;
  2263. $tags_tmp = '';
  2264. $charik = '';
  2265. if (intval($dop_nast[19]) != 0)sleep ($dop_nast[19]);
  2266. unset ($news_link);
  2267. unset ($news_tit);
  2268. unset ($short_story);
  2269. unset ($full_story);
  2270. unset ($xfields_array);
  2271. if (count($str_urls) == '0')
  2272. {
  2273. if ($rss == 1){
  2274. $news_tit = rss_strip ($item['title']);
  2275. $short_story = rss_strip($item['description']);
  2276. $news_link = stripslashes (rss_strip($item['link']));
  2277. $tags_tmp = rss_strip ($item['category']);
  2278. }else{
  2279. if ($chariks != strtolower($config['charset']) AND $item!= '') $item = convert($chariks,strtolower($config['charset']),$item);
  2280. if (trim($row['start_title']) != ''and $dnast[22] != 1)$news_tit = strip_tags_smart(get_full_news($item,$row['start_title']));
  2281. if ($row['end_link'] != 1){
  2282. $short_story = rss_strip (get_short_news ($item,$row['start_short']));
  2283. }else{
  2284. $short_story = rss_strip (get_full_news ($item,$row['start_short']));
  2285. }
  2286. if (trim($row['sart_link'])==''){
  2287. $tu_link = get_link ($item);
  2288. $news_link = 'http://'.$URL['host'].'/index.php?newsid='.$tu_link;
  2289. }else{
  2290. $news_lin = get_full_news($item,$row['sart_link']);
  2291. $news_link = full_path_build ($news_lin,$URL['host'],$URL['path']);
  2292. }
  2293. }
  2294. if ($rss == 1){
  2295. if (trim ($news_link) == '')
  2296. {
  2297. $news_link = stripslashes (rss_strip($item['guid']));
  2298. }
  2299. }
  2300. }else {$news_link = $item;}
  2301. if (trim($news_tit) != ''){
  2302. echo"
  2303.        <div id=\"progressbar\"></div>
  2304. <script> storyes($skey, $result,'".trim($news_tit)."');</script>";
  2305. }
  2306. ob_flush();
  2307. flush();
  2308. if ($dnast[27] == 1){
  2309. $link_cachefile = array_map('trim',@file(ENGINE_DIR.'/inc/plugins/files/cachefile.txt'));
  2310. if (!in_array ($news_link,$link_cachefile))openz(ENGINE_DIR.'/inc/plugins/files/cachefile.txt',$news_link."\n",'a');
  2311. else continue;
  2312. }
  2313. if (trim($end_title[2]) != ''and trim($news_tit) != '') $news_tit =rss_strip( relace_news ($news_tit,$end_title[2],$end_title[3]));
  2314. $alt_name = $db->safesql (totranslit( stripslashes( $news_tit ),true,false ));
  2315. $safeTitle  = $db->safesql($news_tit);
  2316. $link = 'get_url'.$story;
  2317. $news_link = full_path_build ($news_link,$URL['host'],$URL['path']);
  2318. if ($dop_sort[12] == 0) {$where = ' LIMIT 1';}
  2319. elseif ($dop_sort[12] == 1 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%'";}
  2320. elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
  2321. elseif ($dop_sort[12] == 3 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%' OR title = '".$safeTitle."' OR alt_name = '".$alt_name."'";}
  2322. else {if ($safeTitle != ''and $alt_name != '')$where = " WHERE title = '".$safeTitle."' OR alt_name = '".$alt_name."'";
  2323. else $where = ' LIMIT 1';
  2324. }
  2325. $sql_result = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
  2326. if ($db->num_rows ($sql_result) == 0 or $news_tit ==''or $hide_leech[3] == 1 or $dop_sort[12] == 0)
  2327. {
  2328. $full_story = '';
  2329. if (trim($end_title[4]) != ''and trim($news_link) != '') $news_lik = relace_news ($news_link,$end_title[4],$end_title[5]);
  2330. else $news_lik = $news_link;
  2331. $news_li=$link;
  2332. for ($j=1;$j <= 20;$j++){
  2333. $stoped = false;
  2334. if (trim($row['dop_full']) == ''and $j != '1'and $full_story != '')$stoped = true;
  2335. if ((trim ($start_template) != ''or trim($sart_cat[2]) != '') and !$stoped)
  2336. {
  2337. if ($dop_nast[18] == 0 ){
  2338. if (trim($row['dop_full'])!= ''and $j >= 2){
  2339. $news_link = str_replace('http://','',$news_lik);
  2340. $fl = explode('/',$news_link);
  2341. $news_linke = '';
  2342. for ($k=0;$k<(count($fl)-1);$k++){
  2343. $news_linke .= $fl[$k].'/';
  2344. }
  2345. $news_linke .= str_replace('{num}',$j,$row['dop_full']);
  2346. $news_link = 'http://'.$news_linke.end($fl);
  2347. }
  2348. }
  2349. else{
  2350. if ($j >= 2) $news_link = $news_lik.$row['dop_full'];
  2351. $news_link= preg_replace('#\.html(.*){num}#i','\\1{num}.html',$news_link);
  2352. $news_link= str_replace('.html.html','.html',$news_link);
  2353. $news_link= str_replace('{num}',$j,$news_link);
  2354. }
  2355. if (trim($end_title[4]) != ''and trim($news_link) != '') $news_link = relace_news ($news_link,$end_title[4],$end_title[5]);
  2356. $link = replace_url($news_li(trim(rss_strip($news_link))));
  2357. $full = get_full ($link[scheme],$link['host'],$link['path'],$link['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
  2358. $link = '';
  2359. }
  2360. else
  2361. {
  2362. break;
  2363. }
  2364. if (trim ($full) != ''){
  2365. if (trim($dop_nast[14]) == ''or $dop_nast[14] == '0')$charik = charset($full);else $charik = strtolower($charsets[1] != ''?$charsets[1]:$charsets[0]);
  2366. if (trim($row['start_title']) != ''and $dnast[22] == 1){
  2367. $news_tit = strip_tags_smart(get_full_news($full,$row['start_title']));
  2368. if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
  2369. }
  2370. if (trim ($start_template) != '')
  2371. {
  2372. $tags_tty = '';
  2373. if ($charik != strtolower($config['charset']) and trim ($charik) != '') {$tags_tty = convert($charik,strtolower($config['charset']),$full);}
  2374. if ($hide_leech[0] != 1){
  2375. $full_storys = get_short_news ($full,$start_template);
  2376. }else{
  2377. $full_storys = get_full_news ($full,$start_template);
  2378. }
  2379. if (sizeof($finish_template) and trim ($full_storys) == '')
  2380. {
  2381. foreach ($finish_template as $shabz){
  2382. $full_storys = get_full_news ($full,$shabz);
  2383. if (trim($full_storys) != '')break;
  2384. }
  2385. }
  2386. if ( ($full_storys) == ''){
  2387. list($start_temp,$finish_temp) = explode('{get}',$start_template,2);
  2388. $full_storys = get_news($full,$start_temp,$finish_temp);
  2389. }
  2390. if ($full_storys == '')break;
  2391. if ($j == '1')$full_story1 = $full_storys;
  2392. if ($full_storys != $full_story1 or $j == '1'or $full_story == '')
  2393. {
  2394. $full_story .= $full_storys;
  2395. }else{break;}
  2396. }else{break;}
  2397. }
  2398. if ($full_story == '')break;
  2399. }
  2400. if (preg_match('#<script>#i',$dop_sort[5]))
  2401. {
  2402. preg_match_all ("#(<script.+?>.+?<\/script>)#is",$full_story,$scrip);
  2403. if (count($scrip[0])){
  2404. foreach ($scrip[0] as $k_s=>$s_v){
  2405. $template = addcslashes(stripslashes($s_v),"[]!-.#?*%+\\()|");
  2406. $full_story = preg_replace('#'.$template.'#is','[skpipt'.$k_s.']',$full_story);
  2407. }
  2408. }
  2409. }
  2410. $news_link = $news_lik;
  2411. if ($charik != strtolower($config['charset']) and trim ($full_story) != ''and trim ($charik) != '') {$full_story = convert($charik,strtolower($config['charset']),$full_story);}
  2412. if (trim($row['start']) != ''){
  2413. $row_finish = str_replace('{link}',$news_link,$row['finish']);
  2414. $full_story = relace_news ($full_story,$row['start'],$row_finish,2);
  2415. $short_story = relace_news ($short_story,$row['start'],$row_finish,1);
  2416. if (trim ($sart_cat[0]) != ''or trim ($sart_cat[1]) != ''){
  2417. $full = relace_news ($full,$row['start'],$row_finish);
  2418. $tags_tty = relace_news ($tags_tty,$row['start'],$row_finish);
  2419. $item = relace_news ($item,$row['start'],$row_finish);
  2420. }
  2421. }
  2422. if (trim ($sart_cat[1]) != ''){
  2423. $data_tmp =strip_tags_smart(get_full_news($full,$sart_cat[1]));
  2424. if ($charik != strtolower($config['charset']) and trim ($data_tmp) != ''and trim ($charik) != '') {$data_tmp = convert($charik,strtolower($config['charset']),$data_tmp);}
  2425. if (trim ($data_tmp) == ''){
  2426. $data_tmp =strip_tags_smart(get_full_news($item.$tags_tty,$sart_cat[1]));
  2427. }
  2428. }
  2429. if (trim ($tags_tmp,', ') == ''){
  2430. if (trim ($sart_cat[0]) != '')$tags_tmp =strip_tags_smart(get_full_news($full,$sart_cat[0]));
  2431. if ($charik != strtolower($config['charset']) and trim ($tags_tmp) != ''and trim ($charik) != '') {$tags_tmp = convert($charik,strtolower($config['charset']),$tags_tmp);}
  2432. if (trim ($tags_tmp,', ') == ''){
  2433. $tags_tmp =strip_tags_smart(get_full_news($item.$tags_tty,$sart_cat[0]));
  2434. }
  2435. }
  2436. $xfields_array = array();
  2437. if (trim($row['xfields_template']) != '')
  2438. {
  2439. $xfields_array = get_xfields (rss_strip($full_story),$short_story,$row['xfields_template']);
  2440. $full_story = $xfields_array['content_story'];
  2441. $short_story = $xfields_array['content0_story'];
  2442. }
  2443. $link = replace_url($news_li(trim(rss_strip($news_link))));
  2444. $full_story = html_strip ($full_story);
  2445. if (trim($news_tit) == ''and trim ($full) != '')
  2446. {
  2447. $news_tit = get_title($full);
  2448. if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
  2449. }
  2450. if (trim($news_tit) == ''and trim ($full_story) != ''){
  2451. $news_tit = get_tit($short_story.$full_story);
  2452. if ($charik != strtolower($config['charset']) and trim($news_tit) != '') {$news_tit = convert($charik,strtolower($config['charset']),$news_tit);}
  2453. }
  2454. if($dop_sort[9] != 0) {
  2455. $full_story = trim(preg_replace('/[\r\n\t]+/',' ',$full_story));
  2456. $short_story = trim(preg_replace('/[\r\n\t]+/',' ',$short_story));
  2457. }
  2458. $full_story = trim(preg_replace("#(<br \/>|<br>)\s+(\S)#",'\\1\\2',$full_story));
  2459. $short_story = trim(preg_replace("#(<br \/>|<br>)\s+(\S)#",'\\1\\2',$short_story));
  2460. $full_story = trim(preg_replace('/\s+/',' ',$full_story));
  2461. $short_story = trim(preg_replace('/\s+/',' ',$short_story));
  2462. if ((trim($news_tit) == ''or intval($dnast[33]) == 1) and trim($short_story != '')){
  2463. $tit_kon = strpos(substr( strip_tags ($short_story) ,'50'),' ');
  2464. $tit_nach = '50'+$tit_kon +1;
  2465. $news_tit = substr( strip_tags ($short_story) ,0,$tit_nach);
  2466. }
  2467. 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] );
  2468. preg_match('!<{title}>(.*)<{short}>!is',$translate_google,$tran1);
  2469. preg_match('!<{short}>(.*)<{full}>!is',$translate_google,$tran2);
  2470. preg_match('!<{full}>(.*)<{tags_tmp}>!is',$translate_google,$tran3);
  2471. preg_match('!<{tags_tmp}>(.*)<{end}>!is',$translate_google,$tran4);
  2472. if (trim($tran1[1]) == '')$tran1[1] = translate_google (rss_strip($news_tit),$dop_sort[14] ,$dop_sort[15] );
  2473. if (trim($tran2[1]) == '')$tran2[1] = translate_google (rss_strip($short_story),$dop_sort[14] ,$dop_sort[15] );
  2474. if (trim($tran3[1]) == '')$tran3[1] = translate_google (rss_strip($full_story),$dop_sort[14] ,$dop_sort[15] );
  2475. if (trim($tran4[1]) == '')$tran4[1] = translate_google (rss_strip($tags_tmp),$dop_sort[14] ,$dop_sort[15] );
  2476. if (intval($dnast[34]) == 0){
  2477. if ($dnast[35] == 1 and $dop_sort[18] == ''){$news_tit = $tran1[1].'/'.$news_tit;}
  2478. else {$news_tit = $tran1[1];}
  2479. }
  2480. $short_story = $tran2[1];
  2481. $full_story = $tran3[1];
  2482. $tags_tmp = $tran4[1];
  2483. }
  2484. 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] ));
  2485. preg_match('!<{title}>(.*)<{short}>!is',$translate_google,$tran1);
  2486. preg_match('!<{short}>(.*)<{full}>!is',$translate_google,$tran2);
  2487. preg_match('!<{full}>(.*)<{tags_tmp}>!is',$translate_google,$tran3);
  2488. preg_match('!<{tags_tmp}>(.*)<{end}>!is',$translate_google,$tran4);
  2489. if (trim($tran1[1]) == '')$tran1[1] = rss_strip (translate_google (rss_strip($news_tit),$dop_sort[15] ,$dop_sort[18] ));
  2490. if (trim($tran2[1]) == '')$tran2[1] = rss_strip (translate_google (rss_strip($short_story),$dop_sort[15] ,$dop_sort[18] ));
  2491. if (trim($tran3[1]) == '')$tran3[1] = rss_strip (translate_google (rss_strip($full_story),$dop_sort[15] ,$dop_sort[18] ));
  2492. if (trim($tran4[1]) == '')$tran4[1] = rss_strip (translate_google (rss_strip($tags_tmp),$dop_sort[15] ,$dop_sort[18] ));
  2493. if (intval($dnast[34]) == 0){
  2494. if ($dnast[35] == 1){$news_tit = $tran1[1].'/'.$news_tit;}
  2495. else {$news_tit = $tran1[1];}
  2496. }
  2497. $short_story = $tran2[1];
  2498. $full_story = $tran3[1];
  2499. $tags_tmp = $tran4[1];
  2500. }
  2501. $news_tit = rss_strip($news_tit);
  2502. if (trim($end_title[2]) != ''and trim($news_tit) != '') $news_tit = relace_news ($news_tit,$end_title[2],$end_title[3]);
  2503. srand((float)microtime() * 1000000);
  2504. preg_match_all("#\[(.+?)\]#is",$end_title[0],$end_title00);
  2505. if (count($end_title00[1]) )
  2506. {
  2507. $end_title08 = $end_title[0];
  2508. foreach ($end_title00[1] as $kl=>$nmb){
  2509. $end_title000 = explode('|',$nmb);
  2510. $end_title000 = $end_title000[array_rand($end_title000)];
  2511. $end_title08 = preg_replace("#\[".addcslashes($nmb,"[]!-.#?*%+\\()|")."\]#",$end_title000,$end_title08,1);
  2512. }
  2513. $end_title0[0] = $end_title08;
  2514. }else{
  2515. $end_title0 = explode('|',$end_title[0]);
  2516. }
  2517. preg_match_all("#\[(.+?)\]#is",$end_title[1],$end_title10);
  2518. if (count($end_title10[1]))
  2519. {
  2520. $end_title18 = $end_title[1];
  2521. foreach ($end_title10[1] as $kl=>$nmb){
  2522. $end_title100 = explode('|',$nmb);
  2523. $end_title100 = $end_title100[array_rand($end_title100)];
  2524. $end_title18 = preg_replace("#\[".addcslashes($nmb,"[]!-.#?*%+\\()|")."\]#",$end_title100,$end_title18,1);
  2525. }
  2526. $end_title1[0] = $end_title18;
  2527. }else{
  2528. $end_title1 = explode('|',$end_title[1]);
  2529. }
  2530. $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)]);
  2531. $alt_name = totranslit( stripslashes( trim($news_tit) ),true,false );
  2532. if ($dnast[12] == 1) $row['symbol'] =$db->safesql(e_substr(htmlspecialchars(strip_tags(stripslashes(trim( strtolower ($news_tit) ) ) ) ),0,$dnast[13],$config['charset'] ) );
  2533. if ($news_title !='') echo"
  2534.         <div id=\"progressbar\"></div>
  2535. <script> storyes($skey, $result,'$news_title');</script>";
  2536. ob_flush();
  2537. flush();
  2538. if (trim($news_tit) == '') continue;
  2539. $full_allow_news = false;
  2540. if ($dop_sort[12] == 0) {$where = ' LIMIT 1';}
  2541. elseif ($dop_sort[12] == 1 and $news_link != '') {$where = " WHERE xfields like '%".$db->safesql ($news_link)."%'";}
  2542. elseif ($dop_sort[12] == 2) {$where = " WHERE title = '".$db->safesql ($news_title)."' OR alt_name = '".$db->safesql ($alt_name)."'";}
  2543. 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)."'";}
  2544. else {$where = " WHERE title = '".$db->safesql ($news_title)."' OR alt_name = '".$db->safesql ($alt_name)."'";}
  2545. $sql_result = $db->query('SELECT * FROM '.PREFIX .'_post'.$where);
  2546. if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] != 1 )$full_allow_news = true;
  2547. if ($db->num_rows ($sql_result) == 0 or $hide_leech[3] == 1 or $dop_sort[12] == 0)
  2548. {
  2549. $frag_ar = $zhv_code = array();
  2550. $frag_ar = explode('===',$sart_cat[2]);
  2551. if(count($frag_ar)){
  2552. $kl_z = 0;
  2553. foreach ($frag_ar as $kl_zas=>$frag_vl){
  2554. $key_fr != '';
  2555. if (preg_match("#\[GOLINK=(.*)\]#",$frag_vl,$outs_f)){
  2556. $frag_vl = str_replace($outs_f[0],'{get}',$frag_vl);
  2557. $key_fr = get_full_news ($full,$frag_vl);
  2558. $linkf = replace_url($news_li(trim(rss_strip($key_fr))));
  2559. $full_fr = get_full ($link_f[scheme],$linkf['host'],$linkf['path'],$linkf['query'],$cookies,$dop_nast[2],$dop_sort[8],$dop_sort[21]);
  2560. $key_fr = get_full_news ($full_fr,$outs_f[1]);
  2561. }else{
  2562. $key_fr = get_full_news ($full,$frag_vl);
  2563. }
  2564. $kl_z++;
  2565. if (trim ($key_fr) != '')
  2566. {
  2567. if ($charik != strtolower($config['charset']) and trim ($key_fr) != ''and trim ($charik) != '') {
  2568. $key_fr = convert($charik,strtolower($config['charset']),$key_fr);
  2569. }
  2570. if (trim($row['start']) != ''){
  2571. $key_fr = relace_news ($key_fr,$row['start'],$row_finish);
  2572. }
  2573. $key_fr = rss_strip($key_fr);
  2574. $key_fr = addcslashes(stripslashes($key_fr),'#');
  2575. $key_fr = parse_Thumb ($key_fr);
  2576. $key_fr = parse_rss ($key_fr);
  2577. $key_fr = $parse->decodeBBCodes ($key_fr,false);
  2578. $key_fr = rss_strip ($key_fr);
  2579. $key_fr = strip_tags_smart ($key_fr,'<object><embed><param>'.$dop_sort[5]);
  2580. if($dop_sort[13] == 1) {$key_fr = translate_google ($key_fr,$dop_sort[14] ,$dop_sort[15] );}
  2581. if($dop_sort[13] == 1 and $dop_sort[18] != '') {$key_fr = rss_strip (translate_google ($key_fr,$dop_sort[15] ,$dop_sort[18] ));}
  2582. $key_fr = preg_replace('#&quot;#','"',$key_fr);
  2583. $zhv_code[$kl_z] = strip_br($key_fr);
  2584. }
  2585. }
  2586. }
  2587. if (trim ($full_story) != '')
  2588. {
  2589. $full_story = rss_strip($full_story);
  2590. $full_story = addcslashes(stripslashes($full_story),'#');
  2591. $full_story = parse_Thumb ($full_story);
  2592. $full_story = parse_rss ($full_story);
  2593. $full_story = $parse->decodeBBCodes ($full_story,false);
  2594. $full_story = rss_strip ($full_story);
  2595. $full_story = strip_tags_smart ($full_story,'<object><embed><param>'.$dop_sort[5]);
  2596. $full_story = preg_replace('#&quot;#','"',$full_story);
  2597. $full_story = strip_br($full_story);
  2598. }
  2599. else
  2600. {
  2601. $full_story = '';
  2602. $full_allow_news = true;
  2603. }
  2604. $short_story = parse_Thumb ($short_story);
  2605. $short_story = parse_rss ($short_story);
  2606. $short_story = unhtmlentities( $short_story );
  2607. $short_story = $parse->decodeBBCodes ($short_story,false);
  2608. $short_story = rss_strip ($short_story);
  2609. $short_story = strip_tags_smart ($short_story,'<object><embed><param>'.$dop_sort[5]);
  2610. $short_story  = preg_replace('#&quot;#','"',$short_story );
  2611. $short_story  = strip_br($short_story );
  2612. $short_stor =  $short_story;
  2613. if ($dop_sort[2] == 1) $full_story = $short_story.'<br /><br />'.$full_story;
  2614. if ($dop_sort[0] != 0)$short_story = '';
  2615. $full_story = strip_br($full_story);
  2616. if($dop_sort[11] != 0) {
  2617. $news_title = str_replace( '  ',' ',$news_title );
  2618. }
  2619. $full_story = parse_host ($full_story,$link['host'],$link['path']);
  2620. $short_story = parse_host ($short_story,$link['host'],$link['path']);
  2621. $short_story = create_URL ($short_story,$link['host']);
  2622. $full_story = create_URL ($full_story,$link['host']);
  2623. if ($dnast[7] == 1 or $dnast[7] == 3) $short_story = url_img_($short_story );
  2624. if ($dnast[7] == 2 or $dnast[7] == 3) $full_story = url_img_($full_story );
  2625. if ($dop_nast[1] == 1){
  2626. 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 );
  2627. 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 );
  2628. }
  2629. if($dop_nast[1] == 2){
  2630. 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 );
  2631. 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 );
  2632. }
  2633. if($dop_nast[1] == 3){
  2634. 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 );
  2635. 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 );
  2636. }
  2637. if ($hide_leech[1] == '1'){
  2638. $short_story = replace_hide ($short_story);
  2639. $full_story = replace_hide ($full_story);
  2640. }
  2641. if ($hide_leech[2] == '1'){
  2642. $short_story = replace_leech ($short_story);
  2643. $full_story = replace_leech ($full_story);
  2644. }else{
  2645. $short_story = replace_noleech ($short_story);
  2646. $full_story = replace_noleech ($full_story);
  2647. }
  2648. $short_story = replace_quote ($short_story);
  2649. $full_story = replace_quote ($full_story);
  2650. if ($dop_nast[10] == 1){
  2651. $short_story = trim(preg_replace('/[\r\n\t ]{3,}/','
  2652. ',$short_story));
  2653. $full_story = trim(preg_replace('/[\r\n\t ]{3,}/','
  2654. ',$full_story));
  2655. }
  2656. if (intval($dop_nast[22]) != 0){
  2657. if ($dop_nast[24] != '')$kones = $dop_nast[24];
  2658. else $kones = ' ';
  2659. $kol_b='';
  2660. if (trim($short_story) != '')$full_stor = $short_story;
  2661. else $full_stor = $full_story;
  2662. $bb_d = array();
  2663. $bb_dd = array();
  2664. $dop_kon = strpos(substr( $full_stor ,$dop_nast[22]),$kones);
  2665. $short_sto = substr( $full_stor ,0,$dop_nast[22]);
  2666. preg_match_all('#\[(img|thumb).*\].*?\[\/(img|thumb)\]#is',$short_sto,$bb_d);
  2667. if (count($bb_d[0]) != 0){
  2668. foreach($bb_d[0] as $eh){
  2669. $kol_b += strlen($eh);
  2670. }
  2671. }
  2672. preg_match_all('#\[.*?\]#i',$short_sto,$bb_dd);
  2673. if (count($bb_dd[0]) != 0){
  2674. foreach($bb_dd[0] as $eh){
  2675. $kol_b += strlen($eh);
  2676. }
  2677. }
  2678. $dop_nast[22] +=$kol_b;
  2679. $dop_kon = strpos(substr( $full_stor ,$dop_nast[22]),$kones);
  2680. $nach = $dop_nast[22] +$dop_kon +1;
  2681. if (intval($dop_nast[22]) != 0) $short_story = substr( $full_stor ,0,$nach);
  2682. else $short_story = substr( $full_stor ,0,strpos(substr( $full_stor ,$dop_nast[22]),$kones));
  2683. $short_story .= '...';
  2684. $short_story = preg_replace('#\[\S+\.\.\.#','...',$short_story);
  2685. $short_story = preg_replace('#<\S+\.\.\.#','...',$short_story);
  2686. $short_story = preg_replace('#\.\s\.\.\.#','...',$short_story);
  2687. $short_story = preg_replace('#,\s\.\.\.#','...',$short_story);
  2688. $short_story = str_replace('....','...',$short_story);
  2689. $short_story = preg_replace('#[\.]{2,}#','',$short_story);
  2690. $short_story = close_dangling_tags($short_story).'...';
  2691. if (trim($short_story,'., ') == '')$short_story = '';
  2692. }
  2693. if ($dop_sort[1] == 1 or $dop_sort[0] == 1 or count($str_urls) >'0') {
  2694. if ($short_story == ''and $full_story != ''or $dop_sort[1] == 1){
  2695. 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;
  2696. }
  2697. }
  2698. if ($dop_sort[17] != 0)$full_story = '';
  2699. if ($dop_nast[17] == 1 or $dop_nast[17] == 3){
  2700. $indeg = get_im ($full_story);
  2701. $full_story = str_replace ($indeg,'',$full_story);
  2702. $full_story = $indeg.$full_story;
  2703. }
  2704. if ($dop_nast[17] == 2 or $dop_nast[17] == 3){
  2705. $indeg = get_im ($short_story);
  2706. $short_story = str_replace ($indeg,'',$short_story);
  2707. $short_story = $indeg.$short_story;
  2708. }
  2709. if(intval($dop_nast[23]) != 0){
  2710. $full_story = str_replace('[thumb','[img',$full_story);
  2711. $full_story = str_replace('thumb]','img]',$full_story);
  2712. preg_match_all ('#\[img.*?\](.+?)\[\/img\]#i',$full_story,$img_a);
  2713. $is = 1;
  2714. $num_i=ceil(count($img_a[0])/$dop_nast[23]);
  2715. $is_k = 1;
  2716. foreach ($img_a[0] as $value)
  2717. {
  2718. if ($is %$dop_nast[23] == 0){
  2719. $full_story = str_replace($value,$value."\n{PAGEBREAK}\n",$full_story);
  2720. $is_k++;
  2721. }
  2722. $is++;
  2723. if ($num_i == $is_k)break;
  2724. }
  2725. }
  2726. if (trim($row['xfields_template']) != '')
  2727. {
  2728. $xfields_array = get_xfields (rss_strip($full_story),$short_story,$row['xfields_template'],$xfields_array);
  2729. $full_story = $xfields_array['content_story'];
  2730. $short_story = $xfields_array['content0_story'];
  2731. }
  2732. $short_story = replace_align ($short_story,$dnast[0]);
  2733. $full_story = replace_align ($full_story,$dnast[1]);
  2734. if ($dnast[36] != ''and $dnast[36] != $dnast[1])
  2735. {
  2736. $img_poster = get_im ($full_story);
  2737. $full_story = str_replace ($img_poster,replace_align ($img_poster,$dnast[36]),$full_story);
  2738. $full_story = preg_replace('#\[center\]\[(img|thumb)=(.*?)\[\/(img|thumb)\]\\[/center\]#is','[\\1=\\2[/\\3]',$full_story);
  2739. }
  2740. $short_story = htmlspecialchars ($short_story);
  2741. $full_story = htmlspecialchars ($full_story);
  2742. if (!((!($row['date_format'] == 0) AND !($row['date_format'] == 1))))
  2743. {
  2744. $added_time_stamp = time () +($config['date_adjust'] * 60);
  2745. $dat = $lang_grabber['date_post'].$lang_grabber['date_flowing'];
  2746. if ($row['date_format'] == 1)
  2747. {
  2748. $interval = mt_rand ($config_rss['interval_start']*60,$config_rss['interval_finish']*60);
  2749. $added_time_stamp += $interval;
  2750. $dat = $lang_grabber['date_post'].$lang_grabber['date_casual'];
  2751. }
  2752. }
  2753. else
  2754. {
  2755. if ($rss == 1 or trim($sart_cat[1]) != ''){
  2756. if ($row['date_format'] == 2)
  2757. {
  2758. if(!preg_match('/\d/i',$data_tmp))$data_tmp = time ();
  2759. else $data_tmp = parse_date($data_tmp);
  2760. if ($data_tmp >time ())$data_tmp = time ();
  2761. if ($rss == 0 and trim($data_tmp) != ''){$added_time_stamp = $data_tmp;}
  2762. else $added_time_stamp = strtotime ($item['pubDate']);
  2763. $dat = $lang_grabber['date_post'].$lang_grabber['date_channel'];
  2764. }
  2765. }else{$added_time_stamp = time () +($config['date_adjust'] * 60);
  2766. $dat = $lang_grabber['date_post'].$lang_grabber['date_flowing'];
  2767. }
  2768. }
  2769. $str_date = date( 'Y-m-d H:i:s',$added_time_stamp);
  2770. if (preg_match('/00:00:00/',$str_date))$str_date = str_replace('00:00:00',date('H:i:s',time()),$str_date);
  2771. $keywordsd = explode ('===',$row['keywords']);
  2772. $keywords = stripslashes ($keywordsd[0]);
  2773. if (trim ($keywords) != '')
  2774. {
  2775. $allow_news = FALSE;
  2776. $keywords = explode ('|||',$keywords);
  2777. foreach ($keywords as $word)
  2778. {
  2779. if (trim($word) != ''){
  2780. $word = addcslashes(stripslashes($word),'"[]!-.#?*%\\()|/');
  2781. if (preg_match ('#'.$word.'#',$short_story) or preg_match ('#'.$word.'#',$full_story) or preg_match ('#'.$word.'#',$news_title))
  2782. {
  2783. $allow_news = TRUE;
  2784. }
  2785. }else{$allow_news = TRUE;}
  2786. }
  2787. }
  2788. else
  2789. {
  2790. $allow_news = TRUE;
  2791. }
  2792. $stkeywordsd = explode ('===',$row['stkeywords']);
  2793. $stkeywords = stripslashes ($stkeywordsd[0]);
  2794. if (trim ($stkeywords) != '')
  2795. {
  2796. $stkeywords = explode ('|||',$stkeywords);
  2797. foreach ($stkeywords as $word)
  2798. {
  2799. if (trim($word) != ''){
  2800. $word = addcslashes(stripslashes($word),'"[]!-.#?*%\\()|/');
  2801. if (preg_match ('#'.$word.'#',$short_story) or preg_match ('#'.$word.'#',$full_story) or preg_match ('#'.$word.'#',$news_title))
  2802. {
  2803. $allow_news = FALSE;
  2804. }
  2805. }
  2806. }
  2807. }
  2808. if (trim($keywordsd[1]) != '')$short_story = $keywordsd[1].' '.$short_story;
  2809. if (trim($keywordsd[2]) != '')$full_story = $keywordsd[2].' '.$full_story;
  2810. if (trim($stkeywordsd[1]) != '')$short_story .=' '.$stkeywordsd[1];
  2811. if (trim($stkeywordsd[2]) != '')$full_story .=' '.$stkeywordsd[2];
  2812. foreach ($zhv_code as $k_zh=>$v_zh){
  2813. $short_story= str_replace('{frag'.$k_zh.'}',$v_zh,$short_story);
  2814. $full_story= str_replace('{frag'.$k_zh.'}',$v_zh,$full_story);
  2815. $news_title = str_replace('{frag'.$k_zh.'}',$v_zh,$news_title);
  2816. $short_story= str_replace('{frag}',$v_zh,$short_story);
  2817. $full_story= str_replace('{frag}',$v_zh,$full_story);
  2818. $news_title = str_replace('{frag}',$v_zh,$news_title);
  2819. }
  2820. $news_title_out = $parse->decodeBBCodes($news_title);
  2821. if (trim ($row['delate']) != '')
  2822. {
  2823. $row_inser= str_replace('{zagolovok}',$news_title,$row['inser']);
  2824. $row_inser= str_replace('{link}',$news_link,$row['inser']);
  2825. foreach ($zhv_code as $k_zh=>$v_zh){
  2826. $row_inser= str_replace('{frag'.$k_zh.'}',$v_zh,$row_inser);
  2827. $row_inser= str_replace('{frag}',$v_zh,$row_inser);
  2828. }
  2829. $short_story = relace_news ($short_story,$row['delate'],$row_inser,1);
  2830. $full_story = relace_news ($full_story,$row['delate'],$row_inser,2);
  2831. }
  2832. $short_story= str_replace('{link}',$news_link,$short_story);
  2833. $full_story= str_replace('{link}',$news_link,$full_story);
  2834. $short_story= str_replace('{zagolovok}',$news_title,$short_story);
  2835. $full_story= str_replace('{zagolovok}',$news_title,$full_story);
  2836. $short_story= trim(strip_br ($short_story)," \n\t");
  2837. $full_story= trim(strip_br ($full_story)," \n\t");
  2838. if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] == 1){
  2839. $word = addcslashes(stripslashes($news_link),'"[]!-.#?*%\\()|/');
  2840. while ($ren = $db->get_row($sql_result)){
  2841. if ($dnast[17] != 1){
  2842. if ($dop_sort[12] == 1  or $dop_sort[12] == 3)$xfi=true;
  2843. if(preg_match('#'.$word.'#i',$ren['xfields']) or !$xfi){
  2844. $kolsa = array();$kolsb = array();
  2845. preg_match_all("#<a.*?href[=]?[='\"](\S+?)['\" >].*?>(.*?)<\/a>#is",$ren['full_story'],$kolsa);
  2846. preg_match_all('#\[url(\S+?)\].+?\[/url\]#i',$full_story,$kolsb);
  2847. if (count($kolsa[0]) >= count($kolsb[0])){$allow_news = false;
  2848. }else{$allow_news = true;
  2849. break;
  2850. }
  2851. }
  2852. }else{
  2853. if ($dnast[30] == 1 and trim($data_tmp) == '')$data_tmp = 'data';
  2854. if ($row['date_format'] == 2 and $data_tmp != ''){
  2855. if ($dop_sort[12] == 1  or $dop_sort[12] == 3)$xfi=true;
  2856. if(preg_match('#'.$word.'#i',$ren['xfields']) or !$xfi or trim($ren['xfields']) == ''){
  2857. $allow_news = false;$full_allow_news=false;
  2858. if (parse_date($str_date) >parse_date($ren['date'])){
  2859. $allow_news = true;
  2860. }else{$allow_news = false;$full_allow_news=false;}
  2861. break;}
  2862. }
  2863. }
  2864. }
  2865. }
  2866. if ($db->num_rows ($sql_result) == 0 and $hide_leech[3] == 1)$rewrite = '';
  2867. if ($db->num_rows ($sql_result) != 0 and $hide_leech[3] == 1) $rewrite = 'checked';
  2868. if ($dnast[30] == 1 and $db->num_rows ($sql_result) == 0){$allow_news = false;$full_allow_news=false;}
  2869. if (count($scrip[0])){
  2870. foreach ($scrip[0] as $k_s=>$s_v){
  2871. echo $k_s;
  2872. $full_story = preg_replace("#\[skpipt".$k_s."\]#is",$s_v,$full_story);
  2873. }
  2874. }
  2875. if ($allow_news)
  2876. {
  2877. $Autor = explode('=',$row['Autors']);
  2878. if (trim($Autor[0]) != '')
  2879. {
  2880. $input=array ();
  2881. $autor = explode ('|||',stripslashes($Autor[0]));
  2882. foreach ($autor as $value)
  2883. {
  2884. $input[] =trim($value);
  2885. }
  2886. }
  2887. else
  2888. {if (trim($Autor[1]) == '') $Autor[1] = $config_rss['reg_group'];
  2889. if (trim($Autor[1]) == '') $Autor[1] = 1;
  2890. $rows = $db->query ('SELECT * FROM '.PREFIX ."_users WHERE user_group IN ({$Autor[1]})");
  2891. while ($rown = $db->get_row($rows)) {
  2892. $input[] = $rown['name'];
  2893. }
  2894. }
  2895. if ($input != '')$author    = $input[array_rand ($input)];
  2896. $author_info = "&nbsp;<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>";
  2897. $news_info = "&nbsp;<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>";
  2898. $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>";
  2899. $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>';
  2900. $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\">
  2901. ";
  2902. $key_wordss = '';
  2903. $descrs = '';
  2904. if ($dop_sort[7] == 5)$key_wordss = keyword($tags_tty);
  2905. if ($dop_sort[10] == 5)$descrs = description($tags_tty);
  2906. if ($key_wordss == ''or $descrs == ''){
  2907. $metatags_short = create_metategs ($short_story);
  2908. $metatags_full = create_metategs ($full_story);
  2909. }
  2910. if ($dop_sort[7] != 4 and $key_wordss == ''){
  2911. if ($dop_sort[7] == 1){
  2912. $key_wordss = trim($metatags_short['keywords'],' ,');
  2913. }elseif ($dop_sort[7] == 2){
  2914. $key_wordss = trim($metatags_full['keywords'],' ,');
  2915. }elseif ($dop_sort[7] == 3){
  2916. if ($metatags_full['keywords'] >= $metatags_short['keywords']){
  2917. $key_wordss = trim($metatags_full['keywords'],' ,');
  2918. }else{
  2919. $key_wordss = trim($metatags_short['keywords'],' ,');
  2920. }
  2921. }else{
  2922. $key_wordss = trim($metatags_short['keywords'].', '.$metatags_full['keywords'],' ,');
  2923. }
  2924. }
  2925. $key_words = trim($row['key_words'].', '.$key_wordss,' ,');
  2926. $key_words = substr( $key_words ,0,190 +strpos(substr( $key_words ,190),','));
  2927. if ($dop_sort[10] != 4 and $descrs == ''){
  2928. if ($dop_sort[10] == 1){
  2929. $descrs = trim($metatags_short['description'],' ,');
  2930. }elseif ($dop_sort[10] == 2){
  2931. $descrs = trim($metatags_full['description'],' ,');
  2932. }elseif ($dop_sort[10] == 3){
  2933. if ($metatags_full['description'] >= $metatags_short['description']){
  2934. $descrs = trim($metatags_full['description'],' ,');
  2935. }else{
  2936. $descrs = trim($metatags_short['description'],' ,');
  2937. }
  2938. }else{
  2939. $descrs = trim($metatags_short['description'].', '.$metatags_full['description'],' ,');
  2940. }
  2941. }
  2942. $descr = trim($row['meta_descr'].', '.$descrs ,' ,');
  2943. $descr = substr( $descr ,0,190 +strpos(substr( $descr ,190),' '));
  2944. $category_row = array();
  2945. $category = array();
  2946. $kateg = array();
  2947. $tags_tmps = array();
  2948. $tags_tm = '';
  2949. $tags_tmpr = $tags_tmp;
  2950. if ($dnast[21] == 0) $tags_tmps = replace_tags_title ($tags_tmp.','.$news_tit,$dnast[20]);
  2951. else $tags_tmps = replace_tags ($tags_tmp.','.$full_story.','.$news_tit,$dnast[20]);
  2952. if ($dnast[8] == 0){
  2953. $tags_tm = trim(preg_replace('/[\r\n\t]+/','',$tags_tmp));
  2954. if (intval($dnast[20]) != 0 and $tags_tm != ''){
  2955. $sort = explode(',',$tags_tm);
  2956. $strsm = array ();
  2957. for ($ir=0;$ir<intval($dnast[20]);$ir++){$strsm[] = $sort[$ir];}
  2958. $tags_tm = implode(',',$strsm);
  2959. }
  2960. }else{
  2961. $tags_tm = $tags_tmps[0];
  2962. }
  2963. $tags_tmp = trim($row['ftags'].','.$tags_tm ,',');
  2964. if (trim($row['sart_link'])==''and $rss == 0)$n_link= get_flink ($tags_tty.$full,$link['host'],$tu_link);
  2965. else $n_link = $news_link;
  2966. if (trim($row['kategory']) != ''){
  2967. foreach (explode ('|||',$row['kategory']) as $value){
  2968. $kr = explode ('==',$value);
  2969. foreach (explode (',',$kr[0]) as $wnd){
  2970. $url_kats = addcslashes(stripslashes(reset_urlk($wnd)),'"[]!-.#?*%\\()|/');
  2971. if($dop_sort[16] == 1)$for = $tags_tmpr;
  2972. else $for = $n_link;
  2973. if (preg_match('#'.$url_kats.'#i',$for)){
  2974. foreach (explode (',',$kr[1]) as $key){
  2975. $db->close;
  2976. $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
  2977. 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))."%'");
  2978. if (trim($sql_cat['id']) != '')
  2979. {
  2980. $kateg[]=$sql_cat['id'];
  2981. }
  2982. }
  2983. }
  2984. }
  2985. }
  2986. }
  2987. if (count($kateg) == 0){
  2988. if ($row['thumb_img'] == 1){
  2989. $gory = explode (',',$tags_tmps[1].','.$tags[1]);
  2990. foreach ($gory as $value) {
  2991. $db->close;
  2992. $db->connect(DBUSER,DBPASS,DBNAME,DBHOST);
  2993. 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))."%'");
  2994. if (trim($sql_cat['id']) != '')
  2995. {
  2996. $category[]=$sql_cat['id'];
  2997. }
  2998. }
  2999. }
  3000. }else{$category =$kateg;}
  3001. $categoryes = explode ('=',$row['category']);
  3002. $category_row = explode (',',$categoryes[0]);
  3003. if (count($category_row) == 1)$category_row = $categoryes[0];
  3004. if (count($category) != '0'){
  3005. $categories_list = CategoryNewsSelection (array_unique($category),0);
  3006. }else{
  3007. $categories_list = CategoryNewsSelection ($category_row,0);
  3008. }
  3009. unset ($news_tit);
  3010. $db->close;
  3011. $xfieldsaction = 'categoryfilter';
  3012. include ($rss_plugins.'xfields.php');
  3013. echo $categoryfilter;
  3014. echo "  <script >
  3015.     $(document).ready(function(e){
  3016.     $(\"select#category$i$channel_id\").change(function (e) {
  3017.             var str = \"\";
  3018.             $(\"select#category$i$channel_id option:selected\").each(function () {
  3019.                 str += $(this).text() + \"  \";
  3020.                 });
  3021.             $(\".category$i$channel_id\").text(str);
  3022.         })
  3023.         .trigger('change');
  3024.     });
  3025.     </script>
  3026.  
  3027. <script>
  3028.     $(function(){
  3029.         $('#tags$i$channel_id').autocomplete({
  3030.             serviceUrl:'engine/ajax/tags_rss.php',
  3031.             minChars:3,
  3032.             delimiter: /(,|;)\s*/,
  3033.             maxHeight:400,
  3034.             width:348,
  3035.             deferRequestBy: 300
  3036.           });
  3037.  
  3038.     });
  3039. </script>
  3040. <table width=\"100%\">
  3041.     <tr class=\"light\" onMouseOut=this.className=\"light\"
  3042.        onMouseOver=this.className=\"highlight\"
  3043.        onclick=\"selectRow(event,this)\">
  3044.         <td style=\"padding:4px\" align=\"left\" ><a href=\"javascript:ShowOrHideg('full_$i$channel_id');\">$news_title_out</a>";
  3045. if ($dop_nast[5] == '0')$ava = ' style="display:none"';
  3046. if ($dop_nast[7] == '0')$avd = ' style="display:none"';
  3047. if ($dop_nast[6] == '0')$avt = ' style="display:none"';
  3048. if ($dop_nast[13] == '0')$avw = ' style="display:none"';
  3049. if ($dnast[2] == '0')$ada = ' style="display:none"';
  3050. if ($dnast[3] == '0')$add = ' style="display:none"';
  3051. if ($dnast[4] == '0')$adt = ' style="display:none"';
  3052. if ($dnast[5] == '0')$adw = ' style="display:none"';
  3053. if ($dnast[6] == '0')$adu = ' style="display:none"';
  3054. if ($dnast[14] == '0')$ade = ' style="display:none"';
  3055. if ($dnast[2] == '0'and $dnast[3] == '0'and $dnast[4] == '0'and $dnast[5] == '0'and $dnast[6] == '0')$adg = ' style="display:none"';
  3056. if ($dop_sort[17] == 0 and intval($dop_sort[20]) == 0){
  3057. if (trim ($full_story) == ''and trim ($news_link) !='')
  3058. {
  3059. echo "      <br /><font color=red>{$lang_grabber['no_full_story']}</font> ==> <a href=\"$news_link\" target=\"_blank\">{$news_link}</a>";
  3060. }
  3061. }
  3062. echo "</td>
  3063.         <td align=\"right\" ><font color=red><div class=\"category$i$channel_id\"></div></font></td>
  3064.         <td width=\"1%\" ></td>";
  3065. if($dnast[28] == 1 and (@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php'))) {
  3066. 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>";
  3067. }else{echo "<td width=\"0px\" align=\"right\"></td>";}
  3068. if($dnast[26] == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
  3069. {
  3070. 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>";
  3071. }else {echo "<td width=\"0px\" align=\"right\"></td>";}
  3072. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
  3073. 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>";
  3074. }else {echo "<td width=\"0px\" align=\"right\"></td>";}
  3075. 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>
  3076.         <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>
  3077.         <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>
  3078.         <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>
  3079.         <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>
  3080. </tr>
  3081.      <tr>
  3082.         <td colspan=\"10\">
  3083. <div style=\"padding-top:5px;padding-bottom:2px;display:none\" id=\"full_$i$channel_id\">
  3084. <div class=\"hr_line\"></div>
  3085. <table width=\"100%\">
  3086.     <tr>
  3087.         <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['edit_et']}</td>
  3088.         <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>
  3089.          </td>
  3090.     </tr>
  3091.     <tr $ava>
  3092.         <td  width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['author']}</td>
  3093.         <td><input  name=\"autor_$i$channel_id\" id=\"autor_$i$channel_id\" size=\"30\" value=\"{$author}\">$author_info</td>
  3094.     </tr>
  3095.     <tr $avd>
  3096.         <td  width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$dat}:</td>
  3097.         <td><input  name=\"date-from-channel_$i$channel_id\" id=\"date-from-channel_$i$channel_id\" size=\"30\" value=\"{$str_date}\">
  3098. <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']}\"/>
  3099. <script type=\"text/javascript\">
  3100. 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});
  3101. </script>
  3102.        </td>
  3103. </tr>
  3104.     <tr>
  3105.         <td  width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['edit_cat']}</td>
  3106.         <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>
  3107.         </td>
  3108.     </tr>
  3109. <tr $avt><td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['tegs_post']}:</td>
  3110. <td><input size=\"70\" id=\"tags$i$channel_id\" name=\"tags_$i$channel_id\" value=\"{$tags_tmp}\" class=\"edit bk\" autocomplete=\"off\">
  3111.         </td>
  3112.     </tr>
  3113. </table>
  3114. <div class=\"hr_line\"></div>
  3115. <table width=\"100%\">
  3116.     <tr>
  3117.     <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_short']}<br /></td>
  3118.     <td>";
  3119. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
  3120. if ($dop_nast[8] == '1')echo $sin_bb;
  3121. else echo $sin_but;
  3122. }
  3123. if ($dop_nast[8] == '1'){
  3124. echo $bb_panel;
  3125. }
  3126. echo "<textarea style=\"width:98%; height:200px\" onclick=\"setFieldName(this.name)\" id=\"short_$i$channel_id\" name=\"short_$i$channel_id\">{$short_story}</textarea>";
  3127. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') )
  3128. {
  3129. 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 "
  3130.     </td>
  3131.     </tr>
  3132.     <tr>
  3133.     <td  width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_full']}</td>
  3134.     <td><br />";
  3135. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
  3136. if ($dop_nast[8] == '1')echo $sin_bb;
  3137. else echo $sin_but;
  3138. }
  3139. if ($dop_nast[8] == '1'){
  3140. echo $bb_panel;
  3141. }
  3142. echo "<textarea style=\"width:98%; height:200px\" onclick=\"setFieldName(this.name)\" id=\"full$i$channel_id\" name=\"full_$i$channel_id\">{$full_story}</textarea>";
  3143. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') )
  3144. {echo "
  3145. <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 "
  3146.     </td>
  3147. </tr>
  3148. <tr $avw>
  3149.     <td  width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang_grabber['pics_post']}:</td>
  3150.     <td>
  3151. <select name=\"serv_$i$channel_id\" id=\"serv_$i$channel_id\">
  3152. ".server_host($row['load_img'])."</select>
  3153.     <a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang_grabber['help_post_rad']}', this, event, '220px')\">[?]</a>
  3154.     </td>
  3155. </tr>";
  3156. if ($dop_nast[9] == '1')
  3157. {
  3158. echo "<tr >
  3159.         <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>
  3160.     </tr>
  3161.      <tr>
  3162.         <td colspan=\"8\">
  3163. <div style=\"display:none\" id=\"xf_$i$channel_id\">
  3164. <div class=\"hr_line\"></div>
  3165. <table width=\"100%\">";
  3166. $xreplace = array();
  3167. $ds = explode ('|||',$row['xfields_template']);
  3168. foreach ($ds as $xvalue)
  3169. {
  3170. $xf=array();
  3171. $xf = explode ('==',$xvalue);
  3172. $xreplace[$xf[0]] = $xf;
  3173. }
  3174. $fieldvalue = array();
  3175. if (count($xfields_array) !=0){
  3176. foreach ($xfields_array as $key =>$value){
  3177. if ($key != 'content_story'){
  3178. if(array_key_exists($key,$xreplace)) {
  3179. $xreplace_key = str_replace('{zagolovok}',$news_title,$xreplace[$key][6]);
  3180. $xreplace_key = str_replace('{link}',$news_link,$xreplace_key);
  3181. foreach ($zhv_code as $k_zh=>$v_zh){
  3182. $xreplace_key= str_replace('{frag'.$k_zh.'}',$v_zh,$xreplace_key);
  3183. $xreplace_key= str_replace('{frag}',$v_zh,$xreplace_key);
  3184. }
  3185. $value = relace_news ($value,$xreplace[$key][5],$xreplace_key);
  3186. }
  3187. $value = parse_Thumb ($value);
  3188. $value = parse_rss ($value);
  3189. $value = $parse->decodeBBCodes ($value,false);
  3190. $value = rss_strip ($value);
  3191. $value = strip_tags_smart ($value,'<object><embed><param>'.$dop_sort[5]);
  3192. if($dop_sort[13] == 1) {$value = rss_strip (translate_google ($value,$dop_sort[14] ,$dop_sort[15] ));}
  3193. if($dop_sort[13] == 1 and $dop_sort[18] != '') {$value = rss_strip (translate_google ($value,$dop_sort[15] ,$dop_sort[18] ));}
  3194. $value = preg_replace('#&quot;#','"',$value);
  3195. if ($xreplace[$key][4] == 1)$value = '[img]'.$value.'[/img]';
  3196. $value = parse_host ($value,$link['host'],$link['path']);
  3197. if ($xreplace[$key][4] == 1){
  3198. $value=str_replace( '[img]','',$value );
  3199. $value=str_replace( '[/img]','',$value );
  3200. }
  3201. '<pre>'.$value.'</pre>';
  3202. if ($dop_nast[1] == 1){
  3203. $value=preg_replace( "#(^|\s|>)((http://|https://|ftp://)\w+[^<\s\[\]]+)#i","\\1[url]\\2[/url]",$value );
  3204. }
  3205. if($dop_nast[1] == 2){
  3206. $value = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$value );
  3207. }
  3208. if($dop_nast[1] == 3){
  3209. $value = preg_replace( '#\[url=(.+?)\](.+?)\[\/url\]#ie',"downs_host('\\1', '\\2', ".$dop_nast[1].')',$value );
  3210. }
  3211. if (intval($xreplace[$key][8]) != 0 and trim($value) != ''){
  3212. if ($dop_nast[24] != '')$kones = $dop_nast[24];
  3213. else $kones = ' ';
  3214. $kol_b='';
  3215. $full_stor = $value;
  3216. $bb_d = array();
  3217. $bb_dd = array();
  3218. $dop_kon = strpos(substr( $full_stor ,$xreplace[$key][8]),$kones);
  3219. $short_sto = substr( $full_stor ,0,$xreplace[$key][8]);
  3220. preg_match_all('#\[(img|thumb)\].*?\[\/(img|thumb)\]#is',$full_sto,$bb_d);
  3221. if (count($bb_d[0]) != 0){
  3222. foreach($bb_d[0] as $eh){
  3223. $kol_b += strlen($eh);
  3224. }
  3225. }
  3226. preg_match_all('#[.*?]#i',$full_sto,$bb_dd);
  3227. if (count($bb_dd[0]) != 0){
  3228. foreach($bb_dd[0] as $eh){
  3229. $kol_b += strlen($eh);
  3230. }
  3231. }
  3232. $xreplace[$key][8] +=$kol_b;
  3233. $dop_kon = strpos(substr( $full_stor ,$xreplace[$key][8]),$kones);
  3234. $nach = $xreplace[$key][8] +$dop_kon +1;
  3235. if (intval($xreplace[$key][8]) != 0) $value = substr( $full_stor ,0,$nach).'...';
  3236. else $value = substr( $full_stor ,0,strpos(substr( $full_stor ,$xreplace[$key][8]),$kones)).'...';
  3237. $value = preg_replace('#<\S+\.\.\.#','...',$value);
  3238. $value = preg_replace('#\.\s\.\.\.#','...',$value);
  3239. $value = preg_replace('#,\s\.\.\.#','...',$value);
  3240. $value = str_replace('....','...',$value);
  3241. if (trim($value,'., ') == '')$value == '';
  3242. }
  3243. $value= str_replace('{zagolovok}',$news_title,$value);
  3244. foreach ($zhv_code as $k_zh=>$v_zh){
  3245. $value= str_replace('{frag'.$k_zh.'}',$v_zh,$value);
  3246. $value= str_replace('{frag}',$v_zh,$value);
  3247. }
  3248. $fieldvalue[$key] = $value;
  3249. }
  3250. }
  3251. }
  3252. if ($row['allow_more'] == 1)
  3253. {
  3254. $fieldvalue['source_name'] = $row['title'];
  3255. $fieldvalue['source_link'] = $news_link;
  3256. }
  3257. $xfieldsaction = 'list';
  3258. include ($rss_plugins.'xfields.php');
  3259. $config_code_bb = explode (',',$config_rss['code_bb'] );
  3260. $config_sin_dop = explode (',',$config_rss['sin_dop'] );
  3261. if ($config_rss['code_bb'] != ''){
  3262. foreach ($config_code_bb as $value){
  3263. $output = str_replace('<!--'.$value.'-->','<!--'.$value.'-->'.$bb_panel,$output);
  3264. }
  3265. }
  3266. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php') and $config_rss['sin_dop'] != '')
  3267. {
  3268. foreach ($config_sin_dop as $val){
  3269. if (in_array($val,$config_code_bb))$output = str_replace('<!--'.$val.'-->',$sin_bb,$output);
  3270. else $output = str_replace('<!--'.$val.'-->',$sin_but,$output);
  3271. }
  3272. }
  3273. echo $output;
  3274. echo '</table>
  3275. </div>
  3276. </td>
  3277. </tr>';
  3278. }
  3279. echo "<tr $adg>
  3280.         <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>
  3281.     </tr>
  3282.      <tr>
  3283.         <td colspan=\"8\">
  3284. <div style=\"display:none\" id=\"dop_$i$channel_id\">
  3285. <table width=\"100%\" >
  3286. ";
  3287. if (intval($dnast[10]) != 0){
  3288. $expires = date( 'Y-m-d H:i:s',(strtotime($str_date) +$dnast[10] * 86400));
  3289. if($dnast[11] == 1)$expi = 'selected';else $exp = 'selected';
  3290. }else{$expires = '';}
  3291. if (intval($dnast[10]) != 0){
  3292. if ($expires != ''){$datede = strtotime ($expires);}else
  3293. {$datede = strtotime ($thistime) +$dnast[10] * 86400;}
  3294. $db->query( 'INSERT INTO '.PREFIX ."_post_log (news_id, expires, action) VALUES('$news_id', '$datede', '{$dnast[11]}')");
  3295. }
  3296. echo "        <td colspan=\"2\"><div class=\"hr_line\"></div></td>
  3297.     <tr $ada>
  3298.         <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['catalog_url']}</td>
  3299.         <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>
  3300.     </tr>
  3301.     <tr $adu>
  3302.         <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['addnews_url']}</td>
  3303.         <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>
  3304.     </tr>
  3305.  
  3306.     <tr $ade>
  3307.         <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['date_expires']}</td>
  3308.         <td><input type=\"text\" name=\"expires_$i$channel_id\" id=\"e_date_c_$i$channel_id\" size=\"20\" value=\"{$expires}\" class=edit>
  3309. <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>
  3310. <script type=\"text/javascript\">
  3311.     Calendar.setup({
  3312.         inputField     :    \"e_date_c_$i$channel_id\",     // id of the input field
  3313.         ifFormat       :    \"%Y-%m-%d\",      // format of the input field
  3314.         button         :    \"e_trigger_c_$i$channel_id\",  // trigger for the calendar (button ID)
  3315.         align          :    \"Br\",           // alignment
  3316.         singleClick    :    true
  3317.     });
  3318. </script></td>
  3319.     </tr>
  3320.  
  3321.         <tr $add>
  3322.             <td  width=\"140\" height=\"29\" >&nbsp;</td>
  3323.             <td>{$lang['add_metatags']}<a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang['hint_metas']}', this, event, '220px')\">[?]</a></td>
  3324.         </tr>
  3325.  
  3326.         <tr $add>
  3327.             <td  width=\"140\" height=\"29\"  style=\"padding-left:5px;\">{$lang['meta_title']}</td>
  3328.             <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>
  3329.         </tr>
  3330.         <tr $adt>
  3331.             <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['meta_descr']}:<br><i>({$lang['meta_descr_max']})</i></td>
  3332.             <td><textarea type=\"text\" name=\"descr$i$channel_id\" id=\"autodescr$i$channel_id\" style=\"width:388px;height:70px;\" >{$descr}</textarea>
  3333.         </td>
  3334.         </tr>
  3335.         <tr $adw>
  3336.             <td width=\"140\" height=\"29\" style=\"padding-left:5px;\">{$lang['meta_keys']}:<br><i>({$lang['meta_descr_max']})</i></td>
  3337.             <td><textarea name=\"keywords$i$channel_id\" id='keywords$i$channel_id' style=\"width:388px;height:70px;\">{$key_words}</textarea>
  3338.  
  3339.             </td>
  3340.         </tr>
  3341. </table>
  3342. </div>
  3343. </td>
  3344. </tr>
  3345. ";
  3346. echo "<input type=\"hidden\" name=\"news_link_$i$channel_id\" value=\"$news_link\">";
  3347. echo "
  3348. <tr>
  3349.     <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>&uarr; {$lang_grabber['contr']} &uarr;</font></a></td>
  3350.     </tr>
  3351. </table>
  3352. <div class=\"hr_line\"></div>
  3353. </div>
  3354. </td>
  3355. </tr>
  3356. </table>
  3357.      <table cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">
  3358.      <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=8></td></tr>
  3359.      </table>";
  3360. ++$i;
  3361. ++$news_count;
  3362. ++$news_per_channel;
  3363. ++$news_str_channel;
  3364. continue;
  3365. }else{echo "<table width=\"100%\">
  3366.     <tr class=\"navigation\">
  3367.         <td style=\"padding:4px\" align=\"left\" >{$news_tit}</td>
  3368.         <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
  3369.         <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
  3370.         </table>";}
  3371. }else{
  3372. if ($full_allow_news){
  3373. echo "<table width=\"100%\">
  3374.     <tr class=\"navigation\">
  3375.         <td style=\"padding:4px\" align=\"left\" >{$news_title}</td></td>
  3376.         <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
  3377.         <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
  3378.         </table>";}else{
  3379. echo "<table width=\"100%\">
  3380.     <tr class=\"navigation\">
  3381.         <td style=\"padding:4px\" align=\"left\" >{$news_title}</td></td>
  3382.         <td align=\"right\" > {$lang_grabber['filer_news']}</td></tr>
  3383.         <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
  3384.         </table>";
  3385. }
  3386. }
  3387. }else{echo "<table width=\"100%\">
  3388.     <tr class=\"navigation\">
  3389.         <td style=\"padding:4px\" align=\"left\" >{$news_tit}</td>
  3390.         <td align=\"right\" > {$lang_grabber['intus_dabase']}</td></tr>
  3391.         <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>
  3392.         </table>";}
  3393. }
  3394. if ($news_count == 1)
  3395. {
  3396. echo '<div align="center" class="navigation">- '.$lang_grabber['no_news'].' -</div>';
  3397. }
  3398. $str = $news_str_channel -1;
  3399. if ($cv != 0 and $rss == 0)
  3400. {
  3401. if ($str == 1) $now = $lang_grabber['post_one'];elseif($str <4 ) $now = $lang_grabber['news_sm'];else $now = $lang_grabber['post_big'];
  3402. if ($str == 0)
  3403. {
  3404. echo '<font color="#339900">- '.$lang_grabber['no_news'].' -</font>';
  3405. }else{
  3406. echo '
  3407.     <table cellpadding="4" cellspacing="0">
  3408.     <tr><td class="navigation" style="padding:4px">
  3409.      <font color="green">'.$lang_grabber['yes_news'].'<b>'.$str.'</b> '.$now.'</font>
  3410.     </td></tr>
  3411.     </table>';}
  3412. }
  3413. }
  3414. }
  3415. $kol = $news_per_channel -1 ;
  3416. echo '  <input type="hidden" name="news-per-channel-'.$channel_id .'"   value="'.$news_per_channel .'" />
  3417.     <table cellpadding="4" cellspacing="0">
  3418.     <tr><td class="navigation" style="padding:4px">
  3419.      '.$lang_grabber['yes_news'].' <b>'.$kol .'</b> '.$lang_grabber['post_big'].'
  3420.     </td></tr>
  3421.     </table>
  3422.     </fieldset>';
  3423. continue;
  3424. }
  3425. $db->free();
  3426. $categories_list = categorynewsselection (0,0);
  3427. echo '<br/>';
  3428. unterline ();
  3429. if( function_exists('memory_get_peak_usage') ) {
  3430. $mem_usage = memory_get_peak_usage(true);
  3431. if ($mem_usage <1024)
  3432. echo $mem_usage.' bytes';
  3433. elseif ($mem_usage <1048576)
  3434. $memory_usage = round($mem_usage/1024,2).' kb';
  3435. else
  3436. $memory_usage = round($mem_usage/1048576,2).' mb';
  3437. }
  3438. $kolv = $news_count -1 ;
  3439. echo '  <table cellpadding="0" cellspacing="0" width="100%" border=0>
  3440.     <tr >
  3441.     <td class="navigation" style="padding:0px">
  3442.     '.$lang_grabber['news_all'].': <b>'.$kolv .'</b><br /> '.$lang_grabber['mem_gr'].' ~ '.$memory_usage.'
  3443.     </td>
  3444.     <td align="right" style="padding:4px;">
  3445.      '.$lang_grabber['gl_val'].':
  3446.      <select name="category" id="category" onChange="check_cat();" class="edit">
  3447.      '.$categories_list .'
  3448.      </select></td>';
  3449. if($dnast[28] == 1 and (@file_exists(ENGINE_DIR.'/modules/twitter.php') or @file_exists(ENGINE_DIR.'/modules/socialposting/posting.php')))
  3450. {
  3451. 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'].')">';
  3452. }else{echo "<td width=\"0px\" align=\"right\"></td>";}
  3453. if($dnast[26] == 1 and @file_exists(ENGINE_DIR .'/inc/crosspost.addnews.php'))
  3454. {
  3455. 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'].')">';
  3456. }else{echo "<td width=\"0px\" align=\"right\"></td>";}
  3457. if ($dop_sort[3] == 1 and @file_exists ($rss_plugins.'sinonims.php')){
  3458. 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'].')">';
  3459. }else{echo "<td width=\"0px\" align=\"right\"></td>";}
  3460. echo '</td>
  3461.         <td class="bd0" align="right">
  3462.     <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>
  3463.         <td class="bd0"  align="right">
  3464.     <input  type="checkbox" name="approve"  id="approve"    onClick="check_all(\'mod\', this.checked);" title="'.$lang_grabber['val_mod'].' ('.$lang_grabber['val_all'].')"></td>
  3465.         <td class="bd0"  align="right">
  3466.     <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>
  3467.         <td class="bd0"  align="right">
  3468.     <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>
  3469.         <td class="bd0"  align="right">
  3470.     <input type=checkbox name="select_all" id="select_all" onClick="checkAll(document.news_form.sel)" title="'.$lang_grabber['val_all'].'">
  3471.     </td>
  3472. <td width="1%" >
  3473. </td>
  3474.     </tr>
  3475.     </table>
  3476.     <table cellpadding="4" cellspacing="0" width="100%">
  3477.     <tr>
  3478.     <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>
  3479.     <td align="right" style="padding:4px"><div class="quick" ></div>
  3480.    
  3481.     <button align="right" type="submit" class="btn btn-success" id="checks" disabled> - '.$lang_grabber['no_news_selected'].' - </button>
  3482.    
  3483.     </td>
  3484.     </tr>
  3485.     </table>
  3486. </td>
  3487.     </tr>
  3488. </table>
  3489. </div></form>
  3490. ';
  3491. echo "<form method=post name=\"addnews\" id=\"addnews\">
  3492. <input type=hidden name=\"mod\" value=\"preview\">
  3493. <input type=hidden name=\"title\" value=\"\">
  3494. <input type=hidden name=\"short_story\" value=\"\">
  3495. <input type=hidden name=\"full_story\" value=\"\">
  3496. <input type=hidden name=\"allow_br\" value=\"1\">
  3497. </form>";
  3498. echo"<script>document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['ajax_info']}';</script>";
  3499. unterline ();
  3500. closetable ();
  3501. echofooter ();
  3502. $db->close;
  3503. return 1;
  3504. }
  3505. if ($action=='config'){
  3506. include $rss_plugins.'config.php';
  3507. return 1;}
  3508. if( $action == 'upload') {
  3509. if (!is_dir($rss_plugins.'files')){
  3510. @mkdir($rss_plugins.'files',0777);
  3511. @chmod($rss_plugins.'files',0777);
  3512. }
  3513. $uploadfile = ENGINE_DIR.'/inc/plugins/files/proxy.txt';
  3514. if (@move_uploaded_file($_FILES['uploadfile']['tmp_name'],$uploadfile) and $_FILES['uploadfile']['type'] == 'text/plain')
  3515. {
  3516. 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>';
  3517. }else{
  3518. @unlink($uploadfile);
  3519. echo "<font color=\"red\">{$lang_grabber['eror']}! {$lang['images_uperr_3']}</font>";
  3520. }
  3521. exit();
  3522. }
  3523. if ($action == 'copy_channel')
  3524. {
  3525. $ids = $_POST['channel'];
  3526. if (count ($ids) == 0)
  3527. {
  3528. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  3529. return 1;
  3530. }
  3531. foreach ($ids as $id)
  3532. {
  3533. $copys = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3534. $copy = array();
  3535. $sql_result = $db->query ('SELECT url FROM '.PREFIX .'_rss');
  3536. $copys['xpos'] = $db->num_rows ($sql_result) +1;
  3537. $copys['id'] =  '';
  3538. $copys['title'] = '['.$lang_grabber['cops_canal'].'] '.$copys['title'];
  3539. foreach ($copys as $key =>$value) $copy[$key] = "'".$db->safesql(stripslashes($value))."'";
  3540. $copye = implode(',',$copy);
  3541. $db->query ('INSERT INTO '.PREFIX ."_rss VALUES ({$copye})");
  3542. if (trim ($copy['title']) != '')
  3543. {$title = stripslashes (strip_tags_smart ($copy['title']));
  3544. if (50 <strlen ($title))
  3545. {
  3546. $title = substr ($title,0,50) .'...';
  3547. }
  3548. }
  3549. else
  3550. {
  3551. $title = $lang_grabber['no_title'];
  3552. }
  3553. $mgs .= $lang_grabber['channel'].' '.$copy['xpos'].'<font color="green">"'.$title.' | '.$copy['url'].'"</font> <font color="red">'.$lang_grabber['copy_channel_ok'].'</font><br />';
  3554. }
  3555. msg ($lang_grabber['info'],$lang_grabber['channel_copy'],$mgs ,$PHP_SELF .'?mod=rss');
  3556. return 1;
  3557. }
  3558. if ($action == 'auto_channel')
  3559. {
  3560. $ids = $_POST['channel'];
  3561. if (count ($ids) == 0)
  3562. {
  3563. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  3564. return 1;
  3565. }
  3566. foreach ($ids as $id)
  3567. {
  3568. $auto = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3569. $db->query ('UPDATE '.PREFIX ."_rss SET allow_auto = 1 WHERE id ='$id'");
  3570. if (trim ($auto['title']) != '')
  3571. {
  3572. $title = stripslashes (strip_tags_smart ($auto['title']));
  3573. if (50 <strlen ($title))
  3574. {
  3575. $title = substr ($title,0,50) .'...';
  3576. }
  3577. }
  3578. else
  3579. {
  3580. $title = $lang_grabber['no_title'];
  3581. }
  3582. $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$auto['url'].'"</font> <font color="red">'.$lang_grabber['auto_channel_ok'].'</font><br />';
  3583. }
  3584. clear_cache ('cron.rss');
  3585. msg ($lang_grabber['info'],$lang_grabber['channel_auto_y'],$mgs,$PHP_SELF .'?mod=rss');
  3586. return 1;
  3587. }
  3588. if ($action == 'noauto_channel')
  3589. {
  3590. $ids = $_POST['channel'];
  3591. if (count ($ids) == 0)
  3592. {
  3593. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  3594. return 1;
  3595. }
  3596. foreach ($ids as $id)
  3597. {
  3598. $auto = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3599. $db->query ('UPDATE '.PREFIX ."_rss SET allow_auto = '0' WHERE id = '$id' ");
  3600. if (trim ($auto['title']) != '')
  3601. {
  3602. $title = stripslashes (strip_tags_smart ($auto['title']));
  3603. if (50 <strlen ($title))
  3604. {
  3605. $title = substr ($title,0,50) .'...';
  3606. }
  3607. }
  3608. else
  3609. {
  3610. $title = $lang_grabber['no_title'];
  3611. }
  3612. $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$auto['url'].'"</font> <font color="red">'.$lang_grabber['auto_channel_no'].'</font><br />';
  3613. }
  3614. clear_cache ('cron.rss');
  3615. msg ($lang_grabber['info'],$lang_grabber['channel_auto_n'],$mgs,$PHP_SELF .'?mod=rss');
  3616. return 1;
  3617. }
  3618. if ($action == 'del_channel')
  3619. {
  3620. $ids = $_POST['channel'];
  3621. if (count ($ids) == 0)
  3622. {
  3623. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  3624. return 1;
  3625. }
  3626. if($_POST['act'] == 'sav'){
  3627. $ids = explode ( ',',$ids);
  3628. foreach ($ids as $id)
  3629. {
  3630. $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3631. $db->query ('DELETE FROM '.PREFIX .('_rss WHERE id = \''.$id .'\''));
  3632. if (trim ($del['title']) != '')
  3633. {
  3634. $title = stripslashes (strip_tags_smart ($del['title']));
  3635. if (50 <strlen ($title))
  3636. {
  3637. $title = substr ($title,0,50) .'...';
  3638. }
  3639. }
  3640. else
  3641. {
  3642. $title = $lang_grabber['no_title'];
  3643. }
  3644. $mgs .= $lang_grabber['channel'].' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red">'.$lang_grabber['del_channel_ok'].'</font><br />';
  3645. }
  3646. clear_cache ('cron.rss');
  3647. msg ($lang_grabber['info'],$lang_grabber['del_channel'],$mgs,$PHP_SELF .'?mod=rss');
  3648. return 1;
  3649. }elseif($_POST['act'] != 'sav'){
  3650. echoheader('','');
  3651. opentable ($lang_grabber['del_channel']);
  3652. foreach ($ids as $id)
  3653. {
  3654. $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3655. if (trim ($del['title']) != '')
  3656. {
  3657. $title = stripslashes (strip_tags_smart ($del['title']));
  3658. if (50 <strlen ($title))
  3659. {
  3660. $title = substr ($title,0,50) .'...';
  3661. }
  3662. }
  3663. else
  3664. {
  3665. $title = $lang_grabber['no_title'];
  3666. }
  3667. $mgs .= ' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red"><br />';
  3668. }
  3669. $ids = implode ( ',',$ids);
  3670. echo '
  3671. <form method="post" name="del_channel" id="del_channel">
  3672. <input type="hidden" name="action" value="del_channel">
  3673. <input type="hidden" name="act" value="sav">
  3674. <table width="100%">
  3675.     <tr>
  3676.  <td align="center">
  3677. <b><font color="red">'.$lang_grabber['del_action'].'</font></b><br /><br />'.$mgs.'
  3678. </td>
  3679. </tr>
  3680.     <tr>
  3681.  <td align="center">
  3682.  <br />
  3683. <input type="hidden" name="channel" value="'.$ids.'">
  3684. <input type="submit" class="btn btn-success"   value=" '.$lang['opt_sys_yes'].' " ">
  3685. <input type="button" class="btn btn-warning"   value=" '.$lang['opt_sys_no'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
  3686. </td>
  3687.     </tr>
  3688. </table>
  3689. </form>';
  3690. closetable ();
  3691. echofooter ();
  3692. return 1;
  3693. }
  3694. }
  3695. if ($action == 'sort') {
  3696. $xpos = $_POST['xpos'];
  3697. $i=1;
  3698. foreach ($xpos as $k=>$v)
  3699. {
  3700. $db->query ('UPDATE '.PREFIX .('_rss set xpos='.((int)$v).' WHERE id = \''.((int)$k) .'\''));
  3701. $i++;
  3702. }
  3703. msg ($lang_grabber['info'],$lang_grabber['sort_channel'],$lang_grabber['sort_channel_ok'],$PHP_SELF .'?mod=rss');
  3704. return 1;}
  3705. if ($config['keygrab'] != $еmpty and $_SERVER['REMOTE_ADDR']!='127.0.0.1'){
  3706. if($_POST['act'] == 'sav'and $_POST['key']==$еmpty){
  3707. if(!array_key_exists('keygrab',$config)){
  3708. $keyz = array ('keygrab'=>$_POST['key'] );
  3709. $cont = $config +$keyz;
  3710. }else{
  3711. $config['keygrab'] = $_POST['key'];
  3712. unset($config['keyrss']);
  3713. $cont = $config;
  3714. }
  3715. openz(ENGINE_DIR.'/data/config.php',"<?php \n\n\$config = ".var_export ($cont,true).";\n?>");
  3716. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['key_add'],$PHP_SELF .'?mod=rss');
  3717. return 1;
  3718. }else{
  3719. if(!array_key_exists('keygrab',$config)){
  3720. $i_control = new image_controller ();
  3721. $result = $i_control->download_host ('http://rss-grabber.ru/eng/akk.php?host='.$_SERVER['HTTP_HOST'],$fg);
  3722. preg_match('!<div>(.*?)</div>!i',$result,$out);
  3723. }
  3724. if ($out[1] == '')
  3725. {
  3726. echoheader ($lang_grabber['eror'],'');
  3727. echo "<div align=\"center\">
  3728. <font color=\"red\">{$lang_grabber['no_lis']} !!!</font><br /><br />
  3729. <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 />
  3730. <form method=\"post\" >
  3731. <input type=\"hidden\" name=\"act\" value=\"sav\">
  3732.     <input size=\"35\" name=\"key\" value=\"\" /><br /><br />
  3733.     <span style=\"text-align: center;\">
  3734.     <input type=\"submit\" class=\"btn btn-primary\" value=\"{$lang_grabber['do_register']}\" />
  3735.     </span><br><br>
  3736. </form>
  3737. </div>";
  3738. echofooter ();
  3739. exit;
  3740. }else{
  3741. $keyz = array ('keygrab'=>$out[1]);
  3742. unset($config['keyrss']);
  3743. $cont = $config +$keyz;
  3744. openz(ENGINE_DIR.'/data/config.php',"<?php \n\n\$config = ".var_export ($cont,true).";\n?>");
  3745. }
  3746. };
  3747. }if ($action == 'sinonim') {
  3748. include $rss_plugins.'add.sin.php';
  3749. return 1;
  3750. }
  3751. if ($action == 'get_proxy') {
  3752. include $rss_plugins.'proxy.php';
  3753. if (get_proxy() == true) {
  3754. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['prox_up_ed'],$PHP_SELF .'?mod=rss&action=config');
  3755. }else{
  3756. $time = time() -filectime(ENGINE_DIR.'/inc/plugins/files/proxy.txt');
  3757. if ( $time <= 3600) $inf = $lang_grabber['up_time'].date('i',(1200-$time)).' min.';
  3758. else $inf = $lang_grabber['no_upd_prox'];
  3759. msg ($lang_grabber['info'],$lang_grabber['info'],$inf ,$PHP_SELF .'?mod=rss&action=config');
  3760. }
  3761. return 1;
  3762. }
  3763. if ($action == 'grups') {
  3764. include $rss_plugins.'add.grups.php';
  3765. return 1;
  3766. }
  3767. if ($action == 'addgrup_channel')
  3768. {
  3769. $ids = $_POST['channel'];
  3770. if (count ($ids) == 0)
  3771. {
  3772. msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['grab_msg_er'],'javascript:history.go(-1)');
  3773. return 1;
  3774. }
  3775. if($_POST['act'] == 'sav'){
  3776. $sql_result = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id = '{$_POST['rss_priv']}'");
  3777. if ($sql_result['title'] == '')$mgs = '<b><font color=green>'.$lang_grabber['y_c_trans'].'</font></b> <br /><br />';
  3778. else $mgs = ' <b><font color=green>'.$lang_grabber['yes_trans'].'</font> <font color=red>'.$sql_result['title'].'</font></b><br /><br />';
  3779. $ids = explode ( ',',$ids);
  3780. foreach ($ids as $id)
  3781. {
  3782. $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3783. $categoryes = explode ('=',$del['category']);
  3784. $ht = $categoryes[0].'='.$_POST['rss_priv'];
  3785. $db->query ('UPDATE '.PREFIX ."_rss SET category='$ht' WHERE id = '$id'");
  3786. if (trim ($del['title']) != '')
  3787. {
  3788. $title = stripslashes (strip_tags_smart ($del['title']));
  3789. if (50 <strlen ($title))
  3790. {
  3791. $title = substr ($title,0,50) .'...';
  3792. }
  3793. }
  3794. else
  3795. {
  3796. $title = $lang_grabber['no_title'];
  3797. }
  3798. $mgs .= ' <font color="#C0C0C0">"'.$title.' | '.$del['url'].'"</font><br />';
  3799. }
  3800. msg ($lang_grabber['info'],$lang_grabber['transfer_canal'],$mgs,$PHP_SELF .'?mod=rss');
  3801. return 1;
  3802. }elseif($_POST['act'] != 'sav'){
  3803. echoheader('','');
  3804. opentable ($lang_grabber['transfer_canal']);
  3805. $channel_inf = array();
  3806. $channel_color = array();
  3807. $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
  3808. $run[0] = '';
  3809. while ($channel_info = $db->get_row($sql_result)) {
  3810. if ($channel_info['osn'] == '0')$channel_inf[$channel_info['id']][$channel_info['id']] =  $channel_info['title'];
  3811. else $channel_inf[$channel_info['osn']][$channel_info['id']] = '-- '.$channel_info['title'];
  3812. }
  3813. foreach($channel_inf as $value)
  3814. {
  3815. if (count($value) != '0'){
  3816. foreach($value as $kkey=>$key)
  3817. {
  3818. $run[$kkey] = $key;
  3819. }
  3820. }
  3821. }
  3822. foreach ($ids as $id)
  3823. {
  3824. $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss WHERE id = '$id'");
  3825. if (trim ($del['title']) != '')
  3826. {
  3827. $title = stripslashes (strip_tags_smart ($del['title']));
  3828. if (50 <strlen ($title))
  3829. {
  3830. $title = substr ($title,0,50) .'...';
  3831. }
  3832. }
  3833. else
  3834. {
  3835. $title = $lang_grabber['no_title'];
  3836. }
  3837. $mgs .= ' <font color="green">"'.$title.' | '.$del['url'].'"</font> <font color="red"><br />';
  3838. }
  3839. $ids = implode ( ',',$ids);
  3840. echo '
  3841. <form method="post" name="addgrup_channel" id="addgrup_channel">
  3842. <input type="hidden" name="action" value="addgrup_channel">
  3843. <input type="hidden" name="act" value="sav">
  3844. <table width="100%">
  3845.     <tr>
  3846.  <td align="center">
  3847. <b><font color="red">'.$lang_grabber['you_tr_can'].':</font></b><br /><br />'.$mgs.'
  3848. <br /></td>
  3849. </tr>
  3850. <tr>
  3851. <td  class="hr_line" colspan=6></td>
  3852. </tr>
  3853.     <tr>
  3854.  <td align="center"><br />
  3855.  '.$lang_grabber['selected_grup'].': <select name="rss_priv" class="load_img">
  3856.     '.sel ($run,'').'
  3857.    </select><br />
  3858. <br /></td>
  3859. </tr>
  3860. <tr>
  3861. <td  class="hr_line" colspan=6></td>
  3862. </tr>
  3863.     <tr>
  3864.  <td align="center">
  3865.  <br />
  3866. <input type="hidden" name="channel" value="'.$ids.'">
  3867. <input type="submit" class="btn btn-success"   value=" '.$lang_grabber['mov_can'].' " ">
  3868. <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
  3869. </td>
  3870.     </tr>
  3871. </table>
  3872. </form>';
  3873. closetable ();
  3874. echofooter ();
  3875. return 1;
  3876. }
  3877. }
  3878. if ($action == 'ping') {
  3879. if ($_GET['deletey'])
  3880. {
  3881. openz(ENGINE_DIR.'/cache/system/pinglogs.txt',' ');
  3882. 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');
  3883. }elseif($_GET['delete']){
  3884. echoheader ('','');
  3885. opentable ('<b>'.$lang_grabber['ping_title'].'</b>');
  3886. 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\'" />
  3887. <input type="button" class="btn btn-danger"   value=" '.$lang['opt_sys_no'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping\'" />
  3888.    </center>';
  3889. closetable ();
  3890. echofooter ();
  3891. return 1;
  3892. 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');
  3893. }else{
  3894. echoheader ('','');
  3895. opentable ('<b>'.$lang_grabber['ping_title'].'</b>');
  3896. $arr=array_map('trim',file(ENGINE_DIR.'/cache/system/pinglogs.txt'));
  3897. if($arr[0]!='') $all=count($arr);
  3898. if($config_rss['ping_lognum']!='')$pnumber=$config_rss['ping_lognum'];else$pnumber=5;
  3899. echo "<div class=\"quick\">";
  3900. if (isset ($all)){echo ' <b>'.$lang_grabber['ping_writing_all'].' '.$all.' '.$lang_grabber['sht'].'</b><br/>';}else{echo $lang_grabber['cl_log_msg'];}
  3901. echo "</div>
  3902. <style type=\"text/css\" media=\"all\">
  3903. .listp {
  3904.     color: #999898;
  3905.     font-size: 11px;
  3906.     font-family: tahoma;
  3907.     padding: 5px;
  3908. }
  3909.  
  3910. .listp a:active,
  3911. .listp a:visited,
  3912. .listp a:link {
  3913.     color: green;
  3914.     text-decoration:none;
  3915.     }
  3916.  
  3917. .listp a:hover {
  3918.     color: blue;
  3919.     text-decoration: underline;
  3920.     }
  3921. </style>
  3922. <div class=\"listp\">";
  3923. $page=(isset($_GET['page'])) ?(int)$_GET['page'] : 1;
  3924. $num_pages=ceil($all/$pnumber);
  3925. $start=$page*$pnumber-$pnumber;
  3926. if ($page >$num_pages ||$page <1)
  3927. {
  3928. $page=1;
  3929. $start=0;
  3930. }
  3931. if ($all)
  3932. {
  3933. for ($i=$all-$start-1;$i>=$all-$start-$pnumber;$i--)
  3934. {
  3935. if (!isset($arr[$i])) break;
  3936. echo $all-$i.'. '.$arr[$i];
  3937. echo '<br/>';
  3938. }
  3939. echo '</div>';
  3940. if($num_pages == 1){
  3941. }else{
  3942. $npp_nav = "<div class=\"news_navigation\" style=\"margin-bottom:5px; margin-top:5px;\">";
  3943. for($i =1;$i <= $num_pages;$i++)
  3944. {
  3945. if ($i == 1 or $i == $num_pages or abs($i-$page) <10){
  3946. if ($i == $page)$npp_nav .= " <SPAN>$i</SPAN> ";
  3947. else $npp_nav .= ' <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ';
  3948. }else{
  3949. if ($page+10 == $i ) {
  3950. $npp_nav .= ' <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ... ';
  3951. }elseif ( $page-10 == $i ){
  3952. $npp_nav .= ' ... <a href="'.$PHP_SELF.'?mod=rss&action=ping&page='.$i.'">'.$i.'</a> ';
  3953. }else{
  3954. $npp_nav .= '';
  3955. }
  3956. }
  3957. }
  3958. $npp_nav .=    '
  3959.     <form action="" onsubmit="topage() return false;">
  3960.     <script type="text/javascript">
  3961.         function topage() {
  3962.             var loca = window.location+"";
  3963.             var locas = loca.split("page");
  3964.                 loca = locas[0];
  3965.                 locas = loca.split("'.$PHP_SELF .'");
  3966.             window.location.href = locas[0] + \''.$PHP_SELF .'?mod=rss&action=ping&page=\' + document.getElementById(\'num_page\').value;
  3967.         }
  3968.     </script>
  3969.         <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>
  3970.     </form>
  3971.     ';
  3972. $npp_nav .= '</div>';
  3973. echo $npp_nav;
  3974. }
  3975. }
  3976. 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\'" />
  3977. <input type="button" class="btn btn-warning" value=" '.$lang_grabber['out'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
  3978.    ';
  3979. closetable ();
  3980. echofooter ();
  3981. }
  3982. return 1;
  3983. }
  3984. if ($action == 'updates') {
  3985. include $rss_plugins.'update.php';
  3986. return 1;
  3987. }
  3988. if ($_GET['s'] == 'go')
  3989. {
  3990. $_POST['search'] = $_GET['s'];
  3991. $_POST['key'] = $_GET['k'];
  3992. $_POST['pol'] = $_GET['p'];
  3993. }
  3994. if ($action == 'search_k')
  3995. {
  3996. if (count($_POST['channel'])>1)msg ($lang_grabber['info'],$lang_grabber['info'],$lang_grabber['sel_one_canal'].'! ','javascript:history.go(-1)');
  3997. $_POST['search'] = 'go';
  3998. $can_s = $db->super_query ('SELECT url FROM '.PREFIX ."_rss WHERE id='".$_POST['channel'][0]."'");
  3999. $_POST['key'] = reset_url($can_s['url']);
  4000. $_POST['pol'] = 'url';
  4001. }
  4002. $search = "<form method=\"post\" >
  4003. <input type=\"hidden\" name=\"search\" value=\"go\">
  4004. {$lang_grabber['search']}
  4005.     <input size=\"25\" class=\"edit\" name=\"key\" value=\"".$_POST['key']."\" /> {$lang_grabber['po_news']}
  4006.      <select name=\"pol\">";
  4007. $search .= $_POST['pol'] == 'url'?"<option value=\"url\" selected \">{$lang_grabber['links']}</option>": "<option value=\"url\">{$lang_grabber['links']}</option>";
  4008. $search .= $_POST['pol'] == 'title'?"<option value=\"title\" selected \">{$lang_grabber['names']}</option>": "<option value=\"title\">{$lang_grabber['names']}</option>";
  4009. $search .= $_POST['pol'] == 'xdescr'?"<option value=\"xdescr\" selected \">{$lang_grabber['descrs']}</option>": "<option value=\"xdescr\">{$lang_grabber['descrs']}</option>";
  4010. $search .=  "</select>
  4011.     <input type=\"submit\" class=\"btn btn-primary\" value=\"{$lang_grabber['go_search']}\" />
  4012. </form>";
  4013. $vose = '
  4014. <style type="text/css">
  4015. .title_spoiler {
  4016.     color: #636363;
  4017.    
  4018.     border: 1px solid #bebebe;
  4019.     font-weight: bold;
  4020.     font-size: 9pt;
  4021.     padding: 2px;
  4022.     margin-top: 5px;
  4023. }
  4024. .text_spoiler {
  4025.    
  4026.     border: 1px solid #bebebe;
  4027.     border-top: 0;
  4028.     margin-bottom: 5px;
  4029. }
  4030.  
  4031. .title_spoil {
  4032.      color: #636363;
  4033.      
  4034.      border: 1px solid #C8E4FA;
  4035.      font-weight: bold;
  4036.      font-size: 9pt;
  4037.      padding: 2px;
  4038.      margin-top: 5px;
  4039.      margin-left: 0px;
  4040.      margin-right: 0px;
  4041. }
  4042. .text_spoil {
  4043.      
  4044.      border: 1px solid #C8E4FA;
  4045.      border-top: 0;
  4046.      margin-bottom: 5px;
  4047.      margin-left: 0px;
  4048.      margin-right: 0px;
  4049. }
  4050. .darkw{ background-color: #E8F9E6}
  4051. </style>
  4052. ';
  4053. $order_by = '';
  4054. $sort_rss = get_vars('rss.sort');
  4055. if( !$_POST['dlenewssortby'] ) {
  4056. if($sort_rss[0] == ''or $sort_rss[1] == '')$order_by = 'xpos DESC ,title DESC';
  4057. else $order_by = $sort_rss[0].' '.$sort_rss[1];
  4058. }else{$order_by = $_POST['dlenewssortby'].' '.$_POST['dledirection'];
  4059. $sort_rss = array(0 =>$_POST['dlenewssortby'],1 =>$_POST['dledirection']);
  4060. set_vars('rss.sort',$sort_rss);
  4061. }
  4062. $channel_inf = array();
  4063. $channel_info = array();
  4064. $grup_result = $db->query ('SELECT * FROM '.PREFIX .'_rss_category ORDER BY kanal asc');
  4065. $channel_inf[0] = '';
  4066. while ($channel_info = $db->get_row($grup_result)) {
  4067. $channel_inf[$channel_info['id']] = $channel_info['osn'];
  4068. $channel_color[$channel_info['id']] = $channel_info['color'];
  4069. }
  4070. if ($_POST['search'] == 'go'and $_POST['key'] != ''){
  4071. if($_POST['pol'] == '')$_POST['pol'] = 'url';
  4072. $sql_result = $db->query ('SELECT * FROM '.PREFIX .'_rss WHERE '.$_POST['pol']." like '%".$_POST['key']."%' ORDER BY $order_by");
  4073. $empty = $db->num_rows ($sql_result) == 0;
  4074. $hk = $db->num_rows ($sql_result);
  4075. }else{
  4076. $sql_result = $db->query ('SELECT * FROM '.PREFIX ."_rss ORDER BY $order_by");
  4077. $empty = $db->num_rows ($sql_result) == 0;
  4078. }
  4079. if ($empty)
  4080. {
  4081. $vose .= '
  4082. <form method="post" name="rss_form" id="rss_form">
  4083. <span id="channels"></span>
  4084. <table cellpadding="4" cellspacing="0" width="100%">
  4085.     <tr>
  4086.     <td height="40" valign="middle" align="center" class="navigation">- '.$lang_grabber['no_canals'].' -</td>
  4087.     </tr>
  4088.     </table>';
  4089. }else{
  4090. $vose .= '<input style="display:none" type="checkbox"  name="tables" id="tables" value="" />';
  4091. $vose .= "
  4092. <script>
  4093. function checkAll(field){
  4094.   nb_checked=0;
  4095.   for(n=0;n<field.length;n++)
  4096.     if(field[n].checked)nb_checked++;
  4097.     if(nb_checked==field.length){
  4098.       for(j=0;j<field.length;j++){
  4099.         field[j].checked=!field[j].checked;
  4100.         field[j].parentNode.parentNode.style.backgroundColor
  4101.           =field[j].backgroundColor==''?'#E8F9E6':'';
  4102.       }
  4103.     }else{
  4104.       for(j=0;j<field.length;j++){
  4105.         field[j].checked = true;
  4106.         field[j].parentNode.parentNode.style.backgroundColor
  4107.           ='#E8F9E6';
  4108.       }document.news_set_sort.check_all.checked=true;
  4109.     }
  4110. }
  4111. function selectRow(evnt,elmnt){
  4112.   var ch=elmnt.getElementsByTagName(\"TD\")[5].firstChild;
  4113.   tg = document.all?evnt.srcElement:evnt.target;
  4114.   if(tg.tagName!='INPUT')ch.checked=!ch.checked;
  4115.   elmnt.style.backgroundColor=ch.checked?'#E8F9E6':'';
  4116.  
  4117. document.channels(document.rss_form.channel.length);
  4118. }
  4119.  
  4120. function ShowOrHidegr( id, name ) {
  4121.       var item = document.getElementById(id);
  4122.       if ( document.getElementById('image-'+ id) ) {
  4123.         var image = document.getElementById('image-'+ id);
  4124.       } else {
  4125.         var image = null;
  4126.       }
  4127.       if (!item) {
  4128.         retun;
  4129.       }  else {
  4130.         if (item.style) {
  4131.             if (item.style.display == \"none\") {
  4132.                 item.style.display = \"table\";
  4133.                 image.src = './engine/inc/plugins/images/minus.gif';
  4134.                 var curCookie = id + \"=\" + '1';
  4135.             } else {
  4136.                 item.style.display = \"none\";
  4137.                 image.src = './engine/inc/plugins/images/plus.gif';
  4138.                 var curCookie = id + \"=\" + '';
  4139.             }
  4140.          } else{ item.visibility = \"show\"; }
  4141.       }
  4142. document.cookie = curCookie;
  4143. };
  4144.  
  4145. function ShowOrHidegrp( id, name ) {
  4146.       var item = document.getElementById(id);
  4147.       if ( document.getElementById('images-'+ id) ) {
  4148.         var images = document.getElementById('images-'+ id);
  4149.       }
  4150.       if (!item) {
  4151.         retun;
  4152.       }  else {
  4153.         if (item.style) {
  4154.             if (item.style.display == \"none\") {
  4155.                 item.style.display = \"table\";
  4156.                 images.src = './engine/inc/plugins/images/p-minus.gif';
  4157.                 var curCookie = id + \"=\" + '1';
  4158.             } else {
  4159.                 item.style.display = \"none\";
  4160.                 images.src = './engine/inc/plugins/images/p-plus.gif';
  4161.                 var curCookie = id + \"=\" + '';
  4162.             }
  4163.          } else{ item.visibility = \"show\"; }
  4164.       }
  4165. document.cookie = curCookie;
  4166. };
  4167.  
  4168. function ShowOrHideAll() {
  4169. var show = document.getElementById('tables');
  4170.     var item = document.getElementsByTagName('table');
  4171. for(n=0;n<item.length;n++){
  4172.       if (!item[n]) {
  4173.         retun;
  4174.       }  else {
  4175.         if (item[n].style.display ) {
  4176.  
  4177.       if ( document.getElementById('image-'+ item[n].id) ) {
  4178.         var image = document.getElementById('image-'+ item[n].id);
  4179.       }     else {
  4180.         var image = null;
  4181.       }
  4182.       if ( document.getElementById('images-'+ item[n].id) ) {
  4183.         var images = document.getElementById('images-'+ item[n].id);
  4184.       } else {
  4185.         var images = null;
  4186.       }
  4187. if (!show.checked) {
  4188.             if (item[n].style.display == \"none\") {
  4189.                 item[n].style.display = \"table\";
  4190.                 if(image)   image.src = '/engine/inc/plugins/images/minus.gif';
  4191.                 if(images) images.src = '/engine/inc/plugins/images/p-minus.gif';
  4192. var curCookie = item[n].id + \"=\" + '1';
  4193.             }
  4194.             }else {
  4195.                 item[n].style.display = \"none\";
  4196.                 if(image)image.src = '/engine/inc/plugins/images/plus.gif';
  4197.                 if(images) images.src = '/engine/inc/plugins/images/p-plus.gif';
  4198. var curCookie = item[n].id + \"=\" + '';
  4199.             }
  4200.          }
  4201.          else{ item[n].visibility = \"show\"; }
  4202.  
  4203.       }
  4204. document.cookie = curCookie;
  4205. }
  4206.  
  4207. if (show.checked)
  4208.     {
  4209.     show.checked = false;
  4210.     }else{
  4211.         show.checked = true;}
  4212.  
  4213. };
  4214.  
  4215.  
  4216.     function Addurls(numm) {
  4217. for(n=0;n<numm;n++){
  4218.      var tbl = document.getElementById('tblSample');
  4219.      var lastRow = tbl.rows.length;
  4220.      var iteration = lastRow+1;
  4221.  
  4222.      var tr = tbl.insertRow(lastRow);
  4223.  
  4224.      var td = tr.insertCell(0);
  4225.      td.setAttribute('style', 'padding: 0px 0px 2px 0px;');
  4226.      td.setAttribute('align', 'right');
  4227.  
  4228.      var el = document.createElement('input');
  4229.      el.setAttribute('type', 'text');
  4230.      el.setAttribute('name', 'str_url[]');
  4231.      el.setAttribute('size', '35');
  4232.      el.setAttribute('value', '');
  4233.  
  4234.          var newText = document.createTextNode(iteration);
  4235.  
  4236.      var elm = document.createElement('button');
  4237.      elm.setAttribute('disabled', 'disabled');
  4238.      elm.setAttribute('class', 'edit');
  4239.      elm.setAttribute('style', 'background:#9E9E9E;color:#fff;');
  4240.  
  4241.      var elem = document.createElement('input');
  4242.      elem.setAttribute('type', 'text');
  4243.      elem.setAttribute('disabled', 'disabled');
  4244.      elem.setAttribute('border', '0');
  4245.      elem.setAttribute('size', '1');
  4246.      elem.setAttribute('value', iteration);
  4247.          td.appendChild(elm);
  4248. elm.appendChild(newText);
  4249.          //td.appendChild(elem);
  4250.          td.appendChild(el);
  4251. }
  4252.     }
  4253.  
  4254.  
  4255.     function Removeurls() {
  4256.      var tbl = document.getElementById('tblSample');
  4257.      var lastRow = tbl.rows.length;
  4258.      if (lastRow > 1){
  4259.               tbl.deleteRow(lastRow - 1);
  4260.      }
  4261.     }
  4262. </script>";
  4263. if ($еmpty){
  4264. $vose .= news_sort_rss($_POST['dlenewssortby'],$_POST['dledirection']);
  4265. $vose .= '
  4266. <div>
  4267.     <form method="post" name="rss_form" id="rss_form">
  4268. <span id="channels"></span>
  4269.     <table cellpadding="6" align="center" cellspacing="0" width="100%" border="0">
  4270.     <tr>
  4271.     <td colspan="6">';
  4272. $vose .= '<div class="unterline"></div>';
  4273. $vose .= '</td></tr></table>';
  4274. $rss_kanal = array();
  4275. $cat_rss  = array();
  4276. while ($row = $db->get_row ($sql_result))
  4277. {
  4278. $rss_kan = '';
  4279. if (trim ($row['title']) != '')
  4280. {
  4281. $title = stripslashes (strip_tags_smart ($row['title']));
  4282. if (50 <strlen ($title))
  4283. {
  4284. $title = substr ($title,0,50) .'...';
  4285. }
  4286. }
  4287. else
  4288. {
  4289. $title = $lang_grabber['no_title'];
  4290. }
  4291. if ($row['xdescr']) {
  4292. $xdescr = htmlspecialchars($row['xdescr']);
  4293. if (strlen($xdescr)>50) {
  4294. $xdescr = substr($xdescr,0,50).'...';
  4295. }
  4296. }else {
  4297. $xdescr = '&nbsp;';
  4298. }
  4299. if ($row['allow_auto'] == 0){$auto = '';}else{$auto = '<font color=green><b>'.$lang['opt_sys_yes'].'</b></font>';}
  4300. if ($row['rss'] == 0){$rss = '<font color=blue>HTML</font>';}else{$rss = '<font color=red>RSS</font>';}
  4301. $row['url'] = stripslashes ($row['url']);
  4302. $row['descr'] = stripslashes ($row['descr']);
  4303. $categoryes = explode ('=',$row['category']);
  4304. $del=array();
  4305. if (trim($channel_color[intval($categoryes[1])]) == '') $channel_color[intval($categoryes[1])] = '#f2f2f2';
  4306. if (intval($categoryes[1]) != '0'){
  4307. if (intval($channel_inf[$categoryes[1]]) != '0') $style_grups = 'text_spoil" style ="border-color: '.$channel_color[intval($categoryes[1])].';"';
  4308. else $style_grups = 'text_spoiler';
  4309. }else{$style_grups = 'light';}
  4310. $rss_kan = '<tr class="'.$style_grups.'" onMouseOut=this.className="'.$style_grups.'"
  4311.        onMouseOver=this.className="highlight"
  4312.        onclick=selectRow(event,this)>
  4313.         <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>
  4314.         <td width="5%" style="padding:1px" align="center">'.$rss.'</td>
  4315.         <td width="6%" style="padding:1px" align="center">'.$auto.'</td>
  4316.         <td style="padding:4px">
  4317.         <a href="'.$row['url'] .'" target=\"_blank\">[i]</a>&nbsp;<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>
  4318.         <td style="padding:4px" align="center">'.$xdescr.'</td>
  4319.         <td width="3%"><input style="background-color: #ffffff; color: #ff0000;" title="'.$lang_grabber['val_post'].'" type="checkbox" name="channel[]" id="channel" value="'.$row['id'] .'" />
  4320.         </td>
  4321.      </tr>
  4322.      <tr>';
  4323. if (intval($categoryes[1]) != '0'and array_key_exists($categoryes[1],$channel_inf)) {
  4324. if (intval($channel_inf[$categoryes[1]]) != '0') $cat_rss[$channel_inf[$categoryes[1]]][$categoryes[1]][$row['id']] = $rss_kan;
  4325. else $cat_rss[$categoryes[1]][0][$row['id']] = $rss_kan;
  4326. }else{
  4327. $rss_kanal[$row['id']] = $rss_kan;
  4328. }
  4329. }
  4330. if (count($cat_rss) != '0')
  4331. {
  4332. $grups_rss = array();
  4333. foreach ($cat_rss as $papka =>$kanals){
  4334. $grups_r = '';
  4335. $del = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id= '".$papka."'");
  4336. $id_spoiler = spoiler( $del['title'] );
  4337. $vose .= "    <script type=\"text/javascript\">
  4338.     $(document).ready( function() {
  4339.        $(\"#ch_$id_spoiler\").click( function() {
  4340.             if($('#ch_$id_spoiler').attr('checked')){
  4341.                 $(\"#\" + $(this).attr('name') + \" input:checkbox:enabled\").attr('checked', true);
  4342.                 $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '#E8F9E6');
  4343.             } else {
  4344.                 $(\"#\" + $(this).attr('name') + \" input:checkbox\").attr('checked', false);
  4345.                 $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '');
  4346.             }
  4347.        });
  4348.     });
  4349. </script>";
  4350. $kol = '';
  4351. $kol = count($kanals,1) -count($kanals);
  4352. if  (count($kanals) == '1'and count($kanals[0]) >0){$kol = count($kanals,1) -count($kanals);}
  4353. else
  4354. {
  4355. $kols = count($kanals[0]) == 0 ?count($kanals):count($kanals) -1;
  4356. $kol = count($kanals,1) -count($kanals).'|'.$kols;
  4357. }
  4358. if (trim($del['color']) == '') $del['color'] = '#f2f2f2;';
  4359. if ($_COOKIE[$id_spoiler] != 1) {
  4360. $strp = 'style="display:none;background-color: '.$del['color'].';"';
  4361. $strp_i = 'src="./engine/inc/plugins/images/plus.gif"';
  4362. }else {
  4363. $strp = 'style="display:table;background-color: '.$del['color'].';"';
  4364. $strp_i = 'src="./engine/inc/plugins/images/minus.gif"';
  4365. }
  4366. $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.' />&nbsp;<a href="javascript:ShowOrHidegr(\''.$id_spoiler.'\', \'rss_sp_'.$papka.'\')">'.$del['title'].' ('.$kol.')</a>
  4367.  
  4368. <input type="checkbox"  name="'.$id_spoiler.'" id="ch_'.$id_spoiler.'" value="" alt="'.$lang_grabber['sel_all_can'].'" title="'.$lang_grabber['sel_all_can'].'"/>
  4369. </div>
  4370.  
  4371. </table>
  4372. <table id="'.$id_spoiler.'" name="rss_sp_'.$papka.'" cellpadding="6" align="center" cellspacing="0" width="100%" border="0" class="text_spoiler" '.$strp.' >';
  4373. ksort ($kanals);
  4374. foreach ($kanals as $papk =>$kanal){
  4375. if ($papk != 0){
  4376. $osn = $db->super_query ('SELECT * FROM '.PREFIX ."_rss_category WHERE id= '".$papk."'");
  4377. $id_spoil = spoiler( $osn['title'] );
  4378. $vose .= "    <script type=\"text/javascript\">
  4379.     $(document).ready( function() {
  4380.        $(\"#ch_$id_spoil\").click( function() {
  4381.             if($('#ch_$id_spoil').attr('checked')){
  4382.                 $(\"#\" + $(this).attr('name') + \" input:checkbox:enabled\").attr('checked', true);
  4383.                 $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '#E8F9E6');
  4384.             } else {
  4385.                 $(\"#\" + $(this).attr('name') + \" input:checkbox\").attr('checked', false);
  4386.                 $(\"#\" + $(this).attr('name') + \" tr\").css('background-color', '');
  4387.             }
  4388.        });
  4389.     });
  4390. </script>";
  4391. if (trim($osn['color']) == '') $osn['color'] = '#f2f2f2;';
  4392. if ($_COOKIE[$id_spoil] != 1) {
  4393. $strj = 'style="display:none;background-color: '.$osn['color'].';"';
  4394. $strj_i = 'src="./engine/inc/plugins/images/p-plus.gif"';
  4395. }else {
  4396. $strj = 'style="display:table;background-color: '.$osn['color'].';"';
  4397. $strj_i = 'src="./engine/inc/plugins/images/p-minus.gif"';
  4398. }
  4399. $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.' />&nbsp;<a href="javascript:ShowOrHidegrp(\''.$id_spoil.'\', \'rss_sp_'.$papk.'\')">'.$osn['title'].' ('.count($kanal).')</a>
  4400.  
  4401. <input type="checkbox" name="'.$id_spoil.'" id="ch_'.$id_spoil.'" value="" alt="'.$lang_grabber['sel_all_can'].'" title="'.$lang_grabber['sel_all_can'].'"/>
  4402. </div>
  4403. </table>
  4404. <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> ';
  4405. }
  4406. }
  4407. if (count($kanals[0]) >0)$grups_r .= implode('<td background="engine/skins/images/mline.gif" height=1 colspan=8></td></tr>',$kanals[0]).'</table> ';
  4408. $grups_rss[$del['kanal']]= $grups_r;
  4409. }
  4410. ksort ($grups_rss);
  4411. $vose .= implode($grups_rss);
  4412. }
  4413. }
  4414. }
  4415. 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>';
  4416. $vose .= '<table cellpadding="4" width="100%"><tr><td colspan="6"><br/>';
  4417. $vose .= '<div class="unterline"></div>';
  4418. $vose .= '  </td></tr> <tr>
  4419.     <td colspan="5">
  4420.     <table width="100%" border="0">
  4421.      <tr>
  4422. <td align="left" width="270">';
  4423. if ($_POST['search'] == 'go'and $_POST['key'] != ''){
  4424. $vose .= '
  4425. <input type="button" class="btn btn-warning" value="'.$lang_grabber['go_index'].'" onClick="document.location.href = \''.$PHP_SELF .'?mod=rss\'" />
  4426. ';
  4427. }
  4428. $vose .= '
  4429.         <input type="button" class="btn btn-success" value="'.$lang_grabber['add_canal'].'" onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=channel&subaction=add\'" />
  4430.      </td>
  4431.      <td style="padding:2px" align="right" colspan="2">'.$lang['xfield_xact'].':
  4432.  
  4433.      <select id="ui_element" name="action">
  4434.         <option value="scan" selected style="background: #EFEFEF;">'.$lang['rss_news'].'</option>
  4435.         <option value="scan1">'.$lang_grabber['rss_news'].' '.$lang_grabber['post_sm'].'</option>
  4436.         <option value="scan3">'.$lang_grabber['rss_news'].' 3 '.$lang_grabber['post_sm'].'</option>
  4437.         <option value="scan5">'.$lang_grabber['rss_news'].' 5 '.$lang_grabber['post_big'].'</option>
  4438.         <option value="scan10">'.$lang_grabber['rss_news'].' 10 '.$lang_grabber['post_big'].'</option>
  4439.         <option value="scan15">'.$lang_grabber['rss_news'].' 15 '.$lang_grabber['post_big'].'</option>
  4440.         <option value="scan20">'.$lang_grabber['rss_news'].' 20 '.$lang_grabber['post_big'].'</option>';
  4441. 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>';}
  4442. $vose .= '<option value="auto_channel" style="background: #EFEFEF; color:green">'.$lang_grabber['channel_auto_y'].'</option>
  4443.         <option value="noauto_channel">'.$lang_grabber['channel_auto_n'].'</option>
  4444.         <option value="copy_channel" style="background: #EFEFEF; color:orange; font: bold 110% ;">'.$lang_grabber['channel_copy'].'</option>
  4445.         <option value="sort" style="background: #EFEFEF; color:blue">'.$lang_grabber['channel_sort'].'</option>
  4446.         <option value="del_channel" style="background: #EFEFEF; color:red">'.$lang_grabber['channel_del'].'</option>
  4447. <option value="save_channel" style="background: #EFEFEF;">'.$lang_grabber['expo'].'</option>
  4448. <option value="save_up_channel" style="background: #EFEFEF;">'.$lang_grabber['impo'].'</option>
  4449.         <option value="addgrup_channel" style="background: #EFEFEF; color:red">'.$lang_grabber['move_grup'].'</option>
  4450. <option value="editgrup_channel">'.$lang_grabber['batch_edit'].'</option>
  4451. <option value="search_k">'.$lang_grabber['sel_cans'].'</option>
  4452.      </select></td>
  4453.      <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'].'
  4454.      </td>
  4455.      <td align="right" rowspan="2" width="50">
  4456.         <input type="submit" class="btn btn-warning btn-mini" style="height: 40px;" value="'.$lang_grabber['b_start'].'"/>
  4457.      </td>
  4458.      </tr>
  4459.      <tr>     <td align="left" rowspan="2" colspan="3"  class="navigation">'.$lang_grabber['help_run'].'</td>
  4460. <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>
  4461. </tr>
  4462.     </table>
  4463.      <tr>
  4464. <td style="padding:2px 0px 2px 2px" colspan="3" align="right" class="navigation" width="150">
  4465.  
  4466. <table id="tblSample" class="upload">
  4467. <tr>
  4468. <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=""/>
  4469. </td>
  4470. </tr>
  4471. </table>
  4472. <div>
  4473. <input type=button class="btn btn-sin" value=\' + 1 \'  title="'.$lang_grabber['grab_links_1'].'" onClick="Addurls(1);return false;">
  4474. <input type=button class="btn btn-sin" value=\' + 5 \'  title="'.$lang_grabber['grab_links_5'].'" onClick="Addurls(5);return false;">
  4475. <input type=button class="btn btn-sin" value=\' + 10 \'  title="'.$lang_grabber['shr_max'].'" onClick="Addurls(10);return false;">
  4476. </div>
  4477. </td>
  4478. </tr>
  4479.     </td></tr>
  4480.     </table></form>';
  4481. if (count($cat_rss) != '0') $spoi = '  <a href="javascript:ShowOrHideAll()"><font color=orange>&uarr; '.$lang_grabber['shr_max'].' &darr;</font></a>';
  4482. echoheader ('','');
  4483. check_disable_functions ();
  4484. opentable ($lang_grabber['rss_list'].$spoi,$tr.$search);
  4485. if ($_POST['search'] == 'go'and $_POST['key'] != ''){
  4486. echo ' <table width="100%" border=0>
  4487.     <tr><td><font color="#999898">'.$lang_grabber['you_sear'].': <font color="green">'.$_POST['key'].'</font><br />
  4488. '.$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>';
  4489. }
  4490. echo $vose;
  4491. closetable ();
  4492. opentable ();
  4493. tableheader ($lang_grabber['tabs_extra']);
  4494. echo "
  4495. <script>
  4496.  
  4497. var ajax = new dle_ajax();
  4498.  
  4499. function check_updates ( ){
  4500.     document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
  4501. document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
  4502.     var varsString = \"moduleversion={$module_info['version']}\";
  4503.     ajax.setVar(\"modulebuild\", '{$module_info['build']}');
  4504.     ajax.requestFile = \"engine/ajax/grabber.php\";
  4505.     ajax.element = 'main_box';
  4506.     ajax.method = 'POST';
  4507.  
  4508.     ajax.sendAJAX(varsString);
  4509.  
  4510.     return false;
  4511. }
  4512.  
  4513. function grabber_updates_down ( ){
  4514.     document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
  4515. document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
  4516.     var varsString = \"key={$config['keygrab']}\";
  4517.     ajax.setVar(\"ver\", '{$module_info['version']}');
  4518.     ajax.setVar(\"bul\", '{$module_info['build']}');
  4519.     ajax.requestFile = \"engine/ajax/update_grabber.php\";
  4520.     ajax.element = 'main_box';
  4521.     ajax.method = 'POST';
  4522.  
  4523.     ajax.sendAJAX(varsString);
  4524.  
  4525.     return false;
  4526. }
  4527. function grabber_updates (dwn){
  4528.     document.getElementById( 'loading-layer-text' ).innerHTML = '{$lang['dle_updatebox']}';
  4529. document.getElementById( 'main_box' ).innerHTML = '{$lang_grabber['con_serv']}';
  4530.     var varsString = \"url=dwn\";
  4531.     ajax.setVar(\"dwn\", dwn);
  4532.     ajax.requestFile = \"engine/ajax/update_grabber.php\";
  4533.     ajax.element = 'main_box';
  4534.     ajax.method = 'POST';
  4535.  
  4536.     ajax.sendAJAX(varsString);
  4537.  
  4538.     return false;
  4539. }
  4540. function closead()
  4541. {
  4542.     var obj = document.getElementById( \"ad\" );
  4543.     obj.style.visibility = \"hidden\";
  4544. }
  4545. </script>";
  4546. echo '
  4547.  
  4548.  
  4549. <table width="100%" cellpadding="4">
  4550.     <tr><td align="left">
  4551.         <input type="button" class="btn btn-primary" value=" '.$lang_grabber['glob_options'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=config\'" />
  4552.  
  4553. <input type="button" class="btn btn-info" value=" '.$lang_grabber['grups'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=grups\'" />';
  4554. if (@file_exists (ENGINE_DIR .'/inc/plugins/sinonims.php') )
  4555. {echo'
  4556. <input type="button" class="btn btn-inverse" value=" '.$lang_grabber['sinonims_bottom'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=sinonim\'" />';
  4557. }echo'
  4558. </td><td id="main_box" align=right>
  4559. <input onclick="check_updates(); return false;" class="btn btn-danger" type="button" value=" '.$lang_grabber['update_bottom'].' ">
  4560. </td>
  4561. <td align=right>
  4562. <input type="button" class="btn btn-sin" value=" '.$lang_grabber['ping_button'].' " onClick="document.location.href = \''.$PHP_SELF .'?mod=rss&action=ping\'" />
  4563.      </td></tr>
  4564.     <tr>
  4565.         <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 &copy created by Andersoni. All rights reserved.</td>
  4566.     </tr>
  4567.  </table>
  4568.  
  4569.  ';
  4570. closetable ();
  4571. echofooter ();
  4572. $db->close;
  4573. ;
  4574. function script_br($scr,$txt)
  4575. {global $db;
  4576. $txt = str_replace( '<br>',"\n",$txt );
  4577. $txt = str_replace( '<br />',"\n",$txt );
  4578. $txt = str_replace( '<BR>',"\n",$txt );
  4579. $txt = str_replace( '<BR />',"\n",$txt );
  4580. return stripslashes('<script'.$scr.'>'.$txt.'</script>');
  4581. }
  4582. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement