WordPress.org

Ready to get started?Download WordPress

Forums

WORDPRESS VIDEO GALLERY
[resolved] Videos missing from admin (4 posts)

  1. glosshog
    Member
    Posted 6 months ago #

    No videos are displaying in my admin however they appear on the front end. Also I can add a video but once again it does not appear in the list.

    thankyou

    http://wordpress.org/plugins/contus-video-gallery/

  2. karthikeyani
    Member
    Posted 6 months ago #

    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.

  3. glosshog
    Member
    Posted 5 months ago #

    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

  4. karthikeyani
    Member
    Posted 5 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.