mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-17 13:38:01 +00:00
added album functions. fixes #16
This commit is contained in:
@@ -60,6 +60,7 @@ UPDATES
|
|||||||
- Nov. 06: Master delete code. One code to delete them all
|
- Nov. 06: Master delete code. One code to delete them all
|
||||||
- Nov. 01: [Restricted uploads and option-use](#restriction-settings)
|
- Nov. 01: [Restricted uploads and option-use](#restriction-settings)
|
||||||
- Oct. 30: [Rotations and filters](#smart-query-system)
|
- Oct. 30: [Rotations and filters](#smart-query-system)
|
||||||
|
- Oct. 10: [Album functionality](#smart-query-system) finally ready
|
||||||
|
|
||||||
## Why would I want to host my own images?
|
## Why would I want to host my own images?
|
||||||
If you own a server (even an home server) you can host your own PictShare instance so you have full control over your content and can delete images hasslefree.
|
If you own a server (even an home server) you can host your own PictShare instance so you have full control over your content and can delete images hasslefree.
|
||||||
@@ -99,6 +100,12 @@ If there is some option that's not recognized by PictShare it's simply ignored,
|
|||||||
**Resizing** | | |
|
**Resizing** | | |
|
||||||
<width>**x**<height> | -none- | https://pictshare.net/20x20/b260e36b60.jpg | 
|
<width>**x**<height> | -none- | https://pictshare.net/20x20/b260e36b60.jpg | 
|
||||||
forcesize | -none- | https://pictshare.net/100x400/forcesize/b260e36b60.jpg | 
|
forcesize | -none- | https://pictshare.net/100x400/forcesize/b260e36b60.jpg | 
|
||||||
|
**Albums** | | |
|
||||||
|
just add multiple image hashes | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg | Takes the **images** you put in the URL and makes an album out of them
|
||||||
|
embed | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/embed | Renders the album without CSS and with transparent background so you can embed them easily
|
||||||
|
responsive | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/responsive | Renders all images responsive (max-width 100%) according to screen size
|
||||||
|
<width>**x**<height> | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/150x150 | Sets the size for the thumbnails in the album
|
||||||
|
forcesize | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/100x300/forcesize | Forces thumbnail sizes to the values you provided
|
||||||
**GIF to mp4** | | |
|
**GIF to mp4** | | |
|
||||||
mp4 | -none- | https://www.pictshare.net/mp4/102687fe65.gif | Converts gif to mp4 and displays as that. Note that you can't include that mp4 in an img tag
|
mp4 | -none- | https://www.pictshare.net/mp4/102687fe65.gif | Converts gif to mp4 and displays as that. Note that you can't include that mp4 in an img tag
|
||||||
raw | -none- | https://www.pictshare.net/mp4/raw/102687fe65.gif | Renders the converted mp4 directly. Use with /mp4/
|
raw | -none- | https://www.pictshare.net/mp4/raw/102687fe65.gif | Renders the converted mp4 directly. Use with /mp4/
|
||||||
|
|||||||
23
inc/core.php
23
inc/core.php
@@ -106,11 +106,34 @@ function whatToDo($url)
|
|||||||
|
|
||||||
render($vars);
|
render($vars);
|
||||||
}
|
}
|
||||||
|
else if($data['album'])
|
||||||
|
renderAlbum($data);
|
||||||
else
|
else
|
||||||
renderImage($data);
|
renderImage($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderAlbum($data)
|
||||||
|
{
|
||||||
|
if($data['filter'])
|
||||||
|
$filters = implode('/',$data['filter']).'/';
|
||||||
|
|
||||||
|
if($data['size'])
|
||||||
|
$size = $data['size'].'/';
|
||||||
|
else if(!$data['responsive'])
|
||||||
|
$size = '300x300/';
|
||||||
|
|
||||||
|
$forcesize = ($data['forcesize']?'forcesize/':'');
|
||||||
|
|
||||||
|
foreach($data['album'] as $hash)
|
||||||
|
{
|
||||||
|
$content.='<a href="/'.$filters.$hash.'"><img src="/'.$size.$forcesize.$filters.$hash.'" /></a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($data['embed']===true)
|
||||||
|
include (ROOT . DS . 'template_album_embed.php');
|
||||||
|
else
|
||||||
|
include (ROOT . DS . 'template_album.php');
|
||||||
|
}
|
||||||
|
|
||||||
function renderImage($data)
|
function renderImage($data)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,11 +70,25 @@ class PictshareModel extends Model
|
|||||||
$data['changecode'] = substr($el,11);
|
$data['changecode'] = substr($el,11);
|
||||||
|
|
||||||
if($this->isImage($el))
|
if($this->isImage($el))
|
||||||
|
{
|
||||||
|
//if there are mor than one hashes in url
|
||||||
|
//make an album from them
|
||||||
|
if($data['hash'])
|
||||||
|
{
|
||||||
|
if(!$data['album'])
|
||||||
|
$data['album'][] = $data['hash'];
|
||||||
|
$data['album'][] = $el;
|
||||||
|
}
|
||||||
$data['hash']=$el;
|
$data['hash']=$el;
|
||||||
|
}
|
||||||
else if($el=='mp4' || $el=='raw' || $el=='preview' || $el=='webm' || $el=='ogg')
|
else if($el=='mp4' || $el=='raw' || $el=='preview' || $el=='webm' || $el=='ogg')
|
||||||
$data[$el] = 1;
|
$data[$el] = 1;
|
||||||
else if($this->isSize($el))
|
else if($this->isSize($el))
|
||||||
$data['size'] = $el;
|
$data['size'] = $el;
|
||||||
|
else if($el=='embed')
|
||||||
|
$data['embed'] = true;
|
||||||
|
else if($el=='responsive')
|
||||||
|
$data['responsive'] = true;
|
||||||
else if($this->isRotation($el))
|
else if($this->isRotation($el))
|
||||||
$data['rotate'] = $el;
|
$data['rotate'] = $el;
|
||||||
else if($this->isFilter($el))
|
else if($this->isFilter($el))
|
||||||
|
|||||||
44
template_album_embed.php
Normal file
44
template_album_embed.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--[if IEMobile 7 ]> <html class="no-js iem7"> <![endif]-->
|
||||||
|
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Album - <?php echo (defined('TITLE')?TITLE:'PictShare image hosting'); ?></title>
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="HandheldFriendly" content="True">
|
||||||
|
<meta name="MobileOptimized" content="320">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="cleartype" content="on">
|
||||||
|
<meta name="description" content="Free image sharing, linking and tracking">
|
||||||
|
<meta name="keywords" content="image, share, hosting, free">
|
||||||
|
<meta name="robots" content="index, follow">
|
||||||
|
<meta name="copyright" content="Haschek Solutions">
|
||||||
|
<meta name="language" content="EN,DE">
|
||||||
|
<meta name="author" content="Haschek Solutions">
|
||||||
|
<meta name="distribution" content="global">
|
||||||
|
<meta name="rating" content="general">
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
background: none transparent;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if($data['responsive']===true)
|
||||||
|
echo ' display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
padding-bottom:10px;';
|
||||||
|
else
|
||||||
|
echo 'padding:7px;';
|
||||||
|
?>
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<?php echo $content?>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
Reference in New Issue
Block a user