Plugin Directory

Changeset 397524


Ignore:
Timestamp:
06/15/2011 03:09:55 PM (15 years ago)
Author:
CJ_Jackson
Message:

Updated to 0.1.5

Location:
html5avmanager
Files:
76 added
3 edited

Legend:

Unmodified
Added
Removed
  • html5avmanager/trunk/html5avmanager.php

    r397419 r397524  
    55  Plugin URI: http://cj-jackson.com/
    66  Description: A video manager with a Modal-View-Controller and video uploader.
    7   Version: 0.1.4
     7  Version: 0.1.5
    88  Author: Christopher John Jackson
    99  Author URI: http://cj-jackson.com/
  • html5avmanager/trunk/lib/model/html5av_audio_video.php

    r397041 r397524  
    114114        $this->modified = html5av_time::getUTC();
    115115    }
    116    
     116
    117117    public function getSources($incDisabled = false) {
    118         return html5av_source_table::getByAudioVideoId($this->ID,
    119                 $incDisabled);
    120     }
    121    
     118        return html5av_source_table::getByAudioVideoId($this->ID, $incDisabled);
     119    }
     120
    122121    public function getTracks($incDisabled = false) {
    123         return html5av_track_table::getByAudioVideoId($this->ID,
    124                 $incDisabled);
    125     }
    126    
     122        return html5av_track_table::getByAudioVideoId($this->ID, $incDisabled);
     123    }
     124
    127125    public function getPoster() {
    128         return html5av_manager::getUploadDir().'/'.
    129                 $this->getPosterPath().'/'.$this->getPosterFilename();
    130     }
    131    
     126        return html5av_manager::getUploadDir() . '/' .
     127        $this->getPosterPath() . '/' . $this->getPosterFilename();
     128    }
     129
    132130    public function getPosterUrl() {
    133         return html5av_manager::getUploadUrl().'/'.
    134                 $this->getPosterPath().'/'.$this->getPosterFilename();
    135     }
    136    
     131        return html5av_manager::getUploadUrl() . '/' .
     132        $this->getPosterPath() . '/' . $this->getPosterFilename();
     133    }
     134
    137135    public function getAuthorName() {
    138136        $user_info = get_userdata($this->getAuthorId());
     
    192190            $sources = $this->getSources(true);
    193191            $tracks = $this->getTracks(true);
    194             foreach($sources as $source) {
     192            foreach ($sources as $source) {
    195193                $source->delete();
    196194            }
    197             foreach($tracks as $track) {
     195            foreach ($tracks as $track) {
    198196                $track->delete();
    199197            }
     
    221219    static public function pager() {
    222220        $db = new html5av_dbal();
    223         $sql = "SELECT count(*) as COUNT FROM `" . $db->getPrefix() . "audio_video`";
     221        $sql = "SELECT count(*) as `COUNT` FROM `" . $db->getPrefix() . "audio_video`";
    224222        $query = $db->query($sql);
    225         $data = $query->fetch();
    226         $count = (int) $data['COUNT'];
     223        if ($query) {
     224            $data = $query->fetch();
     225            $count = (int) $data['COUNT'];
     226        } else {
     227            //Failsafe for when SQL count() fails
     228            $count = self::getCount();
     229        }
    227230        $lastPage = (int) ceil($count / 25);
    228231        $array = array(
     
    237240        $offset = ($page - 1) * 25;
    238241        $sql = "SELECT * FROM `" . $db->getPrefix() . "audio_video` ORDER BY ID DESC
    239             LIMIT ".$offset.", 25;";
     242            LIMIT " . $offset . ", 25;";
    240243        $prepare = $db->prepare($sql);
    241244        $prepare->execute();
     
    246249        return $objects;
    247250    }
     251   
     252    static private function getCount() {
     253        $db = new html5av_dbal();
     254        $sql = "SELECT * FROM `" . $db->getPrefix() . "audio_video`;";
     255        $prepare = $db->prepare($sql);
     256        $prepare->execute();
     257        return (int) count($prepare->fetchAll());
     258    }
    248259
    249260}
  • html5avmanager/trunk/readme.txt

    r397419 r397524  
    55Requires at least: 2.7
    66Tested up to: 3.2
    7 Stable tag: 0.1.4
     7Stable tag: 0.1.5
    88
    99A HTML5 Audio and Video manager that take full advantage of
     
    6262== Changelog ==
    6363
     64= 0.1.5 =
     65* Added failsafe for when SQL count() fails on some server.
     66
    6467= 0.1.4 =
    6568* Fixed JavaScript issue with pagenation.
Note: See TracChangeset for help on using the changeset viewer.