function save_news($news, $site_data_array, $reversed_url)
{
    echo '******************************';
    pr($news);
    //exit;
    global $conn;
    $reversed_url = reverse_tinyurl($reversed_url);
    if (strpos($reversed_url, "bit.ly") !== FALSE || strpos($reversed_url, "news.google.com") !== FALSE || strpos($reversed_url, "feedproxy.google.com") !== FALSE || strpos($reversed_url, "alanba.com.kw") !== FALSE || strpos($reversed_url, "trib.al") !== FALSE || strpos($reversed_url, "fb.me") !== FALSE || strpos($reversed_url, "goo.gl") !== FALSE || strpos($reversed_url, "t.co") !== FALSE || strpos($reversed_url, "eel.la") !== FALSE || strpos($reversed_url, "ow.ly") !== FALSE || strpos($reversed_url, "shar.es") !== FALSE) {
        $reversed_url = reverse_tinyurl($reversed_url);
    }
    $reversed_url = str_replace("'", "", $reversed_url);
    $reversed_url = str_replace('"', "", $reversed_url);
    // echo($reversed_url);  exit;
    $title = $news['title'];
    $title = preg_replace('|http?://www\\.[a-z\\.0-9\\/]+|i', '', $title);
    $title = preg_replace('|https?://www\\.[a-z\\.0-9\\/]+|i', '', $title);
    $title = preg_replace('|https?://t\\.[a-z\\.0-9\\/]+|i', '', $title);
    $title = preg_replace('|http?://t\\.[a-z\\.0-9\\/]+|i', '', $title);
    $title = str_replace("I added a video to a @YouTube", "", $title);
    $title = str_replace("I added a video to", "", $title);
    $title = str_replace("playlist", "", $title);
    $title = str_replace("\"", "", $title);
    $title = str_replace("'", "", $title);
    if ($title == "") {
        $title = @$news['alt_title'];
    }
    $desc = trim($news['desc']);
    $desc = str_replace("\"", "", $desc);
    $desc = str_replace('"', "", $desc);
    $desc = str_replace("'", "", $desc);
    //kora
    $desc = str_replace('var addthis_config={"data_track_clickback":true};', "", $desc);
    $desc = str_replace('Get Al Jaras Updates with the most read and shared stories sent directly to you email <br /><br />', "", $desc);
    $desc = str_replace('This site uses cookies', "", $desc);
    $desc = str_replace('By clicking allow you are agreeing to our use of cookies.', "", $desc);
    $desc = str_replace('By clicking allow you are agreeing to our use of cookies', "", $desc);
    $desc = str_replace('Be a Citizen and discover all the benefits of being a City member.', "", $desc);
    $desc = str_replace('Be a Citizen and discover all the benefits of being a City member', "", $desc);
    $desc = str_replace('Find out more', "", $desc);
    $desc = str_replace('================ هـ ع.', "", $desc);
    $desc = str_replace('================ هـ ع', "", $desc);
    $desc = str_replace('1599998474121px; line-height: 1<br />3em;>', "", $desc);
    $desc = str_replace('<!-- Plugins: BeforeDisplayContent -->              <!-- K2 Plugins: K2BeforeDisplayContent -->                                 <!-- Item introtext -->       <div class=itemIntroText>           <h3 style=text-align: justify;><span style=font-size: 12<br />1599998474121px; line-height: 1<br />3em;>', "", $desc);
    $desc = str_replace('googletag<br />display(div-gpt-ad-mpu);', "", $desc);
    $desc = str_replace('ومقالات الرأي المنشرة علي حصري', "", $desc);
    $desc = str_replace('اشترك بالنشرة البريدية للمدونة لتصلك أخر الاخبار', "", $desc);
    $desc = str_replace('قم بإضافة تطبيق الموجز على متصفح كروم (Chrome) لتسهيل متابعة وقراءة اخر الاخبار من موقع الموجز<br /> مع هذا التطبيق ستكون على علم بأخر الاخبار المصرية والعربية والعالمية <br /><br />', "", $desc);
    $desc = str_replace('قم بإضافة تطبيق الموجز على متصفح كروم (Chrome) لتسهيل متابعة وقراءة اخر الاخبار من موقع الموجز<br /> مع هذا التطبيق ستكون على علم بأخر الاخبار المصرية والعربية والعالمية', "", $desc);
    $desc = str_replace('<br /><br /> محتوى حبر مرخص برخصة المشاع الإبداعي<br /> يسمح بإعادة نشر المواد بشرط الإشارة إلى المصدر بواسطة رابط (hyperlink)، وعدم إجراء تغييرات على النص، وعدم استخدامه لأغراض تجارية <br /><br />', "", $desc);
    $desc = str_replace('error was encountered while trying to use an ErrorDocument to handle the request', "", $desc);
    $desc = str_replace('To get best possible experiance using our website we recommend that you upgrade to a newer version or other web browser', "", $desc);
    $desc = str_replace('A list of the most popular web browsers can be found below', "", $desc);
    $desc = str_replace(' للتحقق ', "", $desc);
    $desc = str_replace('�', "", $desc);
    $title = str_replace('�', "", $title);
    //general
    $desc = str_replace('developer', "", $desc);
    $desc = str_replace('Developer', "", $desc);
    $desc = str_replace('API', "", $desc);
    $desc = str_replace('Api', "", $desc);
    $desc = str_replace('Terms', "", $desc);
    $desc = str_replace('Conditions', "", $desc);
    $desc = str_replace('Privacy', "", $desc);
    $desc = str_replace('Policy', "", $desc);
    $desc = str_replace('Copyright', "", $desc);
    //  $desc = str_replace('right', "", $desc);
    //  $desc = str_replace('left', "", $desc);
    //  $desc = str_replace('position', "", $desc);
    // $desc = str_replace('RTL', "", $desc);
    //  $desc = str_replace('LTR', "", $desc);
    // $desc = str_replace('rtl', "", $desc);
    // $desc = str_replace('ltr', "", $desc);
    // $desc = str_replace('pt', "", $desc);
    // $desc = str_replace('0001', "", $desc);
    //  $desc = str_replace('>', "", $desc);
    //$desc = str_replace('<', "", $desc);
    //$desc = str_replace('dir', "", $desc);
    //$desc = str_replace(';', "", $desc);
    $desc = str_replace('stLight<br />options({publisher: 2683a2c2-035f-4bce-b2c4-26b1a403e01a, doNotHash: false, doNotCopy: false, hashAddressBar: false});', "", $desc);
    $desc = str_replace('Lorem Ipsum is simply dummy text of the printing and typesetting industry<br /> Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took', "", $desc);
    $desc = str_replace('إضغط على الصورة لمشاهدة الحجم الكامل', "", $desc);
    $desc = str_replace('ظ‡ط§ظ… - ط§ظ„ط±ظٹط§ط¶', "", $desc);
    $desc = str_replace('ظ‡ط§ظ… - ط§ظ„ط±ظٹط§ط', "", $desc);
    $desc = str_replace('
Not All tags are allowed! Please remove html tags from your comments and try again', "", $desc);
    $desc = str_replace('Not All tags are allowed! Please remove html tags from your comments and try again', "", $desc);
    $desc = str_replace('Powered by Dimofinf cms Version 3', "", $desc);
    $desc = str_replace('0Copyright© Dimensions Of Information Inc.', "", $desc);
    $desc = str_replace('404', "", $desc);
    $desc = str_replace('الرئيسية | الصور |  المقالات |  البطاقات | الملفات  | الجوال  |الأخبار |الفيديو |الصوتيات |راسلنا |للأعلى', "", $desc);
    $desc = str_replace('الرئيسية | الصور |&nbsp; المقالات |&nbsp; البطاقات |&nbsp;الملفات&nbsp; |&nbsp;الجوال &nbsp;|الأخبار |الفيديو |الصوتيات |راسلنا |للأعلى', "", $desc);
    $desc = str_replace('جميع الحقوق محفوظة لصحيفة الخبر تايمز ولا يسمح بالنسخ أو الاقتباس إلا بموافقه خطيه من إدارة الصحيفة', "", $desc);
    $desc = str_replace('function GoogleLanguageTranslatorInit() { new google', "", $desc);
    $desc = str_replace('translate', "", $desc);
    $desc = str_replace('كافة الحقوق محفوظة لـ scbnews<br />com &copy; 1436 التصميم بواسطة :ALTALEDI NET Powered by Dimofinf cms Version 3<br />0<br />0Copyright&copy; Dimensions Of Information Inc <br /><br />', "", $desc);
    $desc = str_replace('كافة الحقوق محفوظة لـ scbnews.com &copy; 1436 التصميم بواسطة :ALTALEDI NET Powered by Dimofinf cms Version 3.0.0Copyright&copy; Dimensions Of Information Inc', "", $desc);
    $desc = str_replace('باب.كوم جميع الحقوق محفوظة © 2015 شركة باب العالمية للخدمات المتخصصة – باب حاصلة على ترخيص وزارة الثقافة والإعلام', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقع يابلادي. باستخدام هذا الموقع، فإنك توافق على سياستنا الخاصة بالحريات الشخصية، لمعرفة المزيد إظغط هناX', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقع يابلادي. باستخدام هذا الموقع، فإنك توافق على سياستنا الخاصة بالحريات الشخصية، لمعرفة المزيد إظغط هنا', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقع يابلادي', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقعنا', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقعنا. باستخدام هذا الموقع، فإنك توافق على سياستنا الخاصة بالحريات الشخصية، لمعرفة المزيد إظغط هناX', "", $desc);
    $desc = str_replace('الكوكيز يتيح لك العديد من الميزات لتعزيز تجربتك على موقعنا. باستخدام هذا الموقع، فإنك توافق على سياستنا الخاصة بالحريات الشخصية، لمعرفة المزيد إظغط هنا', "", $desc);
    $desc = str_replace('يمكنك الآن الاشتراك في القائمة البريدية و سوف يصلك جديد الأخبار على البريد الإلكتروني الخاص بكم', "", $desc);
    $desc = str_replace('يمكنك الآن الاشتراك في خدمة الرسائل القصيرة SMS , لتصلك آخر الأخبار على نقالك أولاً بأول', "", $desc);
    $desc = str_replace('Copyright © 2015 www.alnilin.com All Rights Reserved.', "", $desc);
    $desc = str_replace('موقع النيلين هو وجهتك الاولى للاخبار المحلية والعالمية ، الصور والفيديو والمنوعات ،الوظائف ، والتسويق ، الاعلانات', "", $desc);
    $desc = str_replace('var initId = 880103; function changeVideo(id){ if(id == initId){ return false; } $.ajax({ url: http://www.charlesayoub.com/get-video-embed/+id+/side, beforeSend: function(){ $(#videoLoader).show(); $(#playSection).css({opacity:0.5}); }, success: function(data) { $(#videoLoader).hide(); $(#playSection).css({opacity:1}); $(#playSection).html(data); initId = id; } }); }', "", $desc);
    $desc = str_replace('googletag.defineSlot(5308/ab_ar, [300,250], banner300x250).addService(googletag.pubads()); googletag.pubads().enableSyncRendering();
googletag.enableServices(); var wd = 300; var ht = 250; var divPart1 = banner+wd; var divPart2=x+ht; // var divPart1 = banner+300; // var divPart2=x+250; if(wd == 1 && ht ==2){ googletag.display(divPart1+divPart2+-oop); }else{ googletag.display(divPart1+divPart2); }', "", $desc);
    $desc = str_replace('ومضة هي منصة تعنى بالاستثمار وبدعم رواد الأعمال في منطقة الشرق الأوسط وشمال إفريقيا.', "", $desc);
    $desc = str_replace('© جميع الحقوق محفوظة لقناة العربية 2015 Provided by SyndiGate Media Inc. (Syndigate.info).', "", $desc);
    $desc = str_replace('© جميع الحقوق محفوظة لقناة العربية 2016 Provided by SyndiGate Media Inc. (Syndigate.info).', "", $desc);
    $desc = str_replace('© جميع الحقوق محفوظة لقناة العربية 2017 Provided by SyndiGate Media Inc. (Syndigate.info).', "", $desc);
    $desc = str_replace('$(".more").disableTextSelect(); $(function(){ $(".more-selected").disableTextSelect(); });', "", $desc);
    $desc = str_replace('$(.more).disableTextSelect(); $(function(){ $(.more-selected).disableTextSelect(); });', "", $desc);
    $desc = str_replace('&nbsp; var addthis_config={data_track_clickback:true};', "", $desc);
    $desc = str_replace('(adsbygoogle = window.adsbygoogle || []).push({});Tweet', "", $desc);
    $desc = str_replace('Powered by Dimofinf cms Version 3.0.0Copyright© Dimensions Of Information Inc.', "", $desc);
    $desc = str_replace('Powered by Dimofinf cms Version 3.0.0Copyright© Dimensions Of Information Inc. Design By : ALTALEDI.NET', "", $desc);
    $desc = str_replace(' :ALTALEDI NET Powered by Dimofinf cms Version 3.0.0Copyright© Dimensions Of Information Inc.', "", $desc);
    $desc = str_replace('“. #Porto 3-0 #Basel (Agg 4-1) . #Herrera 47 @casemiro_oficial 56 (Super goal)”', "", $desc);
    $desc = str_replace('“Half time . #Porto 1-0 #Basel (Agg 2-1) . #Brahimi 14”', "", $desc);
    $desc = str_replace('--> $(document).ready(function(){ setTimeout(function() { $(#todayWeatherContainer).load(/pages/today_weather/0); }, 10000); });', "", $desc);
    $desc = str_replace('Powered by vBulletin™ Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved. vb4 Watermark Generator provided by Purgatory-Labs.de', "", $desc);
    $desc = str_replace('You are using an outdated browser. Please upgrade your browser to improve your experience.', "", $desc);
    $desc = str_replace('To get best possible experiance using our website we recommend that you upgrade to a newer version or other web browser. A list of the most popular web browsers can be found below.', "", $desc);
    $desc = str_replace('هذا الموقع لا يدعم مستعرض Internet Explorer 6, للحصول على أفضل تجربة لموقع Goal الرجاء تحديث المستعرض الخاص بكاضغط هنا لتحديث مستعرض الانترنت الخاص بك', "", $desc);
    $desc = str_replace('هذا الموقع لا يدعم مستعرض Internet Explorer 7, للحصول على أفضل تجربة لموقع Goal الرجاء تحديث المستعرض الخاص بكاضغط هنا لتحديث مستعرض الانترنت الخاص بك', "", $desc);
    $desc = str_replace('هذا الموقع لا يدعم مستعرض Internet Explorer 8, للحصول على أفضل تجربة لموقع Goal الرجاء تحديث المستعرض الخاص بكاضغط هنا لتحديث مستعرض الانترنت الخاص بك', "", $desc);
    $desc = str_replace('أنت تستخدم إصداراً قديماً من مستعرض الانترنت, للحصول على أفضل تجربة لموقع Goal الرجاء تحديث مستعرضك.اضغط هنا لتحديث مستعرض الانترنت الخاص بك', "", $desc);
    $desc = str_replace('We use cookies on this web site... To find out more about cookies, please see our Privacy Policy. If you continue using our website, we will assume that you consent to the cookies we set.', "", $desc);
    $desc = str_replace('To get best possible experiance using our website we recommend that you upgrade to a newer version or other web browser. A list of the most popular web browsers can be found below.', "", $desc);
    $desc = str_replace('function get_url(title,url){ var title_encode=encodeURI(title); document.getElementById(title).href =components/com_mailajax/form.php?url=+url+&title=+title_encode+&keepThis=true&TB_iframe=true&height=325&width=425; //location.href=components/com_mailajax/form.php?url=+url+&title=+title_encode+&keepThis=true&TB_iframe=true&height=325&width=425; } function fnSave() { document.execCommand(SaveAs,null,document.title); } function Check_Controls() { var form = document.adminForm; // do field validation var filter=/[\\w\\.\\-]+@\\w+[\\w\\.\\-]*?\\.\\w{1,4}/; if(form.FNameOfQuestioner.value==){ alert(', "", $desc);
    $desc = str_replace('); return false; } else { form.submit(); } }', "", $desc);
    $desc = str_replace('myButton { background-color:#660033; border:1px solid #660033; display:inline-block; color:#ffffff; font-family:arial; font-size:14px; padding:6px 12px; text-decoration:none; width: 174px; text-shadow:0px 1px 0px #b20f50; }', "", $desc);
    $desc = str_replace('CNN © 2014 Cable News Network. Turner Broadcasting System, Inc. All Rights Reserved', "", $desc);
    $desc = str_replace('CNN © 2015 Cable News Network. Turner Broadcasting System, Inc. All Rights Reserved', "", $desc);
    $desc = str_replace('CNN © 2016 Cable News Network. Turner Broadcasting System, Inc. All Rights Reserved', "", $desc);
    $desc = str_replace('Web Design & Development By Mega Solutions! Web Design Egypt', "", $desc);
    $desc = str_replace('embed" dir="RTL">', "", $desc);
    $desc = str_replace('$(document).ready( function(){ $(.ticker).innerfade({ animationtype: slide, speed: 750, timeout: 4000, type: random, containerheight: 1em });} );', "", $desc);
    $desc = str_replace('Powered by Dimofinf cms Version 3.0.0Copyright© Dimensions Of Information Inc.', "", $desc);
    $desc = str_replace('Powered by Dimofinf cms Version 3.0.0Copyright© Dimensions Of Information Inc.\\n', "", $desc);
    $desc = str_replace('new TWTR.Widget({ version: 2, type: profile, rpp: 3, interval: 1000, width: 246, height: 265, theme: { shell: { background: #63BEFD, color: #FFFFFF }, tweets: { background: #FFFFFF, color: #000000, links: #47a61e } }, features: { loop: false,live: true, scrollbar: false,hashtags: false,timestamp: true, avatars: true,behavior: default } }).render().setUser(binybohair).start();', "", $desc);
    $desc = str_replace('vbmenu_register(posts6_32925, true);\\nPowered by vBulletin® Version 3.8.7Copyright ©2000 - 2015, vBulletin Solutions, Inc. Content Relevant URLs by vBSEO 3.6.0 PL2', "", $desc);
    $desc = str_replace('SALEM ALSHMRANI Ads Management Version 3.0.1 by Saeed Al-Atwi', "", $desc);
    $desc = str_replace('var sAppPath = /; var fbLanguage = ar_AR; var sImageLangPath = ar; var LanguageDirection = right; //', "", $desc);
    //for cnn
    $desc = str_replace("اشترك في خدمة آخر خبر من CNNArabic.com وتلقى بريد إلكتروني فور حدوث أي خبر مهم.", "", $desc);
    $desc = str_replace("NN © 2014 Cable News Network. Turner Broadcasting System, Inc. All Rights Reserved", "", $desc);
    $desc = str_replace("الآراء الواردة أدناه لا تعبر عن رأي موقع CNN بالعربية، بل تعكس وجهات نظر أصحابها فقط.", "", $desc);
    $desc = str_replace("استخدامها، مع اسمك وصورتك، استنادا إلى سياسة الخصوصية بما يتوافق مع شروط استخدام الموقع.", "", $desc);
    $desc = str_replace("ترحب شبكة CNN بالنقاش الحيوي والمفيد، وكي لا نضطر في موقع CNN بالعربية إلى مراجعة التعليقات قبل نشرها. ننصحك بمراجعة إرشادات الاستخدام للتعرف إليها جيداً. وللعلم فان جميع مشاركاتك يمكن", "", $desc);
    $desc = str_replace("(CNN) -- &nbsp;", "", $desc);
    //maan
    $desc = str_replace("الرئيسية التغطية الـقـــــدس رام الـلــــه بيـت لـحـم الخـلــيـــــل نــابــلـــــس أريـــحــــــــــا طولـكــــرم جــنــيــــــــن قـلقـيـلـيـة طـوبــــاس ســلـفـيــت قطاع غزة الـشـــــتـــــــات فلسطين 48 عربي ودولي اســرائيـلـيـات أخـبــار اقتـصــاد أســرى ريـاضــة مرور وحوادث الشــتات فلسطين 48 عربي ودولي اسرائيليات", "", $desc);
    $desc = str_replace('\\r\\n', "", $desc);
    //$desc = str_replace(" \n ", "", $desc);
    $desc = str_replace('\\r', "", $desc);
    //$desc = str_replace('<br/>', "", $desc);
    $desc = str_replace("<br/><br/>C<br/>", "", $desc);
    $desc = str_replace("\n\nC\n", "", $desc);
    $desc = str_replace("<br/>C", "", $desc);
    $desc = str_replace("\nC", "", $desc);
    $desc = str_replace("Developer API Terms &amp; Conditions Privacy Policy Copyright &copy;2014 Hootsuite Media Inc. All Rights Reserved.", "", $desc);
    $desc = str_replace("Developed by Creation House", "", $desc);
    $desc = str_replace("الأخبار\n                        المقالات\n                        الأمراض\n                        استشارات\n                        سلايد شو\n                        كويز\n                        انفوجرافيك\n                        الوظائف\n                        اكلات صحية", "", $desc);
    $twitter_new_id = $news['twitter_news_id'];
    $image = @$news['image'];
    $url = $news['url'];
    $cid = $news['cid'];
    $date_added = time();
    $added_by = 3;
    //by cron job
    if (strpos($desc, "Add to Want to watch this again later?") !== FALSE) {
        $desc = $title;
    }
    //   echo($desc);      exit;
    //$twitte_count = check_if_twitter_news_exists($twitter_new_id);
    //if (!$twitte_count) {
    $title_exists = check_if_title_exists($title, $twitter_new_id);
    //echo('000000000000000000000000000000000000000');
    if (!$title_exists) {
        //$title = mysqli_escape_string($conn, $title);
        //  $desc = mysqli_escape_string($conn, $desc);
        $site_data_array = serialize($site_data_array);
        $site_data_array = str_replace('"', "", $site_data_array);
        $site_data_array = str_replace("'", "", $site_data_array);
        $site_data_array = str_replace('\\r\\n', "", $site_data_array);
        $site_data_array = str_replace(" \n ", "", $site_data_array);
        $site_data_array = str_replace('\\r', "", $site_data_array);
        $site_data_array = str_replace('<br/>', "", $site_data_array);
        if (strrpos($reversed_url, "yalla") === FALSE) {
            if (strrpos($reversed_url, "kora.com") !== FALSE || strrpos($reversed_url, "forbesmiddleeast.com") !== FALSE || strrpos($reversed_url, "binybohair.com") !== FALSE || strrpos($reversed_url, "sudaneseonline.com") !== FALSE || strrpos($reversed_url, "moi.gov.qa") !== FALSE || strrpos($reversed_url, "qh.gov.sa") !== FALSE || strrpos($reversed_url, "elfann.com") !== FALSE || strrpos($reversed_url, "yemen-press.com") !== FALSE || strrpos($reversed_url, "barca4ever.com") !== FALSE || strrpos($reversed_url, "elnashra.com") !== FALSE || strrpos($reversed_url, "qassimy.com") !== FALSE || strrpos($reversed_url, "sahafah.net") !== FALSE || strrpos($reversed_url, "shathanews.com") !== FALSE || strrpos($reversed_url, "sheikhmohammed.ae") !== FALSE || strrpos($reversed_url, "nna-leb.gov.lb") !== FALSE || strrpos($reversed_url, "sabanews.net") !== FALSE || strrpos($reversed_url, "enferaad.com") !== FALSE || strrpos($reversed_url, "24yemen.net") !== FALSE || strrpos($reversed_url, "yemen-press.net") !== FALSE || strrpos($reversed_url, "yemen-perss.com") !== FALSE || strrpos($reversed_url, "maps.google.com.qa") !== FALSE || strrpos($reversed_url, "alazraq.com") !== FALSE || strrpos($reversed_url, "guryatnews.com") !== FALSE || strrpos($reversed_url, "arabic-military.com") !== FALSE || strrpos($reversed_url, "nmisr.com") !== FALSE || strrpos($reversed_url, "sactr.net") !== FALSE || strrpos($reversed_url, "ajmanpolice.gov") !== FALSE || strrpos($reversed_url, "ham-24.com") !== FALSE || strrpos($reversed_url, "marib.net") !== FALSE || strrpos($reversed_url, "assawsana.com") !== FALSE || strrpos($reversed_url, "alwasatnews.com") !== FALSE || strrpos($reversed_url, "sabqq.org") !== FALSE || strrpos($reversed_url, "nna-leb.gov.lb") !== FALSE || strrpos($reversed_url, "saidaonline.com") !== FALSE || strrpos($reversed_url, "alhilal.com") !== FALSE) {
                //exit;
                $desc = iconv('windows-1256', 'UTF-8', $desc);
                echo '<br /> 2converted to utf-8 <br />';
                // $desc = str_replace('<br/>', "", $desc);
            }
        }
        /*  if (strrpos($reversed_url,"klmty.net") !== FALSE) {
                $desc = 'go to fb';
            } */
        if (strrpos($reversed_url, "/vb/") !== FALSE) {
            //forum
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "instagram.com") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "hawahome.com") !== FALSE || strrpos($reversed_url, "zakatfund.gov.ae") !== FALSE || strrpos($reversed_url, "basmaty.com") !== FALSE || strrpos($reversed_url, "manalonline.com") !== FALSE || strrpos($reversed_url, "atyabtabkha.3a2ilati.com") !== FALSE || strrpos($reversed_url, "koooraworld.net") !== FALSE || strrpos($reversed_url, "sada-al-malaeb-cat") !== FALSE || strrpos($reversed_url, "onmbc.net") !== FALSE || strrpos($reversed_url, "fatafeat.com") !== FALSE || strrpos($reversed_url, "zf.ae") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "dmi.ae/samadubai") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "dcndigital.ae") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "ittisport.com") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "alg360.com") !== FALSE) {
            $desc = 'go to fb';
        }
        if (strrpos($reversed_url, "argaam.com") !== FALSE || strrpos($reversed_url, "alborsanews.com") !== FALSE) {
            if (strrpos($desc, "<table") !== FALSE) {
                $desc = 'go to fb';
            }
        }
        if (strrpos($reversed_url, "moe.gov.qa") !== FALSE) {
            if (strrpos($desc, "<table") !== FALSE) {
                $desc = 'go to fb';
            }
        }
        if (strrpos($reversed_url, "yallakora.com") !== FALSE) {
            $image = str_replace('\\', '/', $image);
        }
        //echo('descccccccccccccccc: '.$desc);exit;
        $image = str_replace("new.bab.com", "www.bab.com", $image);
        //    echo($reversed_url);exit;
        if (trim(@$title) != "") {
            /* if (
                strrpos($reversed_url,"almogaz.com") !== FALSE ||
                strrpos($reversed_url,"elshaab.org") !== FALSE ||
                strrpos($reversed_url,"elwatannews.com") !== FALSE ||
                strrpos($reversed_url,"akhbarak.net") !== FALSE ||
                strrpos($reversed_url,"arabsturbo.com") !== FALSE ||
                strrpos($reversed_url,"dailymedicalinfo.com") !== FALSE 
               ) {
                    if ($desc != "") $desc .= " ... يمكنكم قرأءة باقي الخبر على الموقع الرسمي";
                 }  */
            if (strrpos($reversed_url, "sabanews.net") !== FALSE) {
                $desc1 = explode("htm", $desc);
                $desc = $desc1[1];
            }
            $desc = $conn->db_escape_string($desc);
            $title = $conn->db_escape_string($title);
            $url = $conn->db_escape_string($url);
            $insert = "insert into articles_html (twitter_news_id, title, body, news_url, image, added_by, date_added, reversed_url) \n                                       value ('{$twitter_new_id}', '{$title}', '{$desc}', '{$url}', '{$image}', '{$added_by}', '{$date_added}', '{$reversed_url}')";
            echo $insert;
            //  exit;
            if (strrpos($desc, "you may be trying to access") === FALSE && strrpos($desc, "find out what fines") === FALSE && strrpos($desc, "I Agree on the And to user this") === FALSE && strrpos($desc, "getElementById") === FALSE && strrpos($desc, "getElementsBy") === FALSE && strrpos($desc, "window") === FALSE && strrpos($desc, "document") === FALSE && strrpos($desc, "use your My ID credentials to access the apps") === FALSE && strrpos($desc, "You may be trying to access this site from a secured browser") === FALSE) {
                $news_found = check_if_twitter_news_exists($twitter_new_id);
                if (!$news_found) {
                    $res = $conn->db_query($insert);
                    $aid = $conn->db_last_insert_id(NULL, NULL);
                    //added NULL, NULL to remove warning
                    echo '<br />$aid: ' . $aid . '<br />';
                    $cat_query = "insert into article_categories (aid, cid) value ('{$aid}', '{$cid}')";
                    $res = $conn->db_query($cat_query);
                    //exit;
                    $source_name_query = "select name from categories where id = '{$cid}'";
                    $source_name_res = $conn->db_query($source_name_query);
                    $source_name_data = $conn->db_fetch_object($source_name_res);
                    date_default_timezone_set('Asia/Jerusalem');
                    $current_time = time();
                    //$current_time = strtotime('15-06-24 12:50 am');
                    //$start_time = strtotime('09:00 pm');
                    //$start_time = strtotime(date("Y-m-d", strtotime( date("Y-m-d") . ' -1 days')) . ' ' . '09:00 pm');
                    $start_time = strtotime('12:00 am');
                    //$next_date =  date("Y-m-d", strtotime( date("Y-m-d") . ' + ' . $data['days'] . ' days')) . ' ' . $data['time'];
                    // $start_time = strtotime('08:30 am');
                    $end_time = strtotime('06:00 am');
                    //  $end_time = strtotime('03:00 am');
                    //   $end_time = strtotime('09:30 am');
                    echo '<br /><br />start time: ' . $start_time . '(' . date('y-m-d h:i a', $start_time) . ')' . '<br />';
                    echo 'current time: ' . $current_time . '(' . date('y-m-d h:i a', $current_time) . ')' . '<br />';
                    echo 'end time: ' . $end_time . '(' . date('y-m-d h:i a', $end_time) . ')' . '<br /><br />';
                    if ($end_time >= $current_time && $current_time >= $start_time) {
                        echo '<br /><br />do not send PNNNNNNNNNNNNNNNNNNNNN<br /><br />';
                    } else {
                        breaking_pn($title, $cid, $source_name_data->name, $aid);
                        keyword_pn($title, $source_name_data->name, $aid);
                        echo '<br /><br />send PNNNNNNNNNNNNNNNNNNNNNNNNNNNN<br /><br />';
                    }
                    process_tags($title, $aid);
                }
            }
        }
        // $tag_query = "insert into article_tags (aid, tid) value ('$aid', '1')";
        //$res = $conn->db_query($tag_query);
    } else {
        echo 'title existssssssss';
    }
    //  exit;
    /* }
       else{  */
    //update
    // $title = mysqli_escape_string($conn, $title);
    // $desc = mysqli_escape_string($conn, $desc);
    /*  $update = "update articles_html set title = '$title', body = '$desc', news_url = '$url', updated_date = '$date_added', updated_by = '$added_by' 
                       where twitter_news_id = '$twitter_new_id'";
            $res = $conn->db_query($update);
        } */
}
Example #2
0
 public static function ubb2html($html, $title = null)
 {
     global $bUbb2htmlFunctionInit;
     if (!$bUbb2htmlFunctionInit) {
         function match_tags($html, $reg)
         {
             if (!preg_match_all('/(' . $reg . ')/is', $html, $matches, PREG_OFFSET_CAPTURE)) {
                 return array();
             }
             foreach ($matches[0] as $k => $v) {
                 if (substr($v[0], 1, 1) == '/') {
                     $v[2] = 'e';
                 } else {
                     $v[2] = 's';
                 }
                 $tags[$v[1]] = $v;
             }
             return $tags;
         }
         function process_tags($tags)
         {
             if (empty($tags)) {
                 return array();
             }
             $stack = $replace = array();
             foreach ($tags as $tag) {
                 if (!empty($stack)) {
                     $last = end($stack);
                     if ($last[2] == 's' && $tag[2] == 'e') {
                         $replace[$tag[1]] = $tag[0];
                         $replace[$last[1]] = $last[0];
                         array_pop($stack);
                         //出栈
                     } else {
                         $stack[] = $tag;
                         //入栈
                     }
                 } else {
                     $stack[] = $tag;
                     //入栈
                 }
             }
             krsort($replace);
             return $replace;
         }
         function simple_replace($html, $start, $text)
         {
             return substr_replace($html, str_replace(array('[', ']'), array('<', '>'), $text), $start, mb_strlen($text));
         }
         function getSizeName($match)
         {
             $arrSize = array('8pt', '10pt', '12pt', '14pt', '18pt', '24pt', '36pt');
             if ($match[1] >= 1 && $match[1] <= 7) {
                 $res = '<span style="font-size:' . $arrSize[$match[1] - 1] . ';">';
             } else {
                 $res = '<span style="font-size:' . $match[1] . ';">';
             }
             return $res;
         }
         function getImg($match)
         {
             $p1 = $match[1];
             $p2 = $match[2];
             $p3 = $match[3];
             $src = $match[4];
             $a = $p3 ? $p3 : (!is_numeric($p1) ? $p1 : '');
             return '<img src="' . $src . '"' . (is_numeric($p1) ? ' width="' . $p1 . '"' : '') . (is_numeric($p2) ? ' height="' . $p2 . '"' : '') . ($a ? ' align="' . $a . '"' : '') . ' border="0" alt="' . $title . '" onload="if(this.width>700){this.width=700;}"/>';
         }
         function getFlash($match)
         {
             $w = $match[1];
             $h = $match[2];
             $url = $match[3];
             if (!$w) {
                 $w = 550;
             }
             if (!$h) {
                 $h = 400;
             }
             return '<embed type="application/x-shockwave-flash" src="' . $url . '" wmode="opaque" quality="high" bgcolor="#ffffff" menu="false" play="true" loop="true" width="' . $w . '" height="' . $h . '" />';
         }
         function getMedia($match)
         {
             $w = $match[1];
             $h = $match[2];
             $play = $match[3];
             $url = $match[4];
             if (!$w) {
                 $w = 550;
             }
             if (!$h) {
                 $h = 400;
             }
             return '<embed type="application/x-mplayer2" src="' . $url . '" enablecontextmenu="false" autostart="' . ($play == '1' ? 'true' : 'false') . '" width="' . $w . '" height="' . $h . '" />';
         }
         function getTable($match)
         {
             return '<table' . (isset($match[1]) ? ' width="' . $match[1] . '"' : '') . (isset($match[2]) ? ' bgcolor="' . $match[2] . '"' : '') . '>';
         }
         function getTR($match)
         {
             return '<tr' . (isset($match[1]) ? ' bgcolor="' . $match[1] . '"' : '') . '>';
         }
         function getTD($match)
         {
             $col = isset($match[1]) ? $match[1] : 0;
             $row = isset($match[2]) ? $match[2] : 0;
             $w = isset($match[3]) ? $match[3] : null;
             return '<td' . ($col > 1 ? ' colspan="' . $col . '"' : '') . ($row > 1 ? ' rowspan="' . $row . '"' : '') . ($w ? ' width="' . $w . '"' : '') . '>';
         }
         function getUL($match)
         {
             $str = '<ul';
             if (isset($match[1])) {
                 $str .= ' type="' . $match[1] . '"';
             }
             return $str . '>';
         }
         function fixText($match)
         {
             $text = $match[2];
             $text = preg_replace("/\t/", '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $text);
             $text = preg_replace("/ /", '&nbsp;', $text);
             return $match[1] . $text;
         }
         function beforeQuote($sHtml)
         {
             global $quoteMatch;
             preg_match_all("/\\[quote\\]([\\s\\S]*?)\\[\\/quote\\]/i", $sHtml, $m);
             $quoteMatch = $m[0];
             foreach ($quoteMatch as $k => $v) {
                 $quoteMatch[$k] = preg_replace("/\\[quote\\]([\\s\\S]*?)\\[\\/quote\\]/i", '<div class="quote"><div class="quote_header"><span style="font-size:14px;font-weight:bold">引用:</span></div><div class="quote_content">$1</div></div>', $v);
                 $sHtml = str_replace($v, '#$@quotemsg@$#' . $k, $sHtml);
             }
             return $sHtml;
         }
         function afterQuote($sHtml)
         {
             global $quoteMatch;
             foreach ($quoteMatch as $k => $v) {
                 $sHtml = str_replace('#$@quotemsg@$#' . $k, $v, $sHtml);
             }
             return $sHtml;
         }
         function getUrl($match)
         {
             //外链允许白名单 by xinhe
             if (preg_match('/(anjuke.com|haozu.com|aifang.com|shanghaidz.com|t.sina.com.cn)/i', $match[1])) {
                 return '<a href="' . $match[1] . '" target="_blank">' . ($match[2] ? $match[2] : $match[1]) . '</a>';
             } else {
                 return $match[2] ? $match[2] : $match[1];
             }
         }
     }
     $html = preg_replace(array("/&/", "/</", "/>/", "/\r?\n/"), array('&amp;', '&lt;', '&gt;', '<br />'), $html);
     if (strstr($html, '[/b]')) {
         $tags = process_tags(match_tags($html, '\\[b\\]|\\[\\/b\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
     }
     if (strstr($html, '[/i]')) {
         $tags = process_tags(match_tags($html, '\\[i\\]|\\[\\/i\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
     }
     if (strstr($html, '[/u]')) {
         $tags = process_tags(match_tags($html, '\\[u\\]|\\[\\/u\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
     }
     if (strstr($html, '[/s]') || strstr($html, '[/sup]') || strstr($html, '[/sub]')) {
         $tags = process_tags(match_tags($html, '\\[s\\]|\\[\\/s\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
         $tags = process_tags(match_tags($html, '\\[sup\\]|\\[\\/sup\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
         $tags = process_tags(match_tags($html, '\\[sub\\]|\\[\\/sub\\]'));
         foreach ($tags as $k => $v) {
             $html = simple_replace($html, $k, $v);
         }
     }
     if (strstr($html, '[/size]')) {
         $tags = process_tags(match_tags($html, '\\[size\\s*=\\s*([^\\"\'><]+?)\\s*\\]|\\[\\/size\\]'));
         foreach ($tags as $k => $v) {
             if ($v == '[/size]') {
                 $html = substr_replace($html, '</span>', $k, mb_strlen($v));
             } else {
                 $replace = preg_replace_callback('/\\[size\\s*=\\s*(.+?)\\s*\\]/i', 'getSizeName', $v);
                 $html = substr_replace($html, $replace, $k, mb_strlen($v));
             }
         }
     }
     if (strstr($html, '[/color]')) {
         $tags = process_tags(match_tags($html, '\\[color\\s*=\\s*([^\\"\'><]+?)\\s*\\]|\\[\\/color\\]'));
         foreach ($tags as $k => $v) {
             if ($v == '[/color]') {
                 $html = substr_replace($html, '</span>', $k, mb_strlen($v));
             } else {
                 $replace = preg_replace('/\\[color\\s*=\\s*(.+?)\\s*\\]/i', '<span style="color:$1;">', $v);
                 $html = substr_replace($html, $replace, $k, mb_strlen($v));
             }
         }
     }
     if (strstr($html, '[/font]')) {
         $tags = process_tags(match_tags($html, '\\[font\\s*=\\s*([^\\"\'><]+?)\\s*\\]|\\[\\/font\\]'));
         foreach ($tags as $k => $v) {
             if ($v == '[/font]') {
                 $html = substr_replace($html, '</span>', $k, mb_strlen($v));
             } else {
                 $replace = preg_replace('/\\[font\\s*=\\s*(.+?)\\s*\\]/i', '<span style="font-family:$1;">', $v);
                 $html = substr_replace($html, $replace, $k, mb_strlen($v));
             }
         }
     }
     if (strstr($html, '[/back]')) {
         $tags = process_tags(match_tags($html, '\\[back\\s*=\\s*([^\\"\'><]+?)\\s*\\]|\\[\\/back\\]'));
         foreach ($tags as $k => $v) {
             if ($v == '[/back]') {
                 $html = substr_replace($html, '</span>', $k, mb_strlen($v));
             } else {
                 $replace = preg_replace('/\\[back\\s*=\\s*(.+?)\\s*\\]/i', '<span style="background-color:$1;">', $v);
                 $html = substr_replace($html, $replace, $k, mb_strlen($v));
             }
         }
     }
     $quoteMatch = array();
     $html = beforeQuote($html);
     if (strstr($html, '[/align]')) {
         $tags = process_tags(match_tags($html, '\\[align\\s*=\\s*([^\\"\'><]+?)\\s*\\]|\\[\\/align\\]'));
         foreach ($tags as $k => $v) {
             if ($v == '[/align]') {
                 $html = substr_replace($html, '</p>', $k, mb_strlen($v));
             } else {
                 $replace = preg_replace('/\\[align\\s*=\\s*(.+?)\\s*\\]/i', '<p align="$1">', $v);
                 $html = substr_replace($html, $replace, $k, mb_strlen($v));
             }
         }
     }
     if (strstr($html, '[/img]')) {
         $html = preg_replace('/\\[img\\]\\s*(((?!")[\\s\\S])+?)(?:"[\\s\\S]*?)?\\s*\\[\\/img\\]/i', '<img src="$1" border="0" alt="' . $title . '" onload="if(this.width>700){this.width=700;}"/>', $html);
         $html = preg_replace_callback('/\\[img\\s*=(?:\\s*(\\d*%?)\\s*,\\s*(\\d*%?)\\s*)?(?:,?\\s*(\\w+))?\\s*\\]\\s*(((?!")[\\s\\S])+?)(?:"[\\s\\S]*?)?\\s*\\[\\/img\\]/i', 'getImg', $html);
     }
     if (strstr($html, '[/url]')) {
         $html = preg_replace_callback('/\\[url\\]\\s*((?!")[\\s\\S]*?)(?:"[\\s\\S]*?)?\\s*\\[\\/url\\]/i', 'getUrl', $html);
         $html = preg_replace_callback('/\\[url\\s*=\\s*([^\\]"]+?)(?:"[^\\]]*?)?\\s*\\]\\s*([\\s\\S]*?)\\s*\\[\\/url\\]/i', 'getUrl', $html);
     }
     if (strstr($html, '[/email]')) {
         $html = preg_replace('/\\[email\\]\\s*(((?!")[\\s\\S])+?)(?:"[\\s\\S]*?)?\\s*\\[\\/email\\]/i', '<a href="mailto:$1">$1</a>', $html);
         $html = preg_replace('/\\[email\\s*=\\s*([^\\]"]+?)(?:"[^\\]]*?)?\\s*\\]\\s*([\\s\\S]+?)\\s*\\[\\/email\\]/i', '<a href="mailto:$1">$2</a>', $html);
     }
     if (strstr($html, '[/flash]')) {
         $html = preg_replace_callback('/\\[flash\\s*(?:=\\s*(\\d+)\\s*,\\s*(\\d+)\\s*)?\\]\\s*(((?!")[\\s\\S])+?)(?:"[\\s\\S]*?)?\\s*\\[\\/flash\\]/i', 'getFlash', $html);
     }
     if (strstr($html, '[/media]')) {
         $html = preg_replace_callback('/\\[media\\s*(?:=\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d+)\\s*)?)?\\]\\s*(((?!")[\\s\\S])+?)(?:"[\\s\\S]*?)?\\s*\\[\\/media\\]/i', 'getMedia', $html);
     }
     if (strstr($html, '[/table]') || strstr($html, '[/tr]') || strstr($html, '[/td]')) {
         $html = preg_replace_callback('/\\[table\\s*(?:=(\\d{1,4}%?)\\s*(?:,\\s*([^\\]"]+)(?:"[^\\]]*?)?)?)?\\s*\\]/i', 'getTable', $html);
         $html = preg_replace_callback('/\\[tr\\s*(?:=(\\s*[^\\]"]+))?(?:"[^\\]]*?)?\\s*\\]/i', 'getTR', $html);
         $html = preg_replace_callback("/\\[td\\s*(?:=\\s*(\\d{1,2})\\s*,\\s*(\\d{1,2})\\s*(?:,\\s*(\\d{1,4}%?))?)?\\s*\\]/i", 'getTD', $html);
         $html = preg_replace("/\\[\\/(table|tr|td)\\]/i", '</$1>', $html);
     }
     $html = preg_replace("/\\[\\*\\]([^\\[]+)/i", '<li>$1</li>', $html);
     if (strstr($html, '[/list]')) {
         $html = preg_replace_callback('/\\[list\\s*(?:=\\s*([^\\]"]+))?(?:"[^\\]]*?)?\\s*\\]/i', 'getUL', $html);
         $html = preg_replace("/\\[\\/list\\]/i", '</ul>', $html);
     }
     $html = preg_replace_callback('/(^|<\\/?\\w+(?:\\s+[^>]*?)?>)([^<$]+)/i', 'fixText', $html);
     $html = afterQuote($html);
     $ajk_smilies_code = array('adfaferyikuhjd', 'mclmlhha', 'bsnlghsha', 'utyrgfdhtrueyrytr', 'y6u87ityhdfgre56ruy', 'dafjlajgljdg', '5ythdfgsdvssgretrjgdf', 'verhetrygnbvxfbcnv', 'ggfhgfhjgfdfhgsrjfgnb', 'gfhyjrutyhgfdhtryetrht', 'bavdafretry65ui6i', 'iowtjowqnhgs', 'dfewryhwtyy', 'ruyerytyurttutiy', 'bzbgahah', 'hglajgaljhhalh', 'ghdsjsksk', 'lajldjfagj', 'faljsdfjaljgsd', 'lajfldajga', 'nlanlnlv023', 'wohdnhlasdh', 'zanglahnal', 'adyyjuyjkukuki', 'cvsfg5tryet6hu6yejy', 'fetrutiyooopop', 'hgfhrgjtrhy6u565656', 'dfadfertyry');
     $ajk_simlies_url = array('<img src="http://forum.anjuke.com/images/smilies/Onion_30.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_06.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_24.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_58.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_60.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_46.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_01.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_49.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_51.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_53.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_72.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_10.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_17.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_68.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_22.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_38.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_07.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_40.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_23.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_59.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_70.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_14.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_19.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_64.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_39.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_69.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_02.gif">', '<img src="http://forum.anjuke.com/images/smilies/Onion_09.gif">');
     $html = str_replace($ajk_smilies_code, $ajk_simlies_url, $html);
     $html = preg_replace("/\\[(\\/?)(b|u|i|s|sup|sub)\\]/i", '', $html);
     $html = preg_replace("/\\[size\\s*=\\s*(.+?)\\s*\\]/i", '', $html);
     $html = preg_replace('/\\[font\\s*=\\s*(.+?)\\s*\\]/i', '', $html);
     $html = preg_replace('/\\[back\\s*=\\s*(.+?)\\s*\\]/i', '', $html);
     $html = preg_replace('/\\[color\\s*=\\s*(.+?)\\s*\\]/i', '', $html);
     $html = preg_replace("/\\[\\/(color|size|font|back)\\]/i", '', $html);
     $bUbb2htmlFunctionInit = true;
     return $html;
 }
Example #3
0
        }
        $tag = str_replace("#", "", $tag);
        $tag = str_replace(":", "", $tag);
        $tag = str_replace(",", "", $tag);
        $tag = str_replace(".", "", $tag);
        $tag = str_replace(";", "", $tag);
        $tag = str_replace(">", "", $tag);
        $tag = str_replace("<", "", $tag);
        $tag = str_replace('"', "", $tag);
        $tag = str_replace("'", "", $tag);
        $tag = str_replace("،", "", $tag);
        $tag = str_replace("~", "", $tag);
        $tag = str_replace("`", "", $tag);
        $tag = str_replace("(", "", $tag);
        $tag = str_replace(")", "", $tag);
        $tag = str_replace("»", "", $tag);
        $tag = str_replace("«", "", $tag);
        $tag = preg_replace("/[a-zA-Z0-9]+/", '', $tag);
        $tag_encoding = mb_detect_encoding($tag);
        // echo($tag_encoding . '<br />');
        if ($tag_encoding != "" && $tag_encoding == 'UTF-8' && !is_numeric($tag) && mb_strlen($tag, "UTF-8") > 2) {
            //just arabic and not number and tag length > 2 and it's noun
            echo check_if_tag_exists($tag);
        }
    }
}
process_tags('وزير الشباب العراقي لـ #المستقبل: مفتاح حل الهجرة يبدأ بخلق فرص العمل
#العراق
#الهجرة
#أوروبا
');