Advertisement
jargon

erroneous vod inclusion pt.ii

Aug 18th, 2021
1,771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. function include_vods()
  2. {
  3.     global $nen, $prj;
  4.     $ret = '';
  5.    
  6.     if( !is_dir( $nen['root'] . 'showcase/vault/' . $prj . '/vods' ) )
  7.     {
  8.         return '';
  9.     }
  10.    
  11.     $d = array_diff( scandir( $nen['root'] . 'showcase/vault/' . $prj . '/vods/' ), array('..', '.' ) );
  12.    
  13.     for( $index = 0; $index < count( $d ); $index++ )
  14.     //foreach( $d as $entry );
  15.     {
  16.         $entry = $d[ $index ];
  17.         if( strtolower( substr( $entry, -4, 4 ) ) === '.mp4' )
  18.         {
  19.             $ret .= '<span>{{vod|' . $prj . '|' . strtolower( substr( $entry, 0, -4 ) ) . '|' . strtolower( substr( $entry, 0, -4 ) ) . '}}</span>' . "\r\n";
  20.         }
  21.     }
  22.    
  23.     if ( strlen( $ret ) !== 0)
  24.     {
  25.         $ret = '<table><th><h2>Vods</h2></th><tr><td>' . $ret . '</td></tr></table>';
  26.     }
  27.     return $ret;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement