Location: PHPKode > projects > PowerMovieList > powermovielist-0_14_beta/templates/list/wbb2.tpl
{* wbb2-template for PowerMovieList

o this template can only be called through wbb2 - won't work anymore standalone!
o wbb2 and pml must use the same mysql-server (can be a different database)
o wbb2-users aren't used (only a check if guest then access_error)
o the pml-admin created when installing is still used for the configuration
o only works for single-list-mode without linklist and registeruser/list disabled
o some features are not implemented (like filters, chars etc..)

installation:
1. create a file movie.php (in wbb2-folder)with the following content:
<?php
$filename="movie.php";

require("./global.php");

if($wbbuserdata['title']=="Gäste") access_error();

ob_start();

chdir("../pml/");
include("list.php");

$Text= ob_get_contents();
ob_end_clean();

$db->select_db($sqldb);

$Text = str_replace("\"", "\\\"", $Text);
eval("\$tpl->output(\"".$Text."\");"); 
?>

2. edit this file: set the value of {assign var="pmldir" value="../pml"} to the right value where your pml is installed (relative to wbb2)

3. edit the wbb2-templates:
   "header": add link "movie-list" to 'movie.php?sid=$session[hash]'
	 "header_acp": add link "pml-config" to '../pml/editconfig.php'

4. set wbb2.tpl as list-template

*}
{assign var="pmldir" value="../pml"}
{ldelim}!DOCTYPE{rdelim}
<html>
<head>
<title>$master_board_name - Movies</title>
$headinclude
</head>

<body id="bg">
 $header
 <tr bgcolor="{ldelim}tablecolora{rdelim}" id="tablea">
  <td><table cellpadding=0 cellspacing=0 border=0 width="100%">
   <tr>
    <td><smallfont><b><a href="index.php?sid=$session[hash]">$master_board_name</a> » Movies</b></font></td>
    <td align="right"><smallfont><b>$usercbar</b></font></td>
   </tr>
  </table></td>
 </tr>
</table><br>
<table cellpadding=4 cellspacing=1 border=0 width="{ldelim}tableinwidth{rdelim}" bgcolor="{ldelim}tableinbordercolor{rdelim}">
{* the characters (can be switched of in config) *}
{if $ActiveList.showchars}
	<tr bgcolor="{ldelim}tablecolorb{rdelim}" id="tableb"><td colspan='{$PropShown}' align='center'><b><normalfont>
	{if $sDisplay.Char != ""}<a href='{$CharUrl}Char='>{$lang.strFormatAll}</a>{/if}
	{if $sDisplay.Char != "0"}<a href='{$CharUrl}Char=0'>0-9</a> {else}0-9 {/if}
  {foreach item=Chr from=$Chars}	
		{if $sDisplay.Char != $Chr}<a href='{$CharUrl}Char={$Chr}'>{$Chr} </a>{else}{$Chr} {/if}
  {/foreach}
	</normalfont></b></td></tr>

{/if}
{if $Nums}
	<tr bgcolor="{ldelim}tablecolorb{rdelim}" id="tableb"><td colspan='{$PropShown}' align='center'><b><normalfont>
		{foreach item=Num from=$Nums}	
			{if $Num.page == -1}
				{$Num.text}
			{else}
				<a href='{$NumUrl}&Page={$Num.page}'>{$Num.text}</a> 
			{/if}	
		{/foreach}
	</normalfont></b></td></tr>
{/if}
  <tr bgcolor="{ldelim}tabletitlecolor{rdelim}" id="tabletitle" align="center">
{foreach item=Prop from=$PropAll}	
  {if $Prop.ShowInList}
	  {if $Prop.UseSort}
		  <td><smallfont color="{ldelim}fontcolorsecond{rdelim}"><b><a href='{$SortUrl}&Sort={$Prop.ID}{if $sDisplay.SortPropID == $Prop.ID && $sDisplay.SortDirection == false}&Dir=1{/if}'>
			{$Prop.ListHeader} 			
			{if $sDisplay.SortPropID == $Prop.ID}
				{if $Prop.UseSort == 1 && $sDisplay.SortDirection == true || $Prop.UseSort == 2 && $sDisplay.SortDirection == false}
					<img src='{$pmldir}/image/sort/desc_order.gif' border=0>
				{else}
					<img src='{$pmldir}/image/sort/asc_order.gif' border=0>
				{/if}
			{/if}
			</a></b></smallfont></td>
		{else}
		  <td><smallfont color="{ldelim}fontcolorsecond{rdelim}"><b>{$Prop.ListHeader}</b></smallfont></td>
		{/if}
	{/if}
{/foreach}
{if $ActiveUserRights >= 4}<td>&nbsp;</td>{/if}
  </tr>

{assign var="GlobalArg" value=$CFG.GlobalArg}
{foreach item=MovieID key=kMovie from=$MovieIDs}
	{assign var="DownloadLink" value="<a href='$pmldir/popup.php$GlobalArg&ID=$MovieID' onClick=\"var popup=window.open(this.href,'infopopup','scrollbars=yes,resizable=yes,width=400,height=500'); popup.focus(); return false\">"}
	<tr bgcolor="{ldelim}tablecolorb{rdelim}" id="tableb">
	{foreach item=Prop from=$PropAll}
	  {assign var="Url" value=""}	  
		{if $Prop.ShowInList && ($ActiveUserRights >= $Prop.RequiredRights || ($Prop.RequiredRights == -1 && $ActiveUser.name != "Guest"))}
		  {* process URL *}
		  {if $Prop.Url == "Info"}
				{assign var="Url" value="$DownloadLink"}
			{elseif $Prop.Url != ""}
				{assign var="Url" value=$Prop.Url|replace:"\$ID":$MovieID|replace:"\$Active":$Active}
        {assign var="Url" value="<a href='$Url'>"}
			{/if}
			<td{if $Prop.ListProperties} {$Prop.ListProperties}{/if}>
			{if $Prop.PropType == 13}
			  {$Url}
				<normalfont>{$MovieNrs.$kMovie}</normalfont>
			  {if $Url}</a>{/if}
			{else}			  
			  {$Url}
				<normalfont>{GetMovieProp MovieID=$MovieID PropID=$Prop.ID}</normalfont>
			  {if $Url}</a>{/if}
			{/if}
      </td>
		{/if}
	{/foreach}
	{if $ActiveUserRights >= 4}
		<td nowrap>
			<a href="{$pmldir}/editentry.php{$CFG.GlobalArg}action=delete&ID={$MovieID}" onclick="return confirm('{$lang.strDeleteEntrySure}')">
			<img src='{$pmldir}/image/edit/del.png' width='13' height='13' border='0' alt='delete'></a>
			<a href="{$pmldir}/editentry.php{$CFG.GlobalArg}action=edit&ID={$MovieID}">
			<img src='{$pmldir}/image/edit/edit.png' width='15' height='13' border='0' alt='edit'></a>
		</td>
	{/if}
	</tr>
{/foreach}
</table>
<table align="center">
 <tr>
  <td><smallfont>$pagelink</font></td>
 </tr>
</table>
$footer
</body>
</html>
Return current item: PowerMovieList