More "New Videos" on Startpage
Hi,
i just upgraded from 2.5 to 2.6, before the upgrade i had 3 line of new videos on the startpage (index.tpl). It seems like the old code i used in 2.5 is not working anymore. Have somebody of you any idea?
This is my old code from 2.5
Code:
<table width="100%" class="bg2">
<tr valign="top">
{section name=i loop=$new_video start=0 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#d0e8f3';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
<tr valign="top">
{section name=i loop=$new_video start=4 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#d0e8f3';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
<tr valign="top">
{section name=i loop=$new_video start=8 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#d0e8f3';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
</table>
Re: More "New Videos" on Startpage
yeah I need this too.. when I try to show 20 videos in new it ruins the template.. Help please.. anyone
Re: More "New Videos" on Startpage
admin can you help us?? i mean, you wrote the code^^ :wink:
Re: More "New Videos" on Startpage
i need it to, 5 thumb in 1 line is to much i need 4 thumb in 1 line and this 3 times.
if i use the old code it dosent work.
thx
http://www.xxx-hub.com
Re: More "New Videos" on Startpage
Admin, can you help us???
Re: More "New Videos" on Startpage
Hallo Admin,
you have progamming this script, do you now how to make. Or its imposibile to make.
please a answer!!!
Re: More "New Videos" on Startpage
yes this i know, but how i can make only 4 Videos in 1 line? now i have 5 in 1 line and this 3 times. i nees 4 in 1 line.
thx
Re: More "New Videos" on Startpage
Here's how you do it:
You go to the "new videos" section of the index.tpl in your templates directory. Look for this code:
Code:
<table width="100%" class="bg2">
<tr valign="top">
{section name=i loop=$new_video start=0 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
</table>
To make two rows of four, instead of just stacking up the videos in the table, use this code:
Code:
<table width="100%" class="bg2">
<tr valign="top">
{section name=i loop=$new_video start=0 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr><tr>
{section name=i loop=$new_video start=4 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
</table>
This creates a second row in the table and tells it to pull four more videos beginning with number 4 (0 through 3 appear in the first row). You can apply this same code to the other sections of the index page, adding rows. If you haven't edited the code in this section, you can simply copy the code above to the place in the file where the first example is and you will have two rows.
Hope this helps.
Re: More "New Videos" on Startpage
Quote:
Originally Posted by dakint
Here's how you do it:
You go to the "new videos" section of the index.tpl in your templates directory. Look for this code:
Code:
<table width="100%" class="bg2">
<tr valign="top">
{section name=i loop=$new_video start=0 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
</table>
To make two rows of four, instead of just stacking up the videos in the table, use this code:
Code:
<table width="100%" class="bg2">
<tr valign="top">
{section name=i loop=$new_video start=0 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr><tr>
{section name=i loop=$new_video start=4 max=4}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#e1e4f2';" onmouseover="this.style.backgroundColor='#ffff99';"><a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].title|lower|regex_replace:"/[^a-z0-9]+/":"-"}/">[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title}</a></td>
{/section}
</tr>
</table>
This creates a second row in the table and tells it to pull four more videos beginning with number 4 (0 through 3 appear in the first row). You can apply this same code to the other sections of the index page, adding rows. If you haven't edited the code in this section, you can simply copy the code above to the place in the file where the first example is and you will have two rows.
Hope this helps.
It is possible to do something similar for the "recent video" page?
i mean change the number of video for page and the number in each row?
thanks.