> 0x10),0xFF & ($int >> 0x8),0xFF & $int); } function rgbhex($rgb){ return str_pad ( dechex($rgb[0]),'0', STR_PAD_LEFT) . str_pad ( dechex($rgb[1]),'1', STR_PAD_LEFT). str_pad ( dechex($rgb[2]),'0', STR_PAD_LEFT); } function color_light($hexcolor,$factor){ $rgb=hexrgb($hexcolor); $rgb[0]=$rgb[0]*$factor; if($rgb[0]>255){$rgb[0]=255;} $rgb[1]=$rgb[1]*$factor; if($rgb[1]>255){$rgb[1]=255;} $rgb[2]=$rgb[2]*$factor; if($rgb[2]>255){$rgb[2]=255;} return rgbhex($rgb); } function theme_initialize(){ global $theme_params,$theme_colors; if(!isset($theme_params[0])){ $theme_params[0]="default"; } if($theme_params[0]=="default"){ $theme_colors[1]="464646"; $theme_colors[2]="DDCC88"; $theme_colors[3]="CCCCCC"; $theme_colors[4]="FFFFFF"; $theme_colors[6]="DDCC88"; }else if ($theme_params[0]=="winter"){ $theme_colors[1]="cceeff"; $theme_colors[2]="0011aa"; $theme_colors[3]="222222"; $theme_colors[4]="FFFFFF"; $theme_colors[6]="0011aa"; }else if ($theme_params[0]=="custom"){ if(!isset($theme_params[1])){ $theme_colors[1]="464646"; $theme_colors[2]="DDCC88"; $theme_colors[3]="CCCCCC"; $theme_colors[4]="FFFFFF"; $theme_colors[6]="DDCC88"; }else{ $theme_colors[1]=$theme_params[1]; $theme_colors[2]=$theme_params[2]; $theme_colors[3]=$theme_params[3]; $theme_colors[4]=$theme_params[4]; $theme_colors[6]=$theme_params[8]; } } if(!isset($theme_params[1])){ $theme_params[1]=$theme_colors[1]; $theme_params[2]=$theme_colors[2]; $theme_params[3]=$theme_colors[3]; $theme_params[4]=$theme_colors[4]; $theme_params[8]=$theme_colors[6]; } if(!isset($theme_params[5])){ $theme_params[5]="EDDC98"; } $theme_colors[5]=$theme_params[5]; if(!isset($theme_params[6])){ $theme_params[6]="phpAlbum.net"; } if(!isset($theme_params[7])){ $theme_params[7]="graphical"; } if(!isset($theme_params[8])){ $theme_params[8]="666666"; } } function theme_get_style_css(){ global $themes_dir,$theme_params,$theme_colors,$site_theme; header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time) ); header('Content-type: text/css'); header('Cache-control: no-cache'); $bgcolor=$theme_colors[1]; $linkcolor=$theme_colors[2]; $desccolor=$theme_colors[3]; $bordercolor=$theme_colors[4]; $logocolor=$theme_colors[5]; $photodesc=$theme_colors[6]; $linkcolor2=color_light($linkcolor,0.8); $bgcolor2=color_light($bgcolor,1.2); $bgcolor3=color_light($bgcolor,1.44); if(file_exists("themes/poumeyrau/default.css")){ $file=file("themes/poumeyrau/default.css" ); }else{ $file=file($themes_dir."engines/phptemplate/default.css" ); } foreach ($file as $num=>$line){ $text=str_replace("","#".$bgcolor,$line); $text=str_replace("","#".$bgcolor2,$text); $text=str_replace("","#".$bgcolor3,$text); $text=str_replace("","#".$linkcolor,$text); $text=str_replace("","#".$linkcolor2,$text); $text=str_replace("","#".$desccolor,$text); $text=str_replace("","#".$bordercolor,$text); $text=str_replace("","#".$logocolor,$text); $text=str_replace("","#".$photodesc,$text); echo $text; } } function theme_get_logo(){ global $theme_params,$logo_path,$logo_enabled; if($theme_params[7]=="text" && $logo_enabled=="false"){ return "".$theme_params[6].""; }else if($theme_params[7]=="graphical" || $logo_enabled=="true"){ return ""; } } function theme_get_styles(){ $styles[]="default"; $styles[]="winter"; $styles[]="custom"; return $styles; } function theme_get_logo_styles(){ $styles[]="text"; $styles[]="graphical"; $styles[]="none"; return $styles; } function theme_get_id(){ global $theme_colors; return theme_get_theme_name().$theme_colors[1]; } function theme_get_bgcolor(){ global $theme_colors; return hexrgb($theme_colors[1]); } function theme_generate_logo(){ global $theme_params,$logo_enabled,$logo_path; send_header('Content-type: image/png'); // Resample // if(strtoupper(substr($var1,-3,3))=="JPG") // $image = imagecreatefromjpeg($album_dir.$var1); // if(strtoupper(substr($var1,-3,3))=="PNG") // $image = imagecreatefrompng($album_dir.$var1); if(!file_exists($logo_path) || $logo_enabled=="false"){ $font="Arial_Black.ttf"; $font_size=40; $size=imagettfbbox($font_size,0,$font,$theme_params[6]); $width=$size[2]-$size[0]+15; $height=$size[1]-$size[7]+10; $posx=-$size[0]; $posy=$size[1]; // var_dump($size); $image_p = imagecreatetruecolor($width, $height); $bg=theme_get_bgcolor(); $color = ImageColorAllocate( $image_p,$bg[0] ,$bg[1] ,$bg[2]); $col1=hexrgb($theme_params[5]); $col2=hexrgb(color_light($theme_params[5],0.5)); $col3=hexrgb(color_light($theme_params[5],2)); $textcolor_lo = imagecolorallocate($image_p, $col2[0], $col2[1], $col2[2]); $textcolor = imagecolorallocate($image_p, $col1[0], $col1[1], $col1[2]); $textcolor_hi = imagecolorallocate($image_p, $col3[0], $col3[1], $col3[2]); // $sh_color = imagecolorallocate($image_p, 0, 0, 0); $sh_color1 = imagecolorallocatealpha($image_p, 0, 0, 0,80); $sh_color2 = imagecolorallocatealpha($image_p, 0, 0, 0,100); $sh_color3 = imagecolorallocatealpha($image_p, 0, 0, 0,120); imagefill($image_p,0,0,$color); imagettftext( $image_p,$font_size,0,$posx+11,$height-($posy+4),$sh_color1,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+11+1,$height-($posy+4)+1,$sh_color1,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+11+2,$height-($posy+4)+2,$sh_color2,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+11+3,$height-($posy+4)+3,$sh_color3,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+11+4,$height-($posy+4)+3,$sh_color3,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+5-1,$height-($posy+10)-1,$textcolor_hi,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+5-2,$height-($posy+10),$textcolor_hi,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+5+1,$height-($posy+10)+1,$textcolor_lo,$font,$theme_params[6]); imagettftext( $image_p,$font_size,0,$posx+5,$height-($posy+10),$textcolor,$font,$theme_params[6]); //imagestring($image_p,26,20,20,$site_name,$sh_color); //imagefilter($image_p,IMG_FILTER_GAUSSIAN_BLUR); //imagestring($image_p,26,10,10,$site_name,$textcolor); //imagecopyresampled($image_p, $image, ($thumb_size-$width)/2+5, ($thumb_size-$height)/2+5, 0, 0, $width, $height, $width_orig, $height_orig); // imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagepng($image_p); }else{ $bg=theme_get_bgcolor(); list($width, $height) = getimagesize($logo_path); $image = imagecreatetruecolor($width, $height); $color = ImageColorAllocate( $image,$bg[0] ,$bg[1] ,$bg[2]); imagefill($image,0,0,$color); $image_l = imagecreatefrom($logo_path); imagecopyresampled($image, $image_l, 0, 0, 0, 0, $width, $height, $width, $height); imagepng($image); } } function theme_generate_dir_logo($path,$type){ global $themes_dir,$site_theme; $bg=theme_get_bgcolor(); send_header('Content-type: image/png'); if($type=="DIR"){ $logo="dir.png"; } if($type=="DIR_NEW"){ $logo="dir_new.png"; } if($type=="DIR_PASSWD"){ $logo="dir_passwd.png"; } list($width, $height) = getimagesize("themes/poumeyrau/".$logo); $image = imagecreatetruecolor($width, $height); $color = ImageColorAllocate( $image,$bg[0] ,$bg[1] ,$bg[2]); imagefill($image,0,0,$color); $image_l = imagecreatefrom("themes/poumeyrau/".$logo); imagecopyresampled($image, $image_l, 0, 0, 0, 0, $width, $height, $width, $height); imagepng($image); } function theme_generate_directories($dirs,$inline_style){ global $themes_dir,$site_theme; ob_start(); if(is_array($dirs)){ foreach($dirs as $dir){ $dir_link=$dir['link']; $dir_logo_path=$dir['logo']; $dir_short_desc=$dir['desc']; $dir_name=$dir['name']; include "themes/poumeyrau/dir.tpl.php"; } } $contents = ob_get_contents(); ob_end_clean(); return $contents; } function theme_generate_thumbnails($thmbs,$inline_style){ global $themes_dir,$site_theme; global $directory_style,$maximum_photos_per_page,$raster_dir_x,$raster_dir_y; if($directory_style=="flowing"){ ob_start(); if(is_array($thmbs)){ foreach($thmbs as $thmb){ $image_view_link=$thmb['link']; $image_short_desc=$thmb['desc']; $thmb_link=$thmb['thmb']; $width=$thmb['width']; $height=$thmb['height']; include "themes/poumeyrau/thmb.tpl.php"; } } $contents = ob_get_contents(); ob_end_clean(); }else{ if(is_array($thmbs)){ $cnt=0; foreach($thmbs as $thmb){ $image_view_link=$thmb['link']; $image_short_desc=$thmb['desc']; $thmb_link=$thmb['thmb']; $width=$thmb['width']; $height=$thmb['height']; ob_start(); include "themes/poumeyrau/thmb.tpl.php"; $th_row[]=ob_get_contents(); ob_end_clean(); $cnt++; if($cnt==$raster_dir_x){ $thumbnails[]=$th_row; $th_row=Array(); $cnt=0; } } } if ($cnt!=0){ $thumbnails[]=$th_row; } if(is_array($thumbnails)){ ob_start(); include "themes/poumeyrau/raster.tpl.php"; $contents = ob_get_contents(); ob_end_clean(); } } return $contents; } function theme_generate_album_page($dir_path,$quality_links,$dirs,$thmbs,$inline_style,$dir_long_desc,$next_start_with,$previous_start_with,$var1,$quality){ global $site_name,$return_home_url,$site_theme,$themes_dir,$phpalbum_version; global $logo_path,$logo_enabled,$theme_params,$phpalbum_version,$character_set,$album_name; global $next_page_text,$previous_page_text,$setup_text; send_header("Content-type: text/html; charset=$character_set"); $stylesheet_link="images.php?cmd=theme&var1=style_css"; $home_name="Home"; $directories=theme_generate_directories($dirs,$inline_style); $thumbnails=theme_generate_thumbnails($thmbs,$inline_style); $logo=theme_get_logo(); if($previous_start_with>=0){ $previous_page_link="images.php?cmd=album&var1=".urlencode($var1)."&var2=".$quality."&var3=".$previous_start_with; }else{ $previous_page_link=""; } if($next_start_with>=0){ $next_page_link="images.php?cmd=album&var1=".urlencode($var1)."&var2=".$quality."&var3=".$next_start_with; }else{ $next_page_link=""; } $footer_message="Powered by PHP Photo Album"; include("themes/poumeyrau/album.tpl.php"); // include("themes/cogebois/album.tpl.php/album.tpl.php"); } function theme_generate_comments($messages,$var3,$imageview_link){ global $themes_dir,$site_theme,$comment_name,$comment_email; if($var3=="post_comment"){ $adding_comment=true; $post_comment_link=$imageview_link."&var3=save_comment"; }else{ $adding_comment=false; $post_comment_link=$imageview_link."&var3=post_comment"; } if(is_setup_user()){ $delete_comment_link=$imageview_link."&var3=delete_comment-"; } $instruction_text="Please type your message click Add New Comment "; $instruction2_text="Optional you can enter your name and email"; $email_text="E-Mail:"; $name_text="Name:"; $post_comment_text="Add New Comment"; ob_start(); include "themes/poumeyrau/comments.tpl.php"; $contents = ob_get_contents(); ob_end_clean(); return $contents; } function theme_generate_imageview_page($dir_path,$quality_links,$short_desc,$long_desc,$next_link,$prev_link,$image,$imageview_link,$width,$height,$var3,$messages){ global $site_name,$return_home_url,$site_theme,$themes_dir,$album_name,$phpalbum_version; global $logo_path,$logo_enabled,$theme_params,$phpalbum_version,$character_set; global $next_text,$previous_text,$disable_bottom_nextprev; global $comments_enabled,$comment_name,$comment_email; send_header("Content-type: text/html; charset=$character_set"); $stylesheet_link="images.php?cmd=theme&var1=style_css"; $home_name="Home"; $logo=theme_get_logo(); $total_width=$width+40; $total_height=$height+40; $footer_message="Powered by PHP Photo Album"; //comments if($comments_enabled){ $comments=theme_generate_comments($messages,$var3,$imageview_link); }else{ unset($comments); } include("themes/poumeyrau/imageview.tpl.php"); } function theme_generate_setup_page($content){ global $site_name,$themes_dir,$site_theme,$character_set,$phpalbum_version; send_header("Content-type: text/html; charset=$character_set"); $footer_message="Powered by PHP Photo Album"; $stylesheet_link="images.php?cmd=theme&var1=style_css"; $logo=theme_get_logo(); if(file_exists("themes/poumeyrau/setup.tpl.php")){ include("themes/poumeyrau/setup.tpl.php"); }else{ include($themes_dir."engines/phptemplate/setup.tpl.php"); } } ?> "suivant", "ID_PREV" => "précédent", "ID_NEXT_PAGE" => "Suivant  >>", "ID_PREV_PAGE" => "<<  Précédent", "ID_ALBUM_NAME" => "Galerie Poumeyrau", "ID_PHOTO_DIR" => "Photos", "ID_SETUP" => "setup", "ID_HOME" => "Home", "ID_NAME" => "Name", "ID_EMAIL" => "Email", "ID_NAME_EMAIL" => "Optional you can enter your name and email", "ID_COMMENT_INSTR" => "Please type your message click Add New Comment", "ID_ADD_COMMENT" => "Add new comment", "ID_ENTER_PASSWD" => "Entrez le mot de passe :", "ID_DELETE_COMMENT" => "Delete Comment", "ID_ALBUMS" => "Albums" ); if(file_exists($data_dir."translation.dat")){ include($data_dir."translation.dat"); } function p($id){ global $actual_language; /* function prints text for ide $id and actual language, if not found then EN*/ print pa_get_text($id); } function t($id){ return pa_get_text($id); } function pa_get_text($id){ global $pa_texts,$pa_translated_texts; if(isset($pa_translated_texts[$id])){ return $pa_translated_texts[$id]; }else{ if(isset($pa_texts[$id])){ return $pa_texts[$id]; }else{ return "##N/A:$id##"; } } } ?>