Plugin Directory

Changeset 1267707


Ignore:
Timestamp:
10/17/2015 01:07:22 AM (10 years ago)
Author:
boyevul
Message:
  • Author update
  • @error suppression for file_get_contents on [mom_reddit] .json feeds in the off-chance the linked feed should stop working (for whatever reason)
Location:
my-optional-modules/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • my-optional-modules/trunk/class.mom-mediaembed.php

    r1263667 r1267707  
    2121
    2222        $myoptionalmodules_pluginscript = sanitize_text_field ( get_option ( 'myoptionalmodules_pluginscript' ) );
     23   
     24        $close = null;
     25        $div   = null;
    2326   
    2427        if ( filter_var ( $url , FILTER_VALIDATE_URL ) !== false ):
     
    265268            if ( $output ):
    266269                if ( 'user_info_image' != $class ):
    267                     echo "<div class='embed'>";
    268                     echo $output;
     270                    $div .= "<div class='embed'>";
    269271                else:
    270                     echo '<div class="user_info_image">';
    271                     echo $output;
    272                 endif;
    273                 echo '</div>';
     272                    $div .= '<div class="user_info_image">';
     273                endif;
     274                $close .= '</div>';
     275                return $div . $output . $close;
    274276            else:
    275277                if ( true == $display_text ):
    276                     echo "<div class='gumboard_content_comment'><p><a rel='nofollow' href='{$url}'>Attached link</a> <small>(<a href='//{$host}'>{$host}</a>)</small></p></div>";
     278                    $output .= "<div class='gumboard_content_comment'><p><a rel='nofollow' href='{$url}'>Attached link</a> <small>(<a href='//{$host}'>{$host}</a>)</small></p></div>";
     279                    return $output;
    277280                endif;
    278281            endif;
  • my-optional-modules/trunk/class.mom-reddit.php

    r1264763 r1267707  
    114114       
    115115        if ( $sub ):
    116             $url  = "https://reddit.com/r/{$sub}/.json?limit={$amount}&t={$from}";
    117             $json = json_decode ( file_get_contents ( $url ) );
     116            $url_1 = "https://reddit.com/r/{$sub}/";
     117            $url_2 = "https://reddit.com/r/{$sub}/.json?limit={$amount}&t={$from}";
    118118        elseif ( $thread ):
    119             $url = "https://reddit.com/comments/{$thread}/.json";
    120             $json = json_decode ( file_get_contents ( $url ) );
     119            $url_1 = "https://reddit.com/comments/{$thread}/";
     120            $url_2 = "https://reddit.com/comments/{$thread}/.json";
    121121        elseif ( $search ):
    122122            if ( $sub ):
     
    125125                $restrict = null;
    126126            endif;
    127             $url  = "https://www.reddit.com/search.json?q={$search}&limit={$amount}&t={$from}&sort={$sort}{$restrict}";
    128             $json = json_decode ( file_get_contents ( $url ) );
    129         endif;
     127            $url_1 = "https://www.reddit.com/search.json?q={$search}";
     128            $url_2 = "https://www.reddit.com/search.json?q={$search}&limit={$amount}&t={$from}&sort={$sort}{$restrict}";
     129        endif;
     130       
     131        if ( $url_1 && $url_2 ):
     132            $json = json_decode ( @file_get_contents ( $url_2 ) );
     133        endif;
     134       
     135       
    130136       
    131137        if ( $header ):
  • my-optional-modules/trunk/function.functions.php

    r1264465 r1267707  
    4343    return $rtrn;
    4444}
     45
     46function mom_url_headers ( $url ) {
     47    $headers = get_headers ( $url );
     48    return substr ( $headers [ 0 ] , 9 , 3 );
     49}
  • my-optional-modules/trunk/includes/css/css.css

    r1264584 r1267707  
    129129            top: 5%;
    130130            width: 14%;
     131        }
     132        .myoptionalmodules-subreddit .reddit-item-listing .feed {
     133            padding: 5px;
     134            width: 45%;
    131135        }
    132136        .myoptionalmodules-subreddit .reddit-item-listing .listing-date {
  • my-optional-modules/trunk/plugin.php

    r1264761 r1267707  
    33Plugin Name: My Optional Modules
    44Description: Optional modules and additions for Wordpress.
    5 Version: 11.1.6
    6 Author: boyevul
     5Version: 11.1.7
     6Author: sodapopgun
     7Github Plugin URI: sodapopgun/my-optional-modules
     8Github Branch: master
    79*/
    810
  • my-optional-modules/trunk/readme.txt

    r1264761 r1267707  
    11=== My Optional Modules ===
    2 Contributors: boyevul
     2Contributors: sodapopgun
    33Tags: reddit, meta, og, twitter, facebook, google, description, title, 404, comments, version, pingbacks, author, date, archives, disable, horizontal, galleries, font awesome, share, RSS, DNSBL, garbage, removal, trash, footer, exclude, remove, hide, front page, search results, authors, categories, tags, single post, miniloop, attachment, media, embedder, oEmbed
    44Requires at least: 4.1
    55Tested up to: 4.3.2
    6 Stable tag: 11.1.6
     6Stable tag: 11.1.7
    77
    88An assortment of functions to enhance WordPress.
     
    151151
    152152== Changelog ==
     153= 11.1.7 =
     154*   *Release Date - 16th, October, 2015*
     155*   Author update
     156*   @error suppression for file_get_contents on [mom_reddit] .json feeds in the off-chance the linked feed should stop working (for whatever reason)
     157
    153158= 11.1.6 =
    154159*   *Release Date - 13th, October, 2015*
Note: See TracChangeset for help on using the changeset viewer.