require_once('tools.php'); $filearr=explode("/",$files); // The approach here: //IF NUM > 0 (so we have a picture here not just an album) // If it has an IPTC KEyword: // if it has a keyword AND caption // IPTCKeyword : Caption // else // IPTCKeyword : AlbumTitle // else if it has a filename which starts with an alphabetical character but not IMG // if it has a caption // PrettifiedFileName : Caption // else // PrettifiedFileName : AlbumTitle // else if it has a caption // Caption // else // AlbumTitle //ELSE // AlbumTitle as before. $aog=0; if ($aog==1 && !$num && !$ignoreaog) { if ($filearr[count($filearr)-1] != "Low") { // $title=$filearr[count($filearr)-1] . ", ".$filearr[count($filearr)-2]." travel pictures"; // $titlebare=$filearr[count($filearr)-1] . ", ".$filearr[count($filearr)-2]; if (strpos($filearr[count($filearr)-1],"Club-Med-Bora-Bora")!== false ) { $titlebare="Club Med Bora Bora"; } else if (strpos($filearr[count($filearr)-1],"Moorea")!== false ) { $titlebare="Moorea"; } else if (strpos($filearr[count($filearr)-1],"Aitutaki-Beach")!== false ) { $titlebare="Aitutaki"; } else if (strpos($filearr[count($filearr)-1],"Kanha")!== false ) { $titlebare="Kanha National Park"; } else { $titlebare=$filearr[count($filearr)-1]; } $title=$titlebare." travel pictures"; } else { $title=$filearr[count($filearr)-2] . ", France travel pictures"; } } else { require_once('sspadmin_old/inc/connect.php'); $sname = $_SERVER['SERVER_NAME']; $sname = str_replace('www.', '', $sname); $self = 'http://www.'.$sname.$_SERVER['PHP_SELF']; $self = str_replace($adminDir.'/images2.php', '', $self); $starthere = 0; $dirname = $files; $myq = "SELECT $atbl.id, $atbl.name, $atbl.description FROM $atbl WHERE path= '$dirname' ORDER BY displayOrder"; $myr = mysql_query($myq); $myalbuminfo = mysql_fetch_array($myr); $id = $myalbuminfo['id']; // If the last word in the path name is actually found in the long-winded title, use it. if ($filearr[0]=="OtherTrips" || $filearr[0]=="Israel" || $filearr[0]=="Jordan") { $prepend=""; $postpend=""; // $postpend=": Hotel, tour and restaurant reviews, travel pictures, and blog"; // $postpend=": Travel Information and our Travelogue"; } else { $prepend=""; $postpend=""; // $postpend=": Travel Guide, Travelogue, Travel Photos, and Travel Pictures"; // $postpend=": Hotel, tour and restaurant reviews, travel pictures, and blog"; // $postpend=": Travel Information and our Travelogue"; } $city = $filearr[count($filearr)-1]; $city = preg_replace('/(?<=[a-z])([A-Z])/', ' $1', $city); $state = $filearr[count($filearr)-2]; $state = ", ".preg_replace('/(?<=[a-z])([A-Z])/', ' $1', $state); $country = $filearr[1]; $country = preg_replace('/(?<=[a-z])([A-Z])/', ' $1', $country); if (strpos($country, " ")) { // if its multiple countries $country = ""; } else { $country = ", ".$country; } if (count($filearr) > 3) { if (!strcmp($country ,$state)) { $country=""; } } else { $country=""; } global $country; include('/home/isewell/ianandwendy.com/php/country.php'); if (!$myalbuminfo['name']) { // We dont have album info - probably dynamic. $albumtitle=$prepend.$city.$state.$country.$postpend; $barealbumtitle = $city.$state.$country; } else { // if country name is already in the album descript, dont use it again if (strlen($country) > 0 && strpos($myalbuminfo['name'], $country)) { $albumtitle=$prepend.$myalbuminfo['name'].$postpend; } else { if (strlen($city) > 0) $albumtitle=$country." : ".$state." : ".$city.$prepend." : ".$myalbuminfo['name'].$postpend; else if (strlen($state) > 0) $albumtitle=$country." : ".$state.$prepend." : ".$myalbuminfo['name'].$postpend; else if (strlen($country) > 0) $albumtitle=$country.$prepend." : ".$myalbuminfo['name'].$postpend; else $albumtitle=$prepend.$myalbuminfo['name'].$postpend; } $barealbumtitle = $myalbuminfo['name']; } // else if the last part of the path name is included in the album's DB name, // else if (strpos($myalbuminfo['name'], $filearr[count($filearr)-1])) { // $title=$prepend.$myalbuminfo['name'].$state.$country; // $title=$prepend . $city.$state.$country; // } //else { //$title="Travel Pictures of ".$myalbuminfo['name'].$state.$country; //} $desc = $myalbuminfo['description']; // Ok, so now we have albumtitle, which is all we can do if pic # is not specified. if (!$num) { $title = "Pictures of ".$albumtitle; } else { // We have an image we're going to display. $iq = "SELECT * FROM $itbl WHERE active = 1 AND aid = $id ORDER BY seq,id"; $ir = mysql_query($iq); $imgcount = 0; while ($irw = mysql_fetch_array($ir)) { $imgcount++; $Filename=""; if ($imgcount == $num) { $Filename = $irw['src']; $Caption = $irw['caption']; // $Caption = nl2br($Caption); // $Caption = str_replace("\n", '', $cap); // $Caption = str_replace("\r", '', $cap); break; } } $PrettyFilename = preg_replace('/(?<=[a-z])([A-Z])/', ' $1', $Filename); $PrettyFilename = str_replace(".jpg",'',$PrettyFilename); $PrettyFilename = str_replace(".JPG",'',$PrettyFilename); $PrettyFilename = str_replace("IMG_",'',$PrettyFilename); $PrettyFilename = str_replace("-",' ',$PrettyFilename); $imagename="/home/isewell/ianandwendy.com/".$dirname."/".$Filename; $size = getimagesize($imagename, $info); if (isset($info["APP13"])) { $iptc = iptcparse($info["APP13"]); $key1 = mysql_real_escape_string(trim(@$iptc["2#025"][0])); $key2 = mysql_real_escape_string(trim(@$iptc["2#025"][1])); $key3 = mysql_real_escape_string(trim(@$iptc["2#025"][2])); $key4 = mysql_real_escape_string(trim(@$iptc["2#025"][3])); $key5 = mysql_real_escape_string(trim(@$iptc["2#025"][4])); $key6 = mysql_real_escape_string(trim(@$iptc["2#025"][5])); $key7 = mysql_real_escape_string(trim(@$iptc["2#025"][6])); $key8 = mysql_real_escape_string(trim(@$iptc["2#025"][7])); $key9 = mysql_real_escape_string(trim(@$iptc["2#025"][8])); $key10 = mysql_real_escape_string(trim(@$iptc["2#025"][9])); $emb_url = mysql_real_escape_string(trim(@$iptc["2#116"][0])); $emb_title = @$iptc["2#105"][0]; // $emb_title = mysql_real_escape_string(trim(@$iptc["2#105"][0])); if (strlen($key1) <2) { // $keys = basename($images[$ids[0]]); } else { $keys = $key1; } if (strlen($key2) >1) { $keys .= " " . $key2; } if (strlen($key3) >1) { $keys .= " " . $key3; } if (strlen($key4) >1) { $keys .= " " . $key4; } if (strlen($key5) >1) { $keys .= " " . $key5; } if (strlen($key6) >1) { $keys .= " " . $key6; } if (strlen($key7) >1) { $keys .= " " . $key7; } if (strlen($key8) >1) { $keys .= " " . $key8; } if (strlen($key9) >1) { $keys .= " " . $key9; } if (strlen($key10) >1) { $keys .= " " . $key10; } //$n = $album_photos[$j]; } else { $keys=""; } $keys=str_replace("keep","",$keys); $keys=str_replace("makayla","",$keys); if (strlen($keys) < 2) $keys=""; $keys=capitalize_words($keys); $PrettyFilename=capitalize_words($PrettyFilename); //$title = "NUM: $num. ID: $id. mFN: $MyFilename . PFN: $PrettyFilename . Keys: $keys . Capt: $Caption"; // print ("EMB TITLE IS: " . $emb_title); if (strlen($emb_title) > 3) { // If it has a title if (strlen($Caption) > 3) { // if it has a keyword AND caption $title = "Travel $country: Pictures of $emb_title, $barealbumtitle : $Caption"; // IPTCKeyword : Caption CHECKED } else { $title = "Travel $country: Pictures of $emb_title : $albumtitle"; // IPTCKeyword : Album title CHECKED } } else if (strlen($keys) > 3) { // If it has an IPTC KEyword: if (strlen($Caption) > 3) { // if it has a keyword AND caption $title = "Travel $country: Pictures of: $keys, $barealbumtitle : $Caption"; // IPTCKeyword : Caption CHECKED } else { $title = "Travel $country: Pictures of $keys : $albumtitle"; // IPTCKeyword : Album title CHECKED } } else if (ctype_alpha(substr($PrettyFilename,0,4))) { // else if it has a filename which starts with an alphabetical character but not IMG if (strlen($Caption) > 3) { // if it has a keyword AND caption $title = "Travel $country: Pictures of $PrettyFilename : $barealbumtitle : $Caption"; // PrettyFilename : Caption CHECKED } else { $title = "Travel $country: Pictures of $PrettyFilename : $albumtitle"; // PrettyFilename : Album title CHECKED } } else if (strlen($Caption) > 3) { // if it has caption CHECKED $title = "Travel $country: Pictures of $barealbumtitle : $Caption"; // Caption } else { $title = "Travel $country: Pictures of $albumtitle"; // CHECKED } //$title=$Caption; } } ?> print("