Plugin Directory

Changeset 1687406


Ignore:
Timestamp:
06/29/2017 01:29:40 AM (9 years ago)
Author:
oldcwj
Message:

update support php7

Location:
wpapper/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wpapper/trunk/lib/common/template.inc.php

    r1684956 r1687406  
    197197  * @return    void
    198198  */
    199   function Template($root = ".", $unknowns = "remove") {
     199  function __construc($root = ".", $unknowns = "remove") {
    200200    if ($this->debug & 4) {
    201201      echo "<p><b>Template:</b> root = $root, unknowns = $unknowns</p>\n";
     
    205205  }
    206206
     207  function Template($root = ".", $unknowns = "remove") {
     208    self::__construc($root, $unknowns);
     209  }
    207210
    208211 /******************************************************************************
     
    221224  */
    222225  function set_root($root) {
    223     if(preg_match('/$', $root)) {
     226    if(preg_match('/\/$/', $root)) {
    224227      $root = substr($root, 0, -1);
    225228    }
  • wpapper/trunk/lib/common/util.inc.php

    r1685328 r1687406  
    337337 */
    338338function wpapper_get_image_avatar_by_id_or_email($id_or_email){
    339     $img_file_prix = wp_upload_dir().'/';
    340     $myavatar_prix = wp_upload_dir().'/';
     339    $upload_dir = wp_upload_dir();
     340    $img_file_prix = $upload_dir['basedir'].'/';
     341    $myavatar_prix = $upload_dir['basedir'].'/';
    341342    $mymd5 = wpapper_sign64($id_or_email);
    342343    if ( ! file_exists($img_file_prix.$mymd5.'.jpg')){
  • wpapper/trunk/lib/json/class-wp-json-customposttype.php

    r1683889 r1687406  
    107107     * @see WP_JSON_Posts::get_posts()
    108108     */
    109     public function get_posts( $filter = array(), $context = 'view', $type = null, $page = 1 ) {
     109    public function get_posts( $filter = array(), $context = 'view', $type = null, $page = 1, $offline=false ) {
    110110        if ( ! empty( $type ) && $type !== $this->type ) {
    111111            wpapper_json_error(BigAppErr::$post['code'],BigAppErr::$post['msg'],"");
     
    120120     * @see WP_JSON_Posts::get_post()
    121121     */
    122     public function get_post( $id, $context = 'view' ) {
     122    public function get_post( $id, $context = 'view', $is_featured_image=false ) {
    123123        $id = (int) $id;
    124124
     
    189189     * @return array The prepared post data
    190190     */
    191     protected function prepare_post( $post, $context = 'view' ) {
     191    protected function prepare_post( $post, $context = 'view', $show_type= 'row' ) {
    192192        $_post = parent::prepare_post( $post, $context );
    193193        if ( is_wp_error( $_post ) ) {
  • wpapper/trunk/lib/json/class-wp-json-media.php

    r1683889 r1687406  
    3131     * @see WP_JSON_Posts::get_posts()
    3232     */
    33     public function get_posts( $filter = array(), $context = 'view', $type = 'attachment', $page = 1 ) {
     33    public function get_posts( $filter = array(), $context = 'view', $type = 'attachment', $page = 1, $offline=false ) {
    3434        if ( $type !== 'attachment' ) {
    3535            wpapper_json_error(BigAppErr::$post['code'],BigAppErr::$post['msg'],"");
     
    6666     * @see WP_JSON_Posts::get_post()
    6767     */
    68     public function get_post( $id, $context = 'view' ) {
     68    public function get_post( $id, $context = 'view', $is_featured_image=false ) {
    6969        $id = (int) $id;
    7070
     
    8888     * @return array
    8989     */
    90     protected function prepare_post( $post, $context = 'single' ) {
     90    protected function prepare_post( $post, $context = 'single', $show_type= 'row' ) {
    9191        $data = parent::prepare_post( $post, $context );
    9292
  • wpapper/trunk/lib/json/class-wp-json-pages.php

    r1683889 r1687406  
    119119     * @return array The prepared post data
    120120     */
    121     protected function prepare_post( $post, $context = 'view' ) {
     121    protected function prepare_post( $post, $context = 'view', $show_type= 'row' ) {
    122122        $_post = parent::prepare_post( $post, $context );
    123123
  • wpapper/trunk/wpapper.class.php

    r1684731 r1687406  
    497497        $myavatar = wpapper_get_image_avatar_by_id_or_email($id_or_email);
    498498        $avatar = sprintf(
    499             "<img alt='%s' src='%s'  class='%s' height='%d' width='%d' %s/>",
    500             esc_attr( $args['alt'] ),
     499            "<img  src='%s'  class='%s' height='%d' width='%d' />",
     500            //esc_attr( $args['alt'] ),
    501501            esc_url( $myavatar),
    502502            "class",
    503             50,50,
    504             $args['extra_attr']
     503            50,50
     504            //$args['extra_attr']
    505505        );
    506506        return apply_filters('bigapp_get_avatar_filter', $avatar, $id_or_email, $size, $default, $alt);
Note: See TracChangeset for help on using the changeset viewer.