"160", "dimthm" => "64", "dimimg" => "640", "linii" => "3", "coloane" => "3", "spatiere" => "3", "pagalbume" => "10", "lightbox" => _e('no','altpwa')."", "sprepicasa" => _e('no','altpwa').""); add_option("altpwa", $options); } $options = get_option('altpwa'); $baseurl = "http://picasaweb.google.com/data/feed/api/user/"; $baseurl2 = "http://picasaweb.google.com/data/feed/base/user/"; $pagalbume = $options["pagalbume"]; //paginare albume (cate albume pe o pagina); $dimthm = $options["dimthm"]; //32,48,64,160 sunt patrate, cu crop; 144,200,288,400,512 sunt fara crop ============ $dimth = $options["dimth"]; //32,48,64,160 sunt patrate, cu crop; 144,200,288,400,512 sunt fara crop ============ $dimimg = $options["dimimg"]; //576,640,720,800 =================== $linii = $options["linii"]; $coloane = $options["coloane"]; $pagpoze = $linii * $coloane; $spatiere = $options["spatiere"]; $lightbox = $options["lightbox"]; $sprepicasa = $options["sprepicasa"]; define('CALEIMG', get_option('siteurl').'/wp-content/plugins/altpwa/images/'); $uri = $_SERVER['REQUEST_URI']; $uri = str_replace("?","",$uri); $precale = get_option('siteurl').$uri."?"; add_action('wp_head', 'alt_pwa_header'); add_action('admin_menu', 'alt_pwa_meniu'); add_shortcode('altpwa', 'alt_pwa_func'); load_plugin_textdomain( 'altpwa', '/wp-content/plugins/altpwa' ); function alt_pwa_meniu() { add_options_page(__('Options','altpwa').' altPWA', 'altPWA', 8, basename(__FILE__), 'alt_pwa_admin'); } function alt_pwa_admin(){ $dimth_a = array(32,48,64,144,160,200,288,400,512); $dimthm_a = array(32,48,64,144,160); $dimimg_a = array(576,640,720,800); $lightbox_a = array(__('yes','altpwa')."",__('no','altpwa').""); $sprepicasa_a = array(__('yes','altpwa')."",__('no','altpwa').""); $options = get_option('altpwa'); if ( !is_array($options) ) { $defaults = array('dimth' => 160, 'dimthm' => 64, 'dimimg' => 640, 'linii' => 3, 'coloane' => 3, 'spatiere' => 3, 'pagalbume' => 10, 'lightbox' => _e('no','altpwa')."", 'sprepicasa' => _e('no','altpwa').""); $options = array_merge($defaults); } if (isset($_POST['update_altpwa'])) { $options['dimth'] = $_POST['dimth']; $options['dimthm'] = $_POST['dimthm']; $options['dimimg'] = $_POST['dimimg']; $options['linii'] = strip_tags(stripslashes($_POST['linii'])); $options['coloane'] = strip_tags(stripslashes($_POST['coloane'])); $options['spatiere'] = strip_tags(stripslashes($_POST['spatiere'])); $options['pagalbume'] = strip_tags(stripslashes($_POST['pagalbume'])); $options['lightbox'] = $_POST['lightbox']; $options['sprepicasa'] = $_POST['sprepicasa']; update_option('altpwa', $options); echo "
".__("Done with updating","altpwa")."...
Albumele pot fi vazute doar online.
"; return $html; } if(isset($_REQUEST["album"])){ $album = $_REQUEST["album"]; $html = pwa_album(); return $html; } $html = ""; if(isset($_REQUEST["pagina"])) $pagina=$_REQUEST["pagina"]-0; else $pagina=1; $url = "http://picasaweb.google.com/data/feed/api/user/$user?alt=json&thumbsize=144"; $continut = file_get_contents($url); $feed = json_decode($continut,true); $dim = count($feed["feed"]["entry"]); $url = "http://picasaweb.google.com/data/feed/api/user/$user?alt=json&start-index=".(($pagina-1)*$pagalbume+1)."&max-results=".$pagalbume."&thumbsize=160"; $continut = file_get_contents($url); $feed = json_decode($continut,true); $pagini = ceil($dim / $pagalbume); $precale = str_replace("??","?",str_replace("&pagina=".$pagina,"",$precale)); if($pagini>1){ $html .= "";
if($pagina>1)
$html .= "";
else
$html .= "
";
$html .= " ";
if($dim>$pagina*$pagalbume)
$html .= "
";
else
$html .= "
";
$html .= "
".__('Pages','altpwa').": ";
for($i=1;$i <= $pagini; $i++)
if($i==$pagina)
$html .= "".$i." ";
else
$html .= "".$i." ";
$html .= "
Albumul poate fi vazut doar online.
"; return $html; } $path_album = $feed["feed"]["link"][1]["href"]; $dim = $feed["feed"]["gphoto\$numphotos"]["\$t"]-0; $cate = count($feed["feed"]["entry"]); $pagini = ceil($dim / $pagpoze); if($pagini>1){ $html .= "";
if($pagina>1)
$html .= "";
else
$html .= "
";
$html .= "
";
if($dim>$pagina*$pagpoze)
$html .= "
";
else
$html .= "
";
$html .= "
".__('Pages','altpwa').": ";
for($i=1;$i <= $pagini; $i++)
if($i==$pagina)
$html .= "".$i." ";
else
$html .= "".$i." ";
$html .= "
";
if($lightbox==1)
$html .= "";
else
//$html .= "";
$html .= "";
$html .= " | ";
if($i%$coloane == ($coloane-1)){
$html .= "
".__("Note","altpwa").": ".__("To see the pictures in the original Picasa album, click","altpwa")." ".__("here","altpwa").""; //$html .= "
Notă: Pentru a vedea fotografiile cu o viteză mai bună şi la o dimensiune mai mare mergeţi aici."; return $html; } function pwa_foto($album,$foto){ global $baseurl,$baseurl2,$user,$pagpoze,$user,$album,$dimth,$dimthm,$dimimg,$spatiere,$coloane,$linii,$lightbox,$precale,$month; $html = ""; $precale = str_replace("&album=".$album,"",str_replace("&foto=".$foto,"",$precale)); $url = "http://picasaweb.google.com/data/feed/api/user/$user/album/$album?alt=json&thumbsize=144"; //echo $url; $continut = file_get_contents($url); $feed = json_decode($continut,true); $html .= "
".$feed["feed"]["title"]["\$t"]." (".$feed["feed"]["gphoto\$numphotos"]["\$t"]." ".__('photos','altpwa').")
";
$cand = $feed["feed"]["updated"]["\$t"];
$html .= date('j', $feed["feed"]["gphoto\$timestamp"]["\$t"]/1000)." ".$month["".date('m', $feed["feed"]["gphoto\$timestamp"]["\$t"]/1000)]." ".date('Y', $feed["feed"]["gphoto\$timestamp"]["\$t"]/1000);
//$html .= date(get_option('date_format'),strtotime($cand));
if($feed["feed"]["gphoto\$location"]["\$t"] != "")
$html .= ", ".$feed["feed"]["gphoto\$location"]["\$t"];
$html .= "
".$feed["feed"]["subtitle"]["\$t"]."
".$feed["feed"]["entry"][$idcrt]["summary"]["\$t"]."
"; $html .= "";
if($sprepicasa==1)
$html .= "
".__("original image","altpwa")." (".$feed["feed"]["entry"][$idcrt]["gphoto\$width"]["\$t"]." x ".$feed["feed"]["entry"][$idcrt]["gphoto\$height"]["\$t"].")";
$html .= "
| "; $crt = $idcrt; while(3-$crt>0){ $html .= " | "; $crt = $idcrt + 1; $html .= " | "; for($i=0;($i<3) && ($crt |