Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C-compliant code #270

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 30 additions & 34 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
<?php
/**
* This file contains the website configuration.
*
* PHP versions 4 and 5
*
* LICENSE:
*
* This file is part of PhotoShow.
*
* PhotoShow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhotoShow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhotoShow. If not, see <http://www.gnu.org/licenses/>.
*
* @category Website
* @package Photoshow
* @author Thibaud Rohmer <[email protected]>
* @copyright 2011 Thibaud Rohmer
* @license http://www.gnu.org/licenses/
* @link http://github.com/thibaud-rohmer/PhotoShow
*/

* This file contains the website configuration.
*
* PHP versions 4 and 5
*
* LICENSE:
*
* This file is part of PhotoShow.
*
* PhotoShow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhotoShow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhotoShow. If not, see <http://www.gnu.org/licenses/>.
*
* @category Website
* @package Photoshow
* @author Thibaud Rohmer <[email protected]>
* @copyright 2011 Thibaud Rohmer
* @license http://www.gnu.org/licenses/
* @link http://github.com/thibaud-rohmer/PhotoShow
*/
// Folder where your pictures are stored.
// Must be at least readable by web server process
$config->photos_dir = "path_to_your_photos_dir_goes_here";

$config->photos_dir = "path_to_your_photos_dir_goes_here";
// Folder where PhotoShow parameters and thumbnails are stored.
// Must be writable by web server process
$config->ps_generated = "path_where_photoshow_generates_files_goes_here";

$config->ps_generated = "path_where_photoshow_generates_files_goes_here";
// Local timezone. Default one is "Europe/Paris".
#$config->timezone = "Europe/Paris";

?>
4 changes: 2 additions & 2 deletions src/classes/Board.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function __construct($path=NULL){
}
if (Judge::is_public($file))
{
$this->page_header .= "<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&f=".urlencode(File::a2r($file))."\"/>\n";
$this->page_header .= "<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&amp;f=".urlencode(File::a2r($file))."\"/>\n";
$i++;
}
}
Expand All @@ -128,7 +128,7 @@ public function __construct($path=NULL){
$img = Judge::searchDir($d, true);
if ($img)
{
$this->page_header .= "<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&f=".urlencode(File::a2r($img))."\"/>\n";
$this->page_header .= "<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&amp;f=".urlencode(File::a2r($img))."\"/>\n";
$i++;
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/classes/BoardDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public function __construct($dir,$img){
if($img == NULL){
$this->img='inc/folder.png';
}else{
$this->img = "?t=Thb&f=".urlencode(File::a2r($img));

$this->img = "?t=Thb&amp;f=".urlencode(File::a2r($img));
}
}

Expand All @@ -84,7 +83,7 @@ public function toHTML(){
echo "<div class=' pure-u-1-3 pure-u-sm-1-3 pure-u-lg-1-4 pure-u-xl-1-8'>";
echo "<div class='directory'>";
echo "<a href=\"?f=$this->url\">";
echo "<img src=\"$this->img\"/ >";
echo "<img src=\"$this->img\" alt='' />";
echo "<div class='dirname'>";
(array)$name = explode('/', $this->path);
echo htmlentities(end($name), ENT_QUOTES ,'UTF-8');
Expand Down
6 changes: 3 additions & 3 deletions src/classes/BoardItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public function __construct($file,$ratio=0){
*/
public function toHTML(){

$getfile = "t=Thb&f=$this->file";
$getfile = "t=Thb&amp;f=$this->file";

echo "<div class='item $lgcls pure-u-1-2 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-8'>";
echo "<a href='?f=$this->file'>";
echo "<img src='?$getfile'>";
echo "<img src='?$getfile' alt='' />";
echo "</a>\n";
echo "</div>\n";

Expand All @@ -102,4 +102,4 @@ public function set_width($line_ratio){
}
}

?>
?>
6 changes: 3 additions & 3 deletions src/classes/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ public function toHTML(){
echo "</div>";

if(isset(CurrentUser::$account)){
echo "<form action='?t=Com&f=".$this->webfile."' class='pure-form pure-form-stacked' id='comments_form' method='post'><fieldset class='transparent'>\n";
echo "<input type='hidden' name='login' id='login' value='".htmlentities(CurrentUser::$account->login, ENT_QUOTES ,'UTF-8')."' readonly>";
echo "<form action='?t=Com&amp;f=".$this->webfile."' class='pure-form pure-form-stacked' id='comments_form' method='post'><fieldset class='transparent'>\n";
echo "<input type='hidden' name='login' id='login' value='".htmlentities(CurrentUser::$account->login, ENT_QUOTES ,'UTF-8')."' />";
echo "<textarea name='content' id='content' placeholder='Comment'></textarea>\n";
echo "<input type='submit' class='pure-button pure-button-primary' value='".Settings::_("comments","submit")."'></fieldset>\n";
echo "</form>\n";
Expand All @@ -241,4 +241,4 @@ public function toHTML(){
}
}

?>
?>
10 changes: 5 additions & 5 deletions src/classes/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public function __construct($file=NULL,$forcebig = false){
public function toHTML(){
echo "<div id='image_big' ";
echo "style='";
echo " background: black url(\"?t=".$this->t."&f=$this->fileweb\") no-repeat center center;";
echo " background-size: contain;";
echo " background: black url(\"?t=".$this->t."&amp;f=$this->fileweb\") no-repeat center center;";
echo " -moz-background-size: contain;";
echo " background-size: contain;";
echo " height:100%;";
echo "';>";
echo "'>";

echo "<input type='hidden' id='imageurl' value='?t=Big&f=$this->fileweb'>";
echo "<input type='hidden' id='imageurl' value='?t=Big&amp;f=$this->fileweb'>";
echo "<a href='?f=$this->dir'>";
echo "<img src='inc/img.png' height='100%' width='100%' style='opacity:0;'>";
echo "<img src='inc/img.png' height='100%' width='100%' style='opacity:0;' alt='' >";
echo "</a>";
echo "</div>";
}
Expand Down
12 changes: 6 additions & 6 deletions src/classes/ImageBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public function __construct($fs=false){

$this->photosphere = (basename(dirname(CurrentUser::$path)) == "PhotoSpheres");

$this->buttons['prev'] = "?p=p&f=".$file;
$this->buttons['prev'] = "?p=p&amp;f=".$file;
$this->awesome['prev'] = "<i class='fa fa-chevron-left fa-lg'></i>";

$this->buttons['back'] = "?f=".urlencode(File::a2r(dirname(CurrentUser::$path)));
$this->awesome['back'] = "<i class='fa fa-reply fa-lg'></i>";

if(!Settings::$nodownload){
$this->buttons['img'] = "?t=Big&f=".$file;
$this->buttons['img'] = "?t=Big&amp;f=".$file;
$this->awesome['img'] = "<i class='fa fa-eye fa-lg'></i>";

$this->buttons['get'] = "?t=BDl&f=".$file;
$this->buttons['get'] = "?t=BDl&amp;f=".$file;
$this->awesome['get'] = "<i class='fa fa-download fa-lg'></i>";
}

Expand All @@ -84,10 +84,10 @@ public function __construct($fs=false){

if($this->photosphere){
$this->buttons['pshere'] = "#' id='photosphere";
$this->awesome['pshere'] = "<img height='20px' src='inc/photosphere_logo.png'/>";
$this->awesome['pshere'] = "<img height='20' src='inc/photosphere_logo.png'/>";
}

$this->buttons['next'] = "?p=n&f=".$file;
$this->buttons['next'] = "?p=n&amp;f=".$file;
$this->awesome['next'] = "<i class='fa fa-chevron-right fa-lg'></i>";

$this->buttons['pause'] = "?f=".$file;
Expand Down Expand Up @@ -116,4 +116,4 @@ public function toHTML(){

}

?>
?>
2 changes: 1 addition & 1 deletion src/classes/ImagePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function __construct($file=NULL){
."<meta property=\"og:site_name\" content=\"".Settings::$name."\"/>\n"
."<meta property=\"og:type\" content=\"website\"/>\n"
."<meta property=\"og:title\" content=\"".Settings::$name.": ".File::a2r($file)."\"/>\n"
."<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&f=".urlencode(File::a2r($file))."\"/>\n";
."<meta property=\"og:image\" content=\"".Settings::$site_address."/?t=Thb&amp;f=".urlencode(File::a2r($file))."\"/>\n";
if (Settings::$fbappid){
$this->page_header .= "<meta property=\"fb:app_id\" content=\"".Settings::$fbappid."\"/>\n";
}
Expand Down
26 changes: 12 additions & 14 deletions src/classes/Infos.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ public function __construct(){
$this->w = File::a2r(CurrentUser::$path);

if(is_file(CurrentUser::$path)){
$this->thumb ="<img src=\"?t=Thb&f=".urlencode(File::a2r(CurrentUser::$path))."\" />";
$this->dl = "?t=BDl&f=$this->path";
$this->thumb ="<img src=\"?t=Thb&amp;f=".urlencode(File::a2r(CurrentUser::$path))."\" alt='' />";
$this->dl = "?t=BDl&amp;f=$this->path";
}else{
$this->thumb ="<img src='inc/folder.png' />";
$this->dl = "?t=Zip&f=$this->path";
$this->thumb ="<img src='inc/folder.png' alt='' />";
$this->dl = "?t=Zip&amp;f=$this->path";
}

if(CurrentUser::$admin){

$this->deleteform = "<div id='deleteform'><form class='pure-form' action='?a=Del' method='post'>
<input type='hidden' name='del' value=\"".htmlentities($this->w, ENT_QUOTES ,'UTF-8')."\">
<button class='button-round button-error' type='submit'><i class='fa fa-trash-o'></i></button>
</form>
</div>";
<input type='hidden' name='del' value=\"".htmlentities($this->w, ENT_QUOTES ,'UTF-8')."\">
<button class='button-round button-error' type='submit'><i class='fa fa-trash-o'></i></button>
</form>
</div>";
}
}

Expand All @@ -119,8 +119,10 @@ public function toHTML(){
/// Upload Images form
echo "<h3>Upload</h3>";
echo "<div id='files'></div>";
echo "<form class='dropzone' id=\"".htmlentities($this->w, ENT_QUOTES ,'UTF-8')."\"
action='?a=Upl' method='POST' enctype='multipart/form-data'>
//$form_id = (!empty($this->w)) ? "id=" . htmlentities($this->w, ENT_QUOTES ,'UTF-8') : "";
$form_id = (!empty($this->w)) ? "id='" . urlencode($this->w) . "'" : "";
echo "<form class='dropzone' " . $form_id .
" action='?a=Upl' method='POST' enctype='multipart/form-data'>
<input type='hidden' name='path' value=\"".htmlentities($this->w, ENT_QUOTES ,'UTF-8')."\">
<input type='hidden' name='inherit' value='1' />
<input type='file' name='images[]' multiple >
Expand Down Expand Up @@ -157,10 +159,6 @@ public function toHTML(){

echo "</div>";



echo "</span>\n";

echo "</div>";

}
Expand Down
6 changes: 3 additions & 3 deletions src/classes/Judge.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function set_path($f){
$basepath = File::a2r($f);

$this->filename = $basefile->name;
$this->webpath = "&f=".urlencode($basepath);
$this->webpath = "&amp;f=".urlencode($basepath);

if(is_file($f)){
$rightsfile = dirname($basepath)."/.".basename($f)."_rights.xml";
Expand Down Expand Up @@ -428,11 +428,11 @@ public function toHTML(){
echo "<h3>Access</h3>";
if($this->public){
echo "<div class='pure-g'><div class='pure-u-1-3'>";
echo "<a href='?t=Pri$this->webpath'class='button-round button-success'><i class='fa fa-unlock'></i></a></div>";
echo "<a href='?t=Pri" . $this->webpath . "' class='button-round button-success'><i class='fa fa-unlock'></i></a></div>";
echo "<div class='pure-u-2-3'>".Settings::_("judge","public")."</div></div>";
}else{
echo "<div class='pure-g'><div class='pure-u-1-3'>";
echo "<a href='?t=Pub$this->webpath'class='button-round button-error'><i class='fa fa-lock'></i></a></div>";
echo "<a href='?t=Pub" . $this->webpath . "' class='button-round button-error'><i class='fa fa-lock'></i></a></div>";
echo "<div class='pure-u-2-3'>".Settings::_("judge","priv")."</div></div>";
}

Expand Down
2 changes: 0 additions & 2 deletions src/classes/MainPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ public function toHTML(){
$this->panel->toHTML();
echo "</div>\n";


echo "</div>\n";
echo "</div>\n";

echo "<script src='inc/ui.js'></script>\n";
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ public function toHTML(){
echo "<span class='name hidden'>".htmlentities($this->title, ENT_QUOTES ,'UTF-8')."</span>";
echo "<span class='path hidden'>".htmlentities($this->path, ENT_QUOTES ,'UTF-8')."</span>";
echo "<a href='?f=$this->webdir'>".htmlentities($this->title, ENT_QUOTES ,'UTF-8')."</a>";
echo "</li>\n";

foreach($this->items as $item)
$item->toHTML();

echo "</li>\n";
echo "</ul>\n";
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/classes/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ abstract class Page implements HTMLObject
* @author Thibaud Rohmer
*/
public function header($head_content=NULL){
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>\n";
echo "<!DOCTYPE html>\n";
echo "<html>";
echo "<head>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n";
echo "<meta charset='utf-8'>\n";
echo "<meta name='viewport' content='width=device-width, initial-scale=1'>\n";
echo "<title>".Settings::$name."</title>\n";
echo "<meta name='author' content='Thibaud Rohmer'>\n";
Expand All @@ -67,12 +67,12 @@ public function header($head_content=NULL){
echo "<link rel='stylesheet' href='inc/stylesheets/pure-grid.css'>\n";
echo "<link rel='stylesheet' href='inc/stylesheets/font-awesome.min.css'>\n";

echo "<link rel='stylesheet' href='src/stylesheets/structure.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='src/stylesheets/buttons.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='src/stylesheets/theme.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='src/stylesheets/side-menu.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='src/stylesheets/structure.css' type='text/css' media='screen' />\n";
echo "<link rel='stylesheet' href='src/stylesheets/buttons.css' type='text/css' media='screen' />\n";
echo "<link rel='stylesheet' href='src/stylesheets/theme.css' type='text/css' media='screen' />\n";
echo "<link rel='stylesheet' href='src/stylesheets/side-menu.css' type='text/css' media='screen' />\n";

echo "<link rel='stylesheet' href='user/themes/".Settings::$user_theme."/style.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='user/themes/".Settings::$user_theme."/style.css' type='text/css' media='screen' />\n";

/// Trick to hide "only-script" parts
echo "<noscript><style>.noscript_hidden { display: none; }</style></noscript>";
Expand All @@ -96,7 +96,7 @@ public function header($head_content=NULL){


if(CurrentUser::$admin || CurrentUser::$uploader){
echo "<link rel='stylesheet' href='inc/fileupload-ui.css' type='text/css' media='screen' charset='utf-8'>\n";
echo "<link rel='stylesheet' href='inc/fileupload-ui.css' type='text/css' media='screen'>\n";
echo "<script src='inc/jquery.fileupload-ui.js'></script>\n";
echo "<script src='src/js/admin.js'></script>\n";
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function VideoDiv($width='100%',$height='100%',$control=false){
if ($control) {
$c = ' controls="controls"';
}
echo '<video'.$wh.$c.'><source src="?t=Vid&f='.$this->fileweb.'" type="video/webm" />';
echo '<video'.$wh.$c.'><source src="?t=Vid&amp;f='.$this->fileweb.'" type="video/webm" />';
echo 'Your browser does not support the video tag.<br />';
echo 'Please upgrade your brower or Download the codec <a href="http://tools.google.com/dlpage/webmmf">Download</a>';
echo '</video>';
Expand Down
13 changes: 5 additions & 8 deletions src/stylesheets/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ div.commentdelete {


/* Menu */
ul.selected > ul{
ul.selected > li > ul {
/*ul.selected > ul{*/
position: relative;
visibility: visible;
left: auto;
Expand All @@ -336,18 +337,14 @@ li {
padding: 0;
}

.pure-menu li a{
.pure-menu a {
font-family: 'Roboto-Bold',sans-serif;
font-size: 13px;
color: black;
}

li.currentSelected{

}

li.currentSelected a{
color: #0085be !important;
.currentSelected > a{
color: #0085be;
}


Expand Down