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 .= '
'; }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. ';
$out .= ''; }else{ $out .= 'Das Bild befindet sich bereits in ihrem Warenkorb. '; } $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){ 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 .= 'Warenkorb: '.count($_SESSION['WARENKORB']).' Bild/er'; $out .= ' |
'.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; } ?>