Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Snipfree 0-048 "gallery" module by Nick of Neinstar Filmz @ url('http://neinstarfilmz.com/');
- */
- include_once($_SERVER['DOCUMENT_ROOT'].'/snipfree/0-048/php/inc.php');
- $album='Death\'s Embrace No.1';
- $model='Alisha';
- $photoset='*.png';
- $album=$_GET['album'];
- $model=$_GET['model'];
- if(!is_dir($_SERVER['DOCUMENT_ROOT'].'/i/'.$album))
- {
- $album=false;
- $model=false;
- }
- else
- {
- if(!is_dir($_SERVER['DOCUMENT_ROOT'].'/i/'.$album.'/'.$model))
- $model=false;
- }
- echo render_page($photoset,$album,$model);
- function gallery_attributes($photoset='*.png',$album=false,$model=false)
- {
- return array(
- 'path' => '/i/'.(($album!==false)?$album.'/'.(($model!==false)?$model.'/':''):''),
- 'prefix' => 'gallery-captions -- ',
- 'id' => (($album!==false)?$album.(($model!==false)?' (Featuring '.$model.')':''):''),
- 'ext' => '.php',
- );
- }
- function count_images($photoset='*.png',$album=false,$model=false)
- {
- $attr=gallery_attributes(false,false,false);
- switch(is_dir($attr['path']))
- {
- case true:
- $attr=gallery_attributes(false,$album,false);
- switch(is_dir($attr['path']))
- {
- case true:
- $attr=gallery_attributes(false,$album,$model);
- switch(is_dir($attr['path']))
- {
- case true:
- switch(is_file($attr['path'].$attr['prefix'].$attr['id'].$attr['ext']))
- {
- case true:
- $talent=array(
- 'attr' => $attr,
- 'files' => glob($attr['path'].'/*.*')
- );
- ksort($talent['files']);
- foreach($talent['files'] as $file)
- {
- $info=pathinfo($file);
- if(!in_array($info['extension'],array('gif','png','jpg','jpeg')))
- unset($talent['files'][$file]);
- }
- $collection=array(
- 'ct' => 0
- );
- foreach($talent['files'] => $fn)
- {
- $collection[$collection['ct']++]['attr']=thumburl($fn);
- $collection[$collection['ct']]['data']=base64_encode(get_file_contents($collection[$collection['ct']]['attr']['dest']))
- $collection[$collection['ct']]['mime']='image/'.
- }
- break;
- case false:
- break;
- default:
- }
- break;
- case false:
- break;
- default:
- }
- break;
- case false:
- break;
- default:
- }
- break;
- case false:
- break;
- default:
- }
- }
- function render_page($photoset='*.png',$album=false,$model=false)
- {
- $ret='';
- snipecho($ret,'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
- snipecho($ret,'<html>');
- snipecho($ret,'<head>');
- snipecho($ret,'<title>');
- snipecho($ret,$album);
- snipecho($ret,'</title>');
- snipecho($ret,'</head>');
- snipecho($ret,'<style media="screen" type="text/css">');
- snipecho($ret,'@import "http://neinstarfilmz.com/i/style.css";');
- snipecho($ret,'</style>');
- snipecho($ret,'<script language="JavaScript" src="index.js"></script>');
- snipecho($ret,'<script src="/Glow JS 0-01/Glow JS 0-00 Parallax.js" language="JavaScript"></script>');
- snipecho($ret,'<body link="grey" alink="grey" vlink="grey" onload="JsParallax_ini();">');
- snipecho($ret,'<table border="0px" cellpadding="8px" cellspacing="4px" width="100%">');
- snipecho($ret,page_header());
- snipecho($ret,'<tr>');
- snipecho($ret,'<td>');
- snipecho($ret,gallery());
- snipecho($ret,'</td>');
- snipecho($ret,page_sidetray());
- snipecho($ret,'</tr>');
- snipecho($ret,page_footer());
- snipecho($ret,'</table>');
- snipecho($ret,'</body>');
- snipecho($ret,'</html>');
- return $ret;
- }
- function page_sidetray()
- {
- // page sidetray
- return '<td id="player"></td>';
- }
- function page_header()
- {
- $ret='';
- // page header
- snipecho($ret,'<tr>');
- snipecho($ret,'<td colspan="2">');
- snipecho($ret,'<p><font color="red" face="Courier New" size="22pt"><b>neinstar filmz</b></font></p>');
- snipecho($ret,'</td>');
- snipecho($ret,'</tr>');
- return $ret;
- }
- function page_footer()
- {
- $ret='';
- // page footer
- snipecho($ret,'<tr>');
- snipecho($ret,'<td colspan="2"><font size="+3">(<a href="../">Back</a>)</font></td>');
- snipecho($ret,'</tr>');
- return $ret;
- }
- function gallery($photoset='*.png',$album=false,$model=false)
- {
- global $domain;
- $ret='';
- snipecho($ret,'<table border="0px" cellspacing="8px" cellspacing="4px">');
- $dat=glob($_SERVER['DOCUMENT_ROOT'].'/i/'.$album.((strlen($model)>0)?'/'.$model:'').$photoset);
- ksort($dat);
- $panelct=4;
- $rowct=0;
- // Render section caption.
- $ret.=gallery_caption($panelct,-1);
- // Cycle through images one row of the given gallery at a time.
- $ct=0;
- $temp='';
- foreach($dat as $fn)
- {
- // Render set captions.
- if(($ct===0)&&($rowct===0))
- $ret.=gallery_caption($panelct,0);
- $ct++;
- $ct=($ct % $panelct);
- snipecho($temp,'<td bgcolor="black" align="center" valign="middle" class="picframe">');
- snipecho($temp,'<a href="'.thumburl($fn).'"><img src="'.thumburl($fn).'" style="max-width: 240px;"></a><br>');
- snipecho($temp,'</td>');
- // Render frame captions.
- if($ct===0)
- {
- $rowct++;
- if(strlen($temp)>0)
- $temp='<tr>'.$temp.'</tr>';
- $ret.=gallery_caption($panelct,$rowct).$temp;
- $temp='';
- }
- }
- // Ensure completopm of final row.
- if(strlen($temp)>0)
- {
- $rowct++;
- snipecho($temp,'<td colspan="'.($panelct-1-$ct).'" class="emptyframe"></td>');
- if(strlen($temp)>0)
- $temp='<tr>'.$temp.'</tr>';
- $ret.=gallery_caption($panelct,$rowct).$temp;
- $temp='';
- }
- snipecho($ret,'</table>');
- return $ret;
- }
- function pattern_timmestamp()
- {
- return array(
- 'timestamp' => '('./*?<timestamp>*/
- '(('./*?<year>*/'[0-9]{4})'.
- '(('./*?<month>*/'[0]{1}{1-9]{1}|[1]{1}[0-2]{1})'.
- '(('./*?<day>*/'[0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})'.
- '(('./*?<hour>*/'[0-1]{1}[0-9]{1}|[2]{1}[0-2]{1})'.
- '(('./*?<minute>*/'[0-5]{1}[0-9]{1})'.
- '(('./*?<second>*/'[0-5]{1}[0-9]{1})'.
- '|)|)|)|)|)|)'.
- '('./*?<timezone>*/
- '('./*?<hemisphere>*/'+|-)'.
- '('./*?<hours>*/'[0]{1}[0-9]{1}|[1]{1}[0-1]{1})'.
- '('./*?<minutes>*/'[0-5]{1}[0-9]{1})'.
- '|)'.
- ')'
- );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement