WordPress.org

Support

Support » Plugins and Hacks » WORDPRESS VIDEO GALLERY » [Resolved] Videos missing from admin

[Resolved] Videos missing from admin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Please open wp-content\plugins\contus-video-gallery\admin\models\video.php and find the below function

    public function get_videodata($searchValue,$searchBtn,$order,$orderDirection)
            {//function for getting search videos starts
                $where='';
                $user_role = $this->get_current_user_role();
                $current_user = wp_get_current_user();
                if($user_role!='administrator'){
                    $where .=  " WHERE a.member_id=".$current_user->ID;
                }
                $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
                $orderFilterlimit = filter_input(INPUT_GET, 'filter');
                if(isset($searchBtn))
                {
                    if(empty($where)){
                        $where .= " WHERE";
                    } else {
                        $where .= " AND";
                    }
                    $where .=  " (a.name LIKE '%" . $searchValue . "%' || a.description LIKE '%" . $searchValue . "%')";
                }
                if(!isset($orderDirection))
                {
                    $orderDirection = 'DESC';
                }
               $query = "SELECT DISTINCT (a.vid) FROM ".$this->_videotable .' a
                        LEFT JOIN '. $this->_wpdb->prefix .'users u
                        ON u.ID=a.member_id
                        LEFT JOIN '. $this->_wpdb->prefix .'hdflvvideoshare_med2play p
                        ON p.media_id=a.vid
                        LEFT JOIN '. $this->_wpdb->prefix .'hdflvvideoshare_playlist pl
                        ON pl.pid=p.playlist_id
                        '.$where ."
                        ORDER BY ". $order . ' '.$orderDirection;
                $total = count($this->_wpdb->get_results($query));
                if(!empty($orderFilterlimit) && $orderFilterlimit !== 'all'){
                    $limit = $orderFilterlimit;
                } else if($orderFilterlimit === 'all'){
                    $limit = $total;
                } else {
                    $limit = 20;
                }
                $offset = ( $pagenum - 1 ) * $limit;
               $query = "SELECT DISTINCT (a.vid),a.*,u.display_name FROM ".$this->_videotable .' a
                        LEFT JOIN '. $this->_wpdb->prefix .'users u
                        ON u.ID=a.member_id
                        LEFT JOIN '. $this->_wpdb->prefix .'hdflvvideoshare_med2play p
                        ON p.media_id=a.vid
                        LEFT JOIN '. $this->_wpdb->prefix .'hdflvvideoshare_playlist pl
                        ON pl.pid=p.playlist_id
                        '.$where ."
                        ORDER BY ". $order . ' '.$orderDirection."
                        LIMIT $offset, $limit";
                return $this->_wpdb->get_results($query);
            }//function for getting search videos ends

    and replace with the following code.

    public function get_videodata($searchValue,$searchBtn,$order,$orderDirection)
            {//function for getting search videos starts
            global $wpdb;
                $where='';
                $user_role = $this->get_current_user_role();
                $current_user = wp_get_current_user();
                if($user_role!='administrator'){
                    $where .=  " WHERE a.member_id=".$current_user->ID;
                }
                $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
                $orderFilterlimit = filter_input(INPUT_GET, 'filter');
                if(isset($searchBtn))
                {
                    if(empty($where)){
                        $where .= " WHERE";
                    } else {
                        $where .= " AND";
                    }
                    $where .=  " (a.name LIKE '%" . $searchValue . "%' || a.description LIKE '%" . $searchValue . "%')";
                }
                if(!isset($orderDirection))
                {
                    $orderDirection = 'DESC';
                }
               $query = "SELECT DISTINCT (a.vid) FROM ".$this->_videotable ." a
                        LEFT JOIN $wpdb->users u
                        ON u.ID=a.member_id
                        LEFT JOIN ". $this->_wpdb->prefix ."hdflvvideoshare_med2play p
                        ON p.media_id=a.vid
                        LEFT JOIN ". $this->_wpdb->prefix ."hdflvvideoshare_playlist pl
                        ON pl.pid=p.playlist_id
                        ".$where ."
                        ORDER BY ". $order . ' '.$orderDirection;
                $total = count($this->_wpdb->get_results($query));
                if(!empty($orderFilterlimit) && $orderFilterlimit !== 'all'){
                    $limit = $orderFilterlimit;
                } else if($orderFilterlimit === 'all'){
                    $limit = $total;
                } else {
                    $limit = 20;
                }
                $offset = ( $pagenum - 1 ) * $limit;
               $query = "SELECT DISTINCT (a.vid),a.*,u.display_name FROM ".$this->_videotable ." a
                        LEFT JOIN $wpdb->users u
                        ON u.ID=a.member_id
                        LEFT JOIN ". $this->_wpdb->prefix ."hdflvvideoshare_med2play p
                        ON p.media_id=a.vid
                        LEFT JOIN ". $this->_wpdb->prefix ."hdflvvideoshare_playlist pl
                        ON pl.pid=p.playlist_id
                        ".$where ."
                        ORDER BY ". $order . ' '.$orderDirection."
                        LIMIT $offset, $limit";
                return $this->_wpdb->get_results($query);
            }//function for getting search videos ends

    Now open the following files and find " . $wpdb->prefix . "users and replace with $wpdb->users

    wp-content\plugins\contus-video-gallery\front\models\videohome.php
    wp-content\plugins\contus-video-gallery\front\models\videomore.php
    wp-content\plugins\contus-video-gallery\front\models\videoshortcode.php
    wp-content\plugins\contus-video-gallery\front\helper\query.php

    If you are still facing the same issue, feel free to contact us.

    thankyou. i implemented the first instruction and that worked in the case of displaying the videos in admin however when i followed the second instruction i received this error:
    Parse error: syntax error, unexpected ‘$wpdb’ (T_VARIABLE) in /home/wwwmixhe/public_html/wp-content/plugins/contus-video-gallery/front/models/videohome.php on line 139

    Hi,

    You code should look like the following one http://screencast.com/t/9rFBin8kNlwf. If you are still facing the same error, please contact our support team at Apptha.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Videos missing from admin’ is closed to new replies.
Skip to toolbar