Plugin Directory

Changeset 462984


Ignore:
Timestamp:
11/15/2011 08:32:51 AM (14 years ago)
Author:
Trendwerk
Message:

Recommit 2.1

Location:
multiple-content-blocks
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • multiple-content-blocks/trunk/multiple_content.php

    r382789 r462984  
    6868    $current_theme_url = $theme['Template'];
    6969    $child_theme_url = str_replace('themes/','',strstr(get_stylesheet_directory_uri(),'themes/'));
    70 
    71     if(fopen(str_replace($current_theme_url,$child_theme_url,$fileToRead), 'r')) { //child theme exists
    72         $fileToRead = str_replace($current_theme_url,$child_theme_url,$fileToRead);
    73         $f = fopen($fileToRead, 'r');
    74     } else {
    75         $f = fopen($fileToRead, 'r');
    76     }
    77     $contents = fread($f, filesize($fileToRead));
    78     $contents = htmlspecialchars( $contents );
     70   
     71    if(file_exists(str_replace($current_theme_url,$child_theme_url,$fileToRead))) {
     72        if(fopen(str_replace($current_theme_url,$child_theme_url,$fileToRead), 'r')) { //child theme exists
     73            $fileToRead = str_replace($current_theme_url,$child_theme_url,$fileToRead);
     74            $f = fopen($fileToRead, 'r');
     75        } else {
     76            $f = fopen($fileToRead, 'r');
     77        }
     78        $contents = fread($f, filesize($fileToRead));
     79        $contents = htmlspecialchars( $contents );
     80    }
    7981   
    8082    //read the templates header, sidebar and footer, added in v1.1
     
    184186    $child_theme_url = str_replace('themes/','',strstr(get_stylesheet_directory_uri(),'themes/'));
    185187
    186     if(fopen(str_replace($current_theme_url,$child_theme_url,$fileToRead), 'r')) { //child theme exists
    187         $fileToRead = str_replace($current_theme_url,$child_theme_url,$fileToRead);
    188         $f = fopen($fileToRead, 'r');
    189     } else {
    190         $f = fopen($fileToRead, 'r');
    191     }
    192     $tagContents = fread($f, filesize($fileToRead));
    193     $tagContents = htmlspecialchars( $tagContents );
     188    if(file_exists(str_replace($current_theme_url,$child_theme_url,$fileToRead))) {
     189        if(fopen(str_replace($current_theme_url,$child_theme_url,$fileToRead), 'r')) { //child theme exists
     190            $fileToRead = str_replace($current_theme_url,$child_theme_url,$fileToRead);
     191            $f = fopen($fileToRead, 'r');
     192        } else {
     193            $f = fopen($fileToRead, 'r');
     194        }
     195        $tagContents = fread($f, filesize($fileToRead));
     196        $tagContents = htmlspecialchars( $tagContents );
     197    }
    194198   
    195199    return $tagContents;
  • multiple-content-blocks/trunk/readme.txt

    r382789 r462984  
    44Tags: multiple,content,blocks,multiplecontent,page,pageblocks
    55Requires at least: 2.8
    6 Tested up to: 3.1.2
    7 Stable tag: 2.0
     6Tested up to: 3.2.1
     7Stable tag: 2.1
    88
    99Lets you use more than one content "block" on a template. You only have to insert one tag inside the template, so it's easy to use.
     
    4141
    4242== Changelog ==
     43
     44= 2.1 =
     45* Fixed the bug that caused errors to show in the meta box when there was no template
    4346
    4447= 2.0 =
Note: See TracChangeset for help on using the changeset viewer.