1 && !$_REQUEST['werbung']){ if($num_pics <= 7){ $wc = 1; }else if($STRECKE['index']){ $wc = round(($num_pics+1) / 10); }else{ $wc = round(($num_pics+1) / 5); } $xb = $wc * ($this_pic ? $this_pic : $num_pics); if(($xb >= $num_pics) && ($xb % $num_pics < $wc)){ $prevW = 'w'; } $xb = $wc * ($next ? $next : $num_pics); if(($xb >= $num_pics) && ($xb % $num_pics < $wc)){ $nextW = 'w'; $next = $this_pic; } } $prev = $STRECKE['foto_ids'][$prev].$prevW.'.html'; $next = $STRECKE['foto_ids'][$next].$nextW.'.html'; $REPLACE['%%LINK-NEXT%%'] = $next; $REPLACE['%%LINK-PREV%%'] = $prev; $REPLACE['%%PIC-NUM%%'] = $this_pic+1; $REPLACE['%%PIC-COUNT%%'] = $num_pics; // index? if($STRECKE['index']){ $REPLACE['%%INDEX%%'] = $TEMPLATE['INDEX_ON']; $REPLACE['%%LINK-INDEX%%'] = $STRECKE['strecke_id'].'s'.(1+floor($this_pic / $PicsPerPage)).'.html'; }else{ $REPLACE['%%INDEX%%'] = $TEMPLATE['INDEX_OFF']; } // Image $out = ''; $min_height = 400; if($_REQUEST['werbung']){ $wwidth = 300; $wheight = 250+16; $height = max($min_height, $wheight); $out .= '
'; $out .= '
'; $out .= '
'.$WERBUNG['foto']; $out .= '
'; $out .= '
'; $out .= '
'; $out .= '
'; }else if($_REQUEST['paypal'] && isset($STRECKE['buy'][$MANDANT[$_SERVER['SERVER_NAME']][1]]['paypal'])){ // never cache this page! $cache['is_running'] = false; // don't show kaufen/download links here $FOTO['can_download'] = false; // start session session_start(); // set/check session variables if(!is_array($_SESSION['WARENKORB']) || (isset($_SESSION['PARAMS']) && is_array($_SESSION['PARAMS']) && !array_alloc_equal($_SESSION['PARAMS'], $STRECKE['buy'][$MANDANT[$_SERVER['SERVER_NAME']][1]]['paypal']))){ $_SESSION['WARENKORB'] = array(); } if(!is_bool($_SESSION['OPTIN'])){ $_SESSION['OPTIN'] = false; } $_SESSION['AGB'] = false; $_SESSION['CLIENT'] = $MANDANT[$_SERVER['SERVER_NAME']][1]; $_SESSION['PARAMS'] = $STRECKE['buy'][$MANDANT[$_SERVER['SERVER_NAME']][1]]['paypal']; // add picture if(false === array_search($FOTO['foto_id'], $_SESSION['WARENKORB'])){ $_SESSION['WARENKORB'][] = $FOTO['foto_id']; $added = true; }else{ $added = false; } $out = '
'; $out .= '
'; $out .= '
'; if($added){ $out .= 'Das Bild wurde ihrem Warenkorb hinzugefügt.
'; }else{ $out .= 'Das Bild befindet sich bereits in ihrem Warenkorb.
'; } $out .= '
'; $out .= '
'; $out .= ''; /* $out .= 'Sicher online bestellen und zahlen

Wir bieten Ihnen mit PayPal ein SSL-gesichertes Zahlungsumfeld. Sie können mit einem PayPal-Konto per Lastschrift oder Kreditkarte bezahlen. Falls Sie noch kein PayPal Konto besitzen, wird bei dieser Bestellung ein Konto für Sie angelegt.

';*/ $has_karte = isset($_SESSION['PARAMS']['karte']); $has_normal = !($has_karte && (isset($_SESSION['PARAMS']['karte']['only']) && $_SESSION['PARAMS']['karte']['only'])); if($has_karte){ $out .= '
'; if($has_normal){ $out .= 'Preise mit NW-Karte
'; }else{ $out .= 'Preise
'; } if(isset($_SESSION['PARAMS']['karte']['preis'])){ $out .= 'Jedes Bild kostet '.number_format($_SESSION['PARAMS']['karte']['preis'], 2, ',', '.').' €.
'; }else if(isset($_SESSION['PARAMS']['karte']['staffelung'])){ $prices = $_SESSION['PARAMS']['karte']['staffelung']; $any = array_pop($prices); foreach($prices as $k => $v){ $out .= ($k == 0 ? 'Das' : 'das').' '.($k+1).'. Bild kostet '.number_format($v, 2, ',', '.').' €,
'; } $out .= 'jedes weitere Bild kostet '.number_format($any, 2, ',', '.').' €.
'; } if(isset($_SESSION['PARAMS']['karte']['preis']) && $_SESSION['PARAMS']['karte']['preis'] == 0){ // $out .= 'zum download
'; $out .= '
'; $out .= '
'; $out .= '
'; }else{ // $out .= 'zur kasse
'; $out .= '
'; $out .= '
'; $out .= '
'; } $out .= '
'; $out .= '
'; } if($has_normal){ if($has_karte){ $out .= 'Preise ohne NW-Karte
'; }else{ $out .= 'Preise
'; } if(isset($_SESSION['PARAMS']['preis'])){ $out .= 'Jedes Bild kostet '.number_format($_SESSION['PARAMS']['preis'], 2, ',', '.').' €.
'; }else if(isset($_SESSION['PARAMS']['staffelung'])){ $prices = $_SESSION['PARAMS']['staffelung']; $any = array_pop($prices); foreach($prices as $k => $v){ $out .= ($k == 0 ? 'Das' : 'das').' '.($k+1).'. Bild kostet '.number_format($v, 2, ',', '.').' €,
'; } $out .= 'jedes weitere Bild kostet '.number_format($any, 2, ',', '.').' €.
'; } // $out .= 'zur kasse
'; $out .= '
'; $out .= '
'; $out .= '
'; $out .= '
'; } $out .= 'Warenkorb: '.count($_SESSION['WARENKORB']).' Bild/er'; $out .= '
'; // $out .= var_export($_SESSION,1); $out .= display_timeline(4, $this_pic/($num_pics-1)); }else{ /* if($FOTO['size_screen_h'] == 0 || $FOTO['size_screen_h'] > 600){ if($FOTO['size_arc_w']/$FOTO['size_arc_h'] > 750/600){ $FOTO['size_screen_h'] = (int) round(750*$FOTO['size_arc_h']/$FOTO['size_arc_w']); $FOTO['size_screen_w'] = 750; }else{ $FOTO['size_screen_w'] = (int) round(600*$FOTO['size_arc_w']/$FOTO['size_arc_h']); $FOTO['size_screen_h'] = 600; } }*/ if($FOTO['size_screen_h'] < $min_height){ $height = $min_height; }else{ $height = $FOTO['size_screen_h']; } $out .= '
'; $out .= ''; // $out .= ''; $REPLACE['%%FOTO-URL%%'] = dirname($REPLACE['%%URL%%']).'/'.$FOTO['foto_id'].'s.jpeg'; $out .= '
'; $out .= '
'; $out .= '
'; $out .= display_timeline(4, $this_pic/($num_pics-1)); } $REPLACE['%%FOTO%%'] = $out; if(!$_REQUEST['werbung'] && !$_REQUEST['paypal']){ // copy & bildzeile $copys = array(); if(count($FOTO['copy_ids']) > 0){ $t = count($FOTO['copy_ids']) == 1 ? 0 : (count($FOTO['copy_ids']) == 2 ? 1 : 2); foreach($FOTO['copy_ids'] AS $id){ $c = @json_decode(@file_get_contents('../data/copyrights/'.substr($id, -2).'/'.$id.'.dat')); if($c){ $copys[] = $c[$t]; } } } if(count($copys) == 0){ $REPLACE['%%COPY%%'] = ''; }else{ $REPLACE['%%COPY%%'] = 'Foto: '.implode(', ', $copys); } if(!isset($STRECKE['vote']) || !$STRECKE['vote']){ // if set to false (or for compatibility, if not set at all) -> dont show box $FOTO['bildzeile'] = preg_replace('!
!', '', $FOTO['bildzeile']); } $REPLACE['%%BILDZEILE%%'] = $FOTO['bildzeile']; }else{ $REPLACE['%%COPY%%'] = ''; $REPLACE['%%BILDZEILE%%'] = ''; } $REPLACE['%%TAGS%%'] = implode(', ', $tags_out); $kaufen = array(); if($FOTO['can_buy']){ if(isset($STRECKE['buy'][$MANDANT[$_SERVER['SERVER_NAME']][1]]['bildpartner'])){ $kaufen[] = 'Printabzug bestellen '; } if(isset($STRECKE['buy'][$MANDANT[$_SERVER['SERVER_NAME']][1]]['paypal'])){ if($_REQUEST['paypal']){ $kaufen[] = 'Weitere Bilder aussuchen '; }else{ $kaufen[] = 'Download bestellen '; } } } if($FOTO['can_download']){ $kaufen[] = ''; } $REPLACE['%%KAUFEN%%'] = implode('
', $kaufen); output_page(); // debug //echo '
'.htmlspecialchars(var_export(array($MANDANT[$_SERVER['SERVER_NAME']],$WERBUNG,$FOTO,$STRECKE,$_SERVER['SERVER_NAME']),true));

	function array_alloc_equal($a1, $a2){
		// eleminate all those who are equal from both
		foreach($a1 AS $k => $v){
			if(!isset($a2[$k])){
				return false;
			}else{
				if(is_array($v) && is_array($a2[$k])){
					// recursive call
					if(!array_alloc_equal($v, $a2[$k])){
						return false;
					}
				}else if($v !== $a2[$k]){
					// mismatch
					return false;
				}
				// remove "seen" keys
				unset($a2[$k]);
			}
		}

		return count($a2) == 0;
	}

?>