• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] Videos showing per category

Started by x5000x,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

x5000xTopic starter

Hello,

When i click on any category it only displays 100 videos not all of them, does anyone have this problem? if yes, any solution for the fix?
  •  

PHPVibe A.

Does it say "The end"?

Do you have:

<ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</ifModule>


in your .htaccess file (root one)

x5000xTopic starter

Alex,

It does say "The end"

I already have that code in .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^embed/([^/]*)/$ /embed.php?id=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php?rp=$1 [L]
</IfModule>
<ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</ifModule>
  •  

PHPVibe A.

How many videos do you have as "Browse per page" in config?

x5000xTopic starter

  •  

PHPVibe A.

Not sure what may short it, any errors in log?
You are telling me that basically page 1 and 2 load fine, and page 3 and bigger fail?

x5000xTopic starter

Alex,

First 50 videos loads fine when i scroll down then i get "Loading text" than loads another 50 then it says "The end" and when i count there is only 100 videos but there is over 500 videos in that category.

I cleared all logs to get fresh massages will post if anything gets in there but most of it is php notices.
  •  

PHPVibe A.


x5000xTopic starter

Alex,

Did little experiment, if I set Browse per page 20 it loads 20 + 1 time more and loads another 20 that is total of 40.

If i set Browse per page 200 loads 200 + 1 more time and loads another 200 that is of 400 videos.

So at the end it only load one time and it shows THE END.

The only error i see in error logs is:

[17-Feb-2014 17:04:05 Europe/Berlin] PHP Warning:  Missing boundary in multipart/form-data POST data in Unknown on line 0
[17-Feb-2014 17:09:18 Europe/Berlin] PHP Warning:  Missing boundary in multipart/form-data POST data in Unknown on line 0
  •  

PHPVibe A.

That warning is from a form/post, unrelated to this.

Ok, so here is a normal navigation (yes it has no design to speed the ajax call)

http://www.videoinedit.com/channel/comedy-humor/3/&ajax&p=2
http://www.videoinedit.com/channel/comedy-humor/3/&ajax&p=3

If you look in your page's source you should see this link as pagination for infinitescroll:

<nav id="page_nav">
<a href="http://www.videoinedit.com/channel/comedy-humor/3/&ajax&p=3"></a>
</nav>


Change p= to p=3, p=4 (pages number) and see if it's any issue.


x5000xTopic starter

Alex,

Like that is does list pages and videos on them. I tried up to 10 pages and works.
  •  

PHPVibe A.


PHPVibe A.

Ok, here is a workaround:

com/com_channel.php
right after:

if ($channel) {


add:

//Count
$count = $cachedb->get_row("Select count(*) as nr from ".DB_PREFIX."videos where category in (select cat_id from ".DB_PREFIX."channels where cat_id='".$id ."' or child_of = '".$id ."')");



tpl/main/channel.php

find:

include_once(TPL.'/video-loop.php');


and replace it with:

$kill_infinite = true;
include_once(TPL.'/video-loop.php');
$a = new pagination;	
$a->set_current(this_page());
$a->set_first_page(true);
$a->set_pages_items(7);
$a->set_per_page(bpp());
$a->set_values($count->nr);
$a->show_pages($canonical.'&p=');


This will change it to a pagination.


x5000xTopic starter

  •  

mio

I'd like to have classic pagination instead of the infinite scroll in homepage.
How to make this mod?

Thanks.
  •  

PHPVibe A.

Hmm, it should be the same like up with the counting sql changed to your type of home block.

mio

I've edited the home.php and the mod works but in homepage I get 1 error:

Notice: Undefined variable: id in /home/xxxxx/public_html/xxxxxxx/tpl/main/home.php on line 8

Probably because: $count = $cachedb->get_row("Select count(*) as nr from ".DB_PREFIX."videos where category in (select cat_id from ".DB_PREFIX."channels where cat_id='".$id ."' or child_of = '".$id ."')");
is referred to the channel pagination

Here you can see my modification. Can you check it, please?

  •  

PHPVibe A.

You need to change the count to the same query used by the homeblock you use, this just tried to query that category.

Example, if using recent:
else:
$vq = "select ".$options.", ".DB_PREFIX."users.name as owner FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id WHERE ".DB_PREFIX."videos.views >= 0 and pub > 0 $c_add ORDER BY ".DB_PREFIX."videos.id DESC ".this_offset($limit);
endif;


to
else:
$vq = "select ".$options.", ".DB_PREFIX."users.name as owner FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id WHERE ".DB_PREFIX."videos.views >= 0 and pub > 0 $c_add ORDER BY ".DB_PREFIX."videos.id DESC ".this_offset($limit);
 $count = $cachedb->get_row("Select count(*) from  FROM ".DB_PREFIX."videos WHERE pub > 0"); 
endif;


It will count all published videos.

mio

Alex,
I've added:
$count = $cachedb->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE pub > 0");

instead of:

//Count
$count = $cachedb->get_row("Select count(*) as nr from ".DB_PREFIX."videos where category in (select cat_id from ".DB_PREFIX."channels where cat_id='".$id ."' or child_of = '".$id ."')");


The pagination in home works very good now! Thank you for your input, you're great!!

Here there is the attached file for people looking for this modification.

Ps: When you add a sitemap plugin?
  •  

PHPVibe A.

We'll add soon a plugin, right now working on a patch for 3.5

Similar topics (7)