Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2012-01-03 10:43:17

lude
Member
Registered: 2010-12-29
Posts: 44

Related Videos next button

the next button of the related videos under the videoplayer dosent work anymore

Offline

#2 2012-01-03 11:38:38

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

Will check. I think i have access to your server in emails.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2012-01-03 22:17:23

PastorSinAlot
Member
Registered: 2011-09-05
Posts: 27

Re: Related Videos next button

mines never work

Offline

#4 2012-01-04 08:18:31

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

Checking!


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2012-02-15 06:13:34

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

Hi, I'm new here. Mine doesn't work either. Is there a fix for this?

Offline

#6 2012-02-15 08:05:03

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

Hmmm....i'm gonna provide a fix. It should work.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#7 2012-02-15 08:18:07

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

Ok. How long will I have to wait? I hate paying for things and they don't work. Just a little agitating. Thanks.

Last edited by cybra (2012-02-15 08:19:37)

Offline

#8 2012-02-15 10:58:35

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

Hey man you know what. I see where this is going. Don't worry about it, because I know you must have a lot on your plate. I probably will just get another programmer I know to look at it.

Offline

#9 2012-02-15 12:20:00

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

I was going to checkout why the related button doesnt work right now, but if you want to hire someone to do this, i have no problem with that. Good luck.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#10 2012-02-15 12:28:27

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

I just tested this on scriptdevel.com and my box and it works. Anyone that reported this, please email me FTP access so i can check.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#11 2012-02-15 19:28:24

jaydenblair@live.co.uk
Member
From: United Kingdom
Registered: 2011-10-30
Posts: 369
Website

Re: Related Videos next button

mine does not work as well you have my ftp details i evan made you an account smile

Offline

#12 2012-02-16 00:50:06

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

I mean I would rather not have to pay anyone else to do it. I will PM you a temp ftp also.

Offline

#13 2012-02-16 08:15:46

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

Fixed the related videos problem. Please replace templates/your-template/extend/ajax/replated.plugin.php with the below code:

<?php
defined('_VALID') or die('Restricted Access!');
function ajax_plugin_related()
{
        $data = array('status' => 0, 'msg' => '', 'code' => '', 'debug' => '');
        if (isset($_POST['video_id']) && isset($_POST['page'])) {
                $video_id       = (int) $_POST['video_id'];
                $page           = (int) $_POST['page'];

                $db = VF::factory('database');
                $db->query("SELECT v.title, GROUP_CONCAT(DISTINCT vt.name) AS tags,
                                   GROUP_CONCAT(DISTINCT c.cat_id) AS categories
                            FROM #__video AS v
                            INNER JOIN #__video_tags AS vt ON (vt.video_id = v.video_id)
                            INNER JOIN #__video_category AS c ON (c.video_id = v.video_id)
                            WHERE v.video_id = ".$video_id."
                            AND v.status = 1
                            LIMIT 1");
                if ($db->affected_rows()) {
                        VLanguage::load('frontend.video');

                        $video  = $db->fetch_assoc();
                        $vcfg   = VF::cfg('module.video');
                        $limit  = $vcfg['related_per_page'];
                        $start  = ($page === 1) ? 0 : ($page*$limit);
                        if ($vcfg['related_category']) {
                                $query  = ($vcfg['related_method'] == 'simple')
                                        ? get_related_category_simple($video_id, $video['title'], $video['categories'], $start, $limit)
                                        : get_related_category_complex($video_id, $video['tags'], $video['categories'], $start, $limit);
                        } else {
                                $query  = ($vcfg['related_method'] == 'simple')
                                        ? get_related_simple($video_id, $video['title'], $start, $limit)
                                        : get_related_complex($video_id, $video['tags'], $start, $limit);
                        }

                        $related_total  = $query['total'];
                        if ($related_total > $vcfg['related_total']) {
                                $related_total = $vcfg['related_total'];
                        }

                        $pagination             = VPagination::get($page, $related_total, $limit);

                        $tpl_url                = BASE_URL.'/templates/'.VF::cfg_item('template');
                        $code                   = array();
                        $code[]                 = '<div id="related-left" class="related-bar">';
                        $code[]                 = ($page > 1) ? '<a href="#related-page-'.$pagination['prev_page'].'" id="related-'.$pagination['prev_page'].'"><img src="'.$tpl_url.'/images/related-bar-left.png" alt="" /></a>' : '&nbsp';
                        $code[]                 = '</div>';
                        $code[]                 = '<div class="content left width-900" style="min-height: 400px;">';
                        if ($related) {
                                foreach ($related as $video) {
                                        $title          = htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8');
                                        $views          = ($video['total_views'] == '1') ? __('view') : __('views');
                                        $code[]         = '<div id="video-'.$video['video_id'].'" class="video related">';
                                        $code[]         = '<a href="'.BASE_URL.'/'.$video['video_id'].'/'.$video['slug'].'/" title="'.$title.'">';
                                        $code[]         = '<img src="'.THUMB_URL.'/'.path($video['video_id']).'/'.$video['thumb'].'.jpg" alt="'.$title.'" id="preview-video-'.$video['video_id'].'-'.$video['thumb'].'-'.$video['thumbs'].'" /><br />';
                                        $code[]         = '<h5>'.htmlspecialchars(VText::truncate_chars($video['title'], 50), ENT_QUOTES, 'UTF-8').'</h5>';
                                        if ($video['ext'] == 'mp4') {
                                                $code[]         = '<img src="'.$tpl_url.'/images/hd.png" class="watermark" alt="" />';
                                        }
                                        $code[]         = '</a>';
                                        $code[]         = '<span class="duration">'.VDate::duration($video['duration']).'</span>';
                                        $code[]         = '<div class="rating_bar"><div style="width:'.round($video['rating']*20).'%"></div></div>';
                                        $code[]         = '<span class="timeline clear">'.VDate::nice($video['add_time']).'</span>';
                                        $code[]         = '<span class="views">'.$video['total_views'].' '.$views.'</span>';
                                        $code[]         = '<div class="clear"></div>';
                                        $code[]         = '</div>';
                                }
                                $code[]                 = '<div class="clear-left"></div>';
                        } else {
                                $code[]         = '<div class="none">'.__('no-related-videos').'</div>';
                        }
                        $code[]                 = '</div>';
                        $code[]                 = '<div id="related-right" class="related-bar">';
                        $code[]                 = ($page < $pagination['total_pages']) ? '<a href="#related-page-'.$pagination['next_page'].'" id="related-'.$pagination['next_page'].'"><img src="'.$tpl_url.'/images/related-bar-right.png" alt="" /></a>' : '&nbsp;';
                        $code[]                 = '</div>';
                        $code[]                 = '<div class="clear-left"></div>';

                        $data['code']   = implode("\n", $code);
                        $data['status'] = 1;
                } else {
                        $data['msg'] = 'Invalid ajax request!';
                }
        } else {
                $data['msg'] = 'Invalid ajax request!';
        }

        return json_encode($data);
}

function get_related_category_simple($video_id, $title, $categories, $start, $limit)
{
        $db                     = VF::factory('database');
        $title      = $db->escape($title);
    $sql_count  = "SELECT COUNT(*) AS total_related
                   FROM #__video AS v
                   INNER JOIN #__video_category AS c ON (c.video_id = v.video_id AND c.cat_id IN (".$categories."))
                   WHERE MATCH (v.title) AGAINST ('".$title."')
                   AND v.status = 1";
    return array(
                'total' => $db->get_field($sql_count, 'total_related'),
        'sql'   => "SELECT v.video_id, v.title, v.slug, v.rating, v.rated_by, v.duration, v.thumb,
                           v.thumbs, v.total_views, v.add_time, v.ext, u.username,
                           MATCH (v.title) AGAINST ('".$title."') AS relevance
                    FROM #__video AS v
                    INNER JOIN #__video_category AS c ON (c.video_id = v.video_id AND c.cat_id IN (".$categories."))
                    LEFT JOIN #__user AS u ON (u.user_id = v.user_id)
                    WHERE MATCH (v.title) AGAINST ('".$title."')
                    AND v.status = 1
                    AND v.video_id != ".$video_id."
                    ORDER BY relevance DESC
                    LIMIT ".$start.",".$limit
    );
}

function get_related_category_complex($video_id, $tags, $categories, $start, $limit)
{
        VF::load('sphinxapi.sphinxapi');
    $sphinx     = new SphinxClient();
    $sphinx->SetServer('localhost', 3312);
    $sphinx->SetConnectTimeout(1);
    $sphinx->SetFieldWeights(array('tags' => 100, 'title' => 70, 'description' => 30));
    $sphinx->SetFilter('categories', array_values(explode(',', $categories)));
    $sphinx->SetFilter('video', array($video_id), true);
    $sphinx->SetMatchMode(SPH_MATCH_ANY);
    $sphinx->SetLimits($start, $limit, 1000);
    $results    = $sphinx->Query(str_replace(',',' ', $tags), 'videos');

    if (isset($results['total']) && isset($results['matches'])) {
                $ids    = implode(',', array_keys($results['matches']));
        return array(
                'total' => $results['total'],
            'sql'   => 'SELECT v.video_id, v.title, v.slug, v.rating, v.rated_by, v.duration, v.thumb,
                               v.thumbs, v.total_views, v.add_time, v.ext, u.username
                        FROM #__video AS v
                        LEFT JOIN #__user AS u on (u.user_id = v.user_id)
                        WHERE v.video_id IN ('.$ids.')
                        ORDER BY FIELD (v.video_id, '.$ids.')'
        );
    }

    return array('total' => 0, 'sql' => FALSE);
}

function get_related_simple($video_id, $title, $start, $limit)
{
        $db             = VF::factory('database');
        $title      = $db->escape($title);
    $sql_count  = "SELECT COUNT(*) AS total_related
                   FROM #__video AS v
                   WHERE MATCH (v.title) AGAINST ('".$title."')
                   AND v.status = 1";
    return array(
                'total' => $db->get_field($sql_count, 'total_related'),
        'sql'   => "SELECT v.video_id, v.title, v.slug, v.rating, v.rated_by, v.duration, v.thumb,
                           v.thumbs, v.total_views, v.add_time, v.ext, u.username,
                           MATCH (v.title) AGAINST ('".$title."') AS relevance
                    FROM #__video AS v
                    LEFT JOIN #__user AS u ON (u.user_id = v.user_id)
                    WHERE MATCH (v.title) AGAINST ('".$title."')
                    AND v.status = 1
                    AND v.video_id != ".$video_id."
                    ORDER BY relevance DESC
                    LIMIT ".$start.",".$limit
    );
}

function get_related_complex($video_id, $tags, $start, $limit)
{
        VF::load('sphinxapi.sphinxapi');
    $sphinx     = new SphinxClient();
    $sphinx->SetServer('localhost', 3312);
    $sphinx->SetConnectTimeout(1);
    $sphinx->SetFieldWeights(array('tags' => 100, 'title' => 70, 'description' => 30));
    $sphinx->SetMatchMode(SPH_MATCH_ANY);
    $sphinx->SetFilter('video', array($video_id), true);
    $sphinx->SetLimits($start, $limit, 1000);
    $results    = $sphinx->Query(str_replace(',', ' ', $tags), 'videos');

    if (isset($results['total']) && isset($results['matches'])) {
                $ids    = implode(',', array_keys($results['matches']));
        return array(
                'total' => $results['total'],
            'sql'   => 'SELECT v.video_id, v.title, v.slug, v.rating, v.rated_by, v.duration, v.thumb,
                               v.thumbs, v.total_views, v.add_time, v.ext, u.username
                        FROM #__video AS v
                        LEFT JOIN #__user AS u on (u.user_id = v.user_id)
                        WHERE v.video_id IN ('.$ids.')
                        ORDER BY FIELD (v.video_id, '.$ids.')'
        );
    }

    return array('total' => 0, 'sql' => FALSE);
}

Or you can download the file from http://www.pronguide.com/related.plugin.php.txt


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#14 2012-02-16 08:46:26

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

Still not working..smh http://thatassphat.com/204/3-phat-asses-catching-loads/ I thought you were just gonna fix it since I gave you ftp access.

Offline

#15 2012-02-16 10:51:24

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Related Videos next button

It is fixed on your site. If you changed the code again, then thats the problem, but i fixed it first on your site and after that i posted the fix topic.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#16 2012-02-16 10:52:45

cybra
Member
From: U.S Carolinas
Registered: 2012-02-15
Posts: 117
Website

Re: Related Videos next button

Fixed. Thanks smile

Offline

#17 2012-02-16 20:33:15

PastorSinAlot
Member
Registered: 2011-09-05
Posts: 27

Re: Related Videos next button

can you please fix mines

Offline

#18 2012-02-19 22:51:21

xsporntv
Member
Registered: 2011-04-20
Posts: 139
Website

Re: Related Videos next button

Thanks Adrian! 


Works perfectly fine now.

Offline

Board footer

Powered by FluxBB