Plugin Directory

Changeset 1899449


Ignore:
Timestamp:
06/26/2018 05:44:07 PM (8 years ago)
Author:
nebelhorn
Message:
  • fix push post id bug
  • add type to extraRequestParam in homepresets & teaser JSONS
Location:
yournewsapp/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • yournewsapp/trunk/classes/lang.php

    r1631070 r1899449  
    171171               'Search_NoResultViewTitle'=>'No results found.',
    172172               'Search_InputPlaceholder'=>'Search...',
    173                'No Events'=>'No Events'
     173               'No Events'=>'No Events',
     174               'sendmessage_errormessage'=>'Your device has not installed an app to send emails.',
     175               'sharing_errormessage'=> 'Your device has not installed an app to share the content.',
     176               'PDF_Download_Alert_Override_File'=> 'Are you sure you want to replace the existing file "#TITLE#" ?',
     177               'PDF_Download_Alert_Override_File_yes'=> 'Replace file',
     178               'PDF_Download_Alert_Override_File_cancel'=> 'Cancel',
     179               'PDF_Download_Alert_downloading'=> 'Downloading...',
     180               'PDF_Download_Alert_Install_PDFViewer_button'=> 'OK',
     181               'PDF_Download_Alert_Install_PDFViewer'=> 'Please install a PDF Viewer to open this file.',
     182               'PDF_Download_Alert__downloading_Error'=> 'An error occurred while downloading. Please try again later.'
     183
     184
    174185           ));
    175186
  • yournewsapp/trunk/classes/lang/app_trans_de.php

    r1631070 r1899449  
    9595      'Search_NoResultViewTitle'=>'Keine Suchergebnisse gefunden.',
    9696      'Search_InputPlaceholder'=>'Suchen...',
    97       'No Events'=>'Keine Veranstaltungen'
     97      'No Events'=>'Keine Veranstaltungen',
     98      'sendmessage_errormessage'=>'Ihr Gerät hat keine App zum Versenden von EMails installiert.',
     99      'sharing_errormessage'=>'Ihr Gerät hat keine App zum Teilen des Inhalts installiert.',
     100      'PDF_Download_Alert_Override_File'=> 'Möchten Sie die vorhandene Datei "#TITLE#" wirklich ersetzen?',
     101      'PDF_Download_Alert_Override_File_yes'=> 'Datei ersetzen',
     102      'PDF_Download_Alert_Override_File_cancel'=> 'Abbrechen',
     103      'PDF_Download_Alert_downloading'=> 'Wird heruntergeladen...',
     104      'PDF_Download_Alert_Install_PDFViewer_button'=> 'OK',
     105      'PDF_Download_Alert_Install_PDFViewer'=> 'Bitte installieren Sie einen PDF Viewer, um diese Datei zu öffnen.',
     106      'PDF_Download_Alert__downloading_Error'=> 'Es ist ein Fehler beim Download aufgetreten. Bitte versuchen Sie es später erneut.'
     107
    98108           );
    99109?>
  • yournewsapp/trunk/include/nh_ynaa_content.php

    r1631070 r1899449  
    7979}
    8080
    81 
     81#wpadminbar {
     82display:none;
     83}
    8284';
    8385if($this->css_settings['css']) $this->general_settings['css'] = $this->css_settings['css'];
  • yournewsapp/trunk/include/nh_ynaa_homepresets.php

    r1681303 r1899449  
    6363                    $returnarray['error']=$this->nh_ynaa_errorcode(23);
    6464                }
    65             } elseif ($this->homepreset_settings['homescreentype']==1 || $this->homepreset_settings['homescreentype']==2) {
     65            }
     66            elseif ($this->homepreset_settings['homescreentype']==1 || $this->homepreset_settings['homescreentype']==2) {
    6667                $returnarray['homescreentype']=(int)$this->homepreset_settings['homescreentype'];
    6768                $returnarray['sorttype']=$this->homepreset_settings['sorttype'];
    68             } else {
     69            }
     70            else {
    6971                if ($this->homepreset_settings['items']) {
    7072                    $returnarray['changes']=1;
     
    116118                            $items['articles']['items'][0]['post_type'] = '';
    117119                            $extraRequestParam = '';
     120                            if(isset($hp['type'])) $extraRequestParam = '&'.$this->prefix.'type='.$hp['type'];
    118121                            if ($hp['type'] == 'cat') {
    119122                                $cat_id    = (int) $hp['id'];
     
    157160                                            $items['articles']['items'][0]['timestamp']=$event['events']['items'][0]['timestamp']?:0;
    158161                                            $items['articles']['items'][0]['publish_timestamp']=$event['events']['items'][0]['publish_timestamp']?:0;
     162                                            if ($hp['img']) {
     163                                                $img = $hp['img'];
     164                                            }
    159165                                            if (!$img) {
    160166                                                $img = $event['events']['items'][0]['thumb'];
     
    219225                            }
    220226                            else {
     227
     228                                $extraRequestParam= '&'.$this->prefix.'type='.$hp['type'];
    221229                                $post_categories = wp_get_post_categories($hp['id']);
    222230                                if ($post_categories) {
  • yournewsapp/trunk/include/nh_ynaa_search.php

    r1681303 r1899449  
    3434           $prefix = '';
    3535           if(isset($_GET['nh_prefix'])) $prefix = '_'.$_GET['nh_prefix'];
    36            if (isset($allsearch->posts)) {
     36           if (isset($allsearch->posts) ) {
    3737               foreach ($allsearch->posts as $post) {
    3838                   // var_dump($post);
     
    8383
    8484       $returnarray = apply_filters('nh_search_array_total', $returnarray, $_POST);
    85        $totalsearch = new WP_Query("s=" . $_POST['search'] . "&showposts=-1");
     85      // BLAAPP-281 remove trim
     86      //  if(isset($_POST['search'])&& trim($_POST['search']))       $totalsearch = &new WP_Query("s=" . $_POST['search'] . "&showposts=-1");
     87       if(isset($_POST['search'])&& trim($_POST['search']))       $totalsearch = new WP_Query("s=" . $_POST['search'] . "&showposts=-1");
     88       else $totalsearch->post_count = (int)wp_count_posts('post')->publish;
    8689       $returnarray['total'] = $totalsearch->post_count;
    8790
     
    9295else {
    9396    $returnarray['elemets'][] = array('pos'=>1,'name'=>'search','label'=>__('Search','nh-ynaa'), 'placeholder'=>__('Search...','nh-ynaa'), 'type'=>'text', 'required'=>1, 'group'=>'gp1' );
     97    $returnarray['elements'] = $returnarray['elemets'];
    9498
    9599
  • yournewsapp/trunk/include/nh_ynaa_teaser.php

    r1681303 r1899449  
    7272                        $item['title'] =  preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); },$item['title']);
    7373                        $item['title'] = html_entity_decode($item['title']);
    74                         $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => 'cat', 'id'=> (int) $teaser['id'], 'title'=> $item['title'], 'thumb'=>$this->nh_relativeToAbsolutePath($item['img']), 'cat_id'=>(int) $teaser['id'], 'post_ts'=>0, 'post_date'=>0);
     74                        $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => 'cat', 'id'=> (int) $teaser['id'], 'title'=> $item['title'], 'thumb'=>$this->nh_relativeToAbsolutePath($item['img']), 'cat_id'=>(int) $teaser['id'], 'post_ts'=>0, 'post_date'=>0, 'extraRequestParam'=>'&'.$this->prefix.'type='.$teaser['type']);
    7575                        $i++;
    7676                        continue;
     
    8080                        $teaser['title'] =  preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); },$teaser['title']);
    8181                        $teaser['title'] = html_entity_decode($teaser['title']);
    82                         $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => 'webview', 'id'=> (int) $teaser['id'], 'item_id'=>-3, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0, 'url'=>$teaser['url']);
     82                        $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => 'webview', 'id'=> (int) $teaser['id'], 'item_id'=>-3, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0, 'url'=>$teaser['url'], 'extraRequestParam'=>'&'.$this->prefix.'type='.$teaser['type']);
    8383                        $i++;
    8484                        continue;
     
    8888                        $teaser['title'] =  preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); },$teaser['title']);
    8989                        $teaser['title'] = html_entity_decode($teaser['title']);
    90                         $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => $teaser['type'], 'id'=> (int) $teaser['id'], 'item_id'=>-3, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0);
     90                        $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => $teaser['type'], 'id'=> (int) $teaser['id'], 'item_id'=>-3, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0, 'extraRequestParam'=>'&'.$this->prefix.'type='.$teaser['type']);
    9191                        $i++;
    9292                        continue;
     
    100100                            continue;
    101101                        }
    102                         $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => $teaser['type'], 'id'=> (int) $teaser['id'], 'item_id'=>null, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0);
     102                        $returnarray['items'][]=array('pos'=>(int)$i, 'apectFill'=>1, 'type' => $teaser['type'], 'id'=> (int) $teaser['id'], 'item_id'=>null, 'title'=> $teaser['title'], 'thumb'=>$teaser['img'], 'cat_id'=>0, 'post_ts'=>0, 'post_date'=>0, 'extraRequestParam'=>'&'.$this->prefix.'type='.$teaser['type']);
    103103                        $i++;
    104104                        continue;
     
    146146            }
    147147            else{
    148 
     148                //var_dump($this->teaser_settings);
    149149                if($this->teaser_settings['source']=='cat' && !$this->teaser_settings['source']){
    150150
     
    236236            $returnarray['error']=$this->nh_ynaa_errorcode(18);
    237237        }
    238         $returnarray['timestamp']=$ts;
     238        $returnarray['timestamp']= (int)$ts;
    239239
    240240    }
  • yournewsapp/trunk/nh_ynaa_plugin.php

    r1681303 r1899449  
    22/*
    33Plugin Name: Blappsta Plugin
    4 Version: 0.8.8.7
     4Version: 0.8.8.8
    55
    66Plugin URI: http://wordpress.org/plugins/yournewsapp/
     
    2020//Temp fix folder problem
    2121global $nh_ynaa_version;
    22 $nh_ynaa_version = "0.8.8.7";
     22$nh_ynaa_version = "0.8.8.8";
    2323global $nh_ynaa_db_version;
    2424$nh_ynaa_db_version=1.2;
     
    19441944                date_default_timezone_set('UTC');
    19451945            }
    1946 
     1946            //global $wpdb;
     1947           // $wpdb->insert('temp', array('value'=>'blappsta_plugin', 'text'=>serialize($_GET)));
    19471948            if ($this->general_settings['json_embedded']) {
    19481949                $header = 'Content-Type: text/plain; charset=UTF-8';
     
    20012002                echo($json);
    20022003                echo $end;
     2004               // $wpdb->insert('temp', array('value'=>'blappsta_article', 'text'=>serialize($json)));
    20032005                //$out1 = ob_get_contents();
    20042006
     
    20512053                header('Content-Type: text/html;charset=UTF-8');
    20522054                echo($this->nh_ynaa_content());
     2055
     2056               // echo apply_filters('nh_html_content_last', $this->nh_ynaa_content());;
    20532057            } elseif ($ynaa_var=='yna_settings' || $ynaa_var==$_GET['nh_prefix'].'_yna_settings') {
    20542058                header($header);
     
    20692073                echo $end;
    20702074            }
     2075
    20712076            exit();
    20722077        } // END public function nh_ynaa_template_redirect()
     
    21702175        private function nh_ynaa_articles($id=0, $lim=0, $size=false, $intern = false)
    21712176        {
     2177            do_action('nh_ynaa_articles_pre');
    21722178            $allowRemove=1;
    21732179            $returnarray['error']=$this->nh_ynaa_errorcode(0);
     
    22012207
    22022208            if (($_GET[$this->requesvar['option']]==1 && $_GET[$this->requesvar['sorttype']])) {
     2209
    22032210                //$returnarray['uma']['switch'][] = '($_GET[$this->requesvar[\'option\']]==1 && $_GET[$this->requesvar[\'sorttype\']])';
    22042211                    // The Query
     
    23962403                $returnarray = apply_filters('nh_articles_array_option', $returnarray);
    23972404                return array('articles'=>$returnarray);
    2398             } elseif (isset($_GET[$this->requesvar['id']]) || $id) {
     2405            }
     2406            elseif (isset($_GET[$this->requesvar['id']]) || $id) {
    23992407                $returnarray['changes']=0;
    24002408                //PostID
     
    25602568//              $post_ids = false;
    25612569                if (!$post_ids) {
    2562                     //var_dump($this->categories_settings);
     2570                    //var_dump($this->categories_settings); die();
    25632571                    $orderby = 'date';
    25642572                    $order = 'DESC';
     
    26372645                $returnarray['error']=$this->nh_ynaa_errorcode(15);
    26382646            }
    2639 
     2647           // var_dump($returnarray);
    26402648            $returnarray = apply_filters('nh_articles_array', $returnarray);
    26412649            return array('articles'=>$returnarray);
     
    26722680        private function nh_ynaa_article()
    26732681        {
     2682            do_action('nh_ynaa_article_pre');
    26742683            $returnarray['error']=$this->nh_ynaa_errorcode(0);
    26752684            require 'include/nh_ynaa_article.php';
     
    31173126                    $i++;
    31183127                }
    3119             } else {
     3128            }
     3129            else {
    31203130                $returnarray['error']=$this->nh_ynaa_errorcode(22);
    31213131                $ts = time();
     
    35973607        {
    35983608            update_option('nh_ynaa_categories_settings_ts', time());
     3609            update_option('nh_ynaa_teaser_settings_ts', time());
     3610
    35993611          /*
    36003612           * We need to verify this came from the our screen and with proper authorization,
     
    45424554{
    45434555    global $post;
     4556
     4557    if(isset($_GET['post'])) $post = get_post($_GET['post']);
    45444558    $cat = wp_get_post_categories($post->ID);
    45454559    if ($cat) {
     
    46024616
    46034617                            if(data && data.indexOf("Send successful")!=-1) alert('Push send success.');
    4604                             else alert(data);
     4618                            else alert(data);
    46054619                        }
    46064620                        $('#nh_ynaa_sendpush').prop('disabled', false);
  • yournewsapp/trunk/readme.txt

    r1681303 r1899449  
    66Requires at least: 3.3.0
    77Tested up to: 4.7.3
    8 Stable tag: 0.8.8.7
     8Stable tag: 0.8.8.8
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8181
    8282== Change Log ==
     83= 0.8.8. =
     84- fix push post id bug
     85
     86= 0.8.8.7.1 =
     87- add type to extraRequestParam in homepresets & teaser JSONS
     88- add action nh_ynaa_article_pre, nh_ynaa_articles_pre
     89
    8390= 0.8.8.7 =
    8491- fix push coding bug
     
    472479 
    473480== Upgrade Notice ==
     481= 0.8.8. =
     482- fix push post id bug
     483
    474484= 0.8.8.7 =
    475485- fix push coding bug
Note: See TracChangeset for help on using the changeset viewer.