Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function include_ladders()
- {
- global $nen;
- $ret = '';
- $me_name = 'Ladders';
- $me = strtolower( str_replace( ' ', '', $me_name ) );
- $ext_array = array( '' );
- $ext_pcre = str_replace( '.', '\.', implode( '|', $ext_array ) );
- $toc = fasttoc( $nen[ 'vault' ], $ext_array );
- if( count( $toc ) === 0 )
- {
- $nen['swap.ct'][$me] = count( $toc );
- $ret = '';
- return $ret;
- }
- $sections = array
- (
- 3 => 'About',
- 4 => 'Thumbs',
- 5 => 'Vods',
- 6 => 'Most Recent',
- 7 => 'Submissions'
- );
- $sections_old = array
- (
- 3 => 'articles',
- 4 => 'thumbs',
- 5 => 'vods',
- 6 => 'mostrecent',
- 7 => 'builds'
- );
- $ext = array
- (
- 3 => array( '.txt' ),
- 4 => array( '.png', '.gif', '.jpeg', 'jpg', '.apng' ),
- 5 => array( '.mp4', '.mpeg', '.mpg' ),
- 6 => array( ),
- 7 => array( '.7z', '.zip' )
- );
- $div = 2;
- $count = 0;
- $index = 0;
- while(true)
- {
- if( $index > count( $toc ) - 1 )
- {
- break;
- }
- $entry = $toc[ $index ];
- if ( preg_match('/(.*)/', $entry, $matches ) )
- {
- $id = $matches[ 1 ];
- if( $index === 0 )
- {
- $col = 0;
- $row = 0;
- }
- else
- {
- $col = ( ( $index ) % $div ) + 0;
- $row = ( floor( $index / $div ) );
- }
- $position = 'position: absolute;';
- $width = 'width: ' . ( 25 ) . 'vw;';
- $height = 'height: ' . ( 35 ) . 'vh;';
- $left ='left: ' . ( $col * floor ( 75 / $div ) + 25 ) . 'vw;';
- $top = 'top: ' . ( $row * 35 ) . 'vh;';
- $right = 'right: ' . 'auto;';
- $bottom = 'bottom: ' . 'auto;';
- $cfg = array
- (
- 1 => 'prj',
- 2 => $id,
- 8 => substr($id, 0 , 1)
- );
- $out = array();
- foreach( $sections as $key => $value )
- {
- $s = strtolower( str_replace( ' ', '', $value ) );
- $s2 = strtolower( str_replace( ' ', '', $sections_old[ $key ] ) );
- $out[ $key ] = '<a href="?prj=' . urlencode( $id ) . '§=' . urlencode( $s ) . '">';
- if( count( $ext[ $key ] ) !== 0 )
- {
- $out[ $key ] .= count( fasttoc( $nen[ 'vault' ] . $id . '/' . $s2, $ext[ $key ] ) );
- $out[ $key ] .= ' ' . $value;
- }
- else
- {
- $out[ $key ] .= $value;
- }
- $out[ $key ] .= '</a>';
- }
- $thumbtoc = ( is_dir( $nen[ 'root' ] . $nen[ 'vault' ] . $id . '/thumbs' ) ? fasttoc( $nen[ 'vault' ] . $id . '/thumbs', array( '.png', '.gif', '.jpg', '.jpeg', '.apng' ) ) : array() );
- $thumb = ( count( $thumbtoc ) === 0 ? 'http://puzzlum.org/repo/site%20data/art/placeholder.png' : 'http://puzzlum.org/repo/' . $nen[ 'vault' ] . $id . '/thumbs/' . $thumbtoc[ rand( 1, count( $thumbtoc ) ) - 1 ] );
- $thumb = str_replace( ' ', '%20', $thumb );
- $ret .=
- '<div class=\'wrapper\'>
- <figure>
- <div class=\'label\' style=\'background-image:url(' . $thumb . ');\'>
- <a href=\'?prj=' . urlencode( $id ) . '§=' . urlencode( $s ) . '\'>
- <img src=\'http://puzzlum.org/repo/site%20data/art/floppy-overlay.png\' alt=\'' . $id . '\' />
- </a>
- </div>
- <figcaption>' .
- ( count( $out ) > 0 ? '<ul><li><a href="?prj=' . urlencode( $id ) . '§=' . urlencode( $s ) . '">' . $id . '</a></li><li>' : '' ) . implode( '</li><li>', $out ) . ( count( $out ) > 0 ? '</li></ul>' : '' ) .
- '</figcaption>
- </figure>
- </div><p><img src=\'http://puzzlum.org/repo/site%20data/art/separators/Green%20Oil%20Scuff.png\' alt=\'Green Oil Pipe Separator\'/></p>';
- $count++;
- }
- $index++;
- }
- $nen['swap.ct'][$me] = count( $toc );
- if( $nen[ 'sect' ] !== $me )
- {
- return '';
- }
- else
- {
- return $ret;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement