<div id='loadingDiv' > <img src='<?php echo $moduleRelPath; ?> /img/ajax-loader.gif'> </div> <div id='submitComment' > <form action="#" method="post"> <?php // caching pilot names in an array $pilotNames = array(); if ($userID) { $imgBigRel = getPilotPhotoRelFilename($userServerID, $userID); $imgBig = getPilotPhotoFilename($userServerID, $userID); if (is_file($imgBig)) { list($width, $height, $type, $attr) = getimagesize($imgBig); list($width2, $height2) = CLimage::getJPG_NewSize($CONF['photos']['tiny']['max_width'], $CONF['photos']['tiny']['max_height'], $width, $height); echo "<a href='{$imgBigRel}' target='_blank'><img src='" . getPilotPhotoRelFilename($userServerID, $userID, 1) . "' width='{$width2}' height='{$height2}' align='absmiddle' border=0></a>"; } else { echo "<img src='{$moduleRelPath}/img/photo_no_profile_photo.jpg' width='50' height='50' align='absmiddle' border=0>"; } $name = $pilotNames[$userID][$userServerID]; if (!$name) { $name = getPilotRealName($userID, $userServerID + 0, 1, 1, 1); $pilotNames[$userID][$userServerID] = $name; } echo " " . _Logged_in_as . " {$name}"; ?> <input type="button" class="submit" value=" <?php
// called directly ? if (!$commentID) { exit; } // we get these from the caller // $commentID=$thread['id']; // $commentData=$flightComments->comments[$thread['id']]; // $commentDepth=$thread['depth']; $str .= "\n\n\n<div id='comment_{$commentID}' class='commentBox depth{$commentDepth}'>"; // helper hidden div $str .= "<span id='cid_{$commentID}'>\n<span id='pid_" . $commentData['parentID'] . "' class='parentFinder'></span></span>"; $str .= "<table class='commentRowTable' width='100%'>"; if (!$print) { if ($commentData['userID']) { $imgBig = getPilotPhotoFilename($commentData['userServerID'], $commentData['userID']); if (is_file($imgBig)) { list($width, $height, $type, $attr) = getimagesize($imgBig); list($width2, $height2) = CLimage::getJPG_NewSize($CONF['photos']['tiny']['max_width'], $CONF['photos']['tiny']['max_height'], $width, $height); $header = "<img src='" . getPilotPhotoRelFilename($commentData['userServerID'], $commentData['userID'], 1) . "' \n\t\t\t\t\t\twidth='{$width2}' height='{$height2}' border=0>"; } else { $header = "<img src='{$moduleRelPath}/img/photo_no_profile_photo.jpg' width='50' height='50' border=0>"; } $str .= "<tr><td rowspan='2' width='65' valign='top'><div class='commentHeader'>{$header}</div></td>"; $str .= "<td valign='top'><div id='commentText{$commentID}' class='commentBody'>" . $commentData['text'] . "</div></td></tr>"; } else { $header = "<img src='{$moduleRelPath}/img/photo_guest.jpg' width='50' height='50' border=0>"; $str .= "<tr><td rowspan='2' width='65' valign='top'><div class='commentHeader'>{$header}</div></td>"; $str .= "<td valign='top'><div id='commentText{$commentID}' class='commentBody'>" . $commentData['text'] . "</div></td></tr>"; //$str.="<div class='commentHeaderGuest'>".$commentData['guestName']."</div>"; //$str.="<div class='commentBodyGuest'>".$commentData['text']."</div>";
function checkPilotPhoto($serverID, $pilotID) { $normalImagePath = getPilotPhotoFilename($serverID, $pilotID, 0); $thumbImagePath = getPilotPhotoFilename($serverID, $pilotID, 1); if (!is_file($thumbImagePath) && is_file($normalImagePath)) { // create icon CLimage::resizeJPG(150, 150, $normalImagePath, $thumbImagePath, 15); } }
$name = str_replace($pilotName, "<b>{$pilotName}</b>", $name); $pilotName0 = strtolower($pilotName0); $d1 = levenshtein($pilotName0, strtolower($row['FirstName'] . ' ' . $row['LastName'])); $d2 = levenshtein($pilotName0, strtolower($row['LastName'] . ' ' . $row['FirstName'])); $d3 = levenshtein($pilotName0, strtolower($row['FirstName'])); $d4 = levenshtein($pilotName0, strtolower($row['LastName'])); $dmax = max(array($d1, $d2, $d3, $d4)); // similar_text (strtolower($lastIntName),strtolower($row2['intName']),&$nameDistanceFromPrevious2); $html = $row['FirstName'] . ' ' . $row['LastName'] . '|' . $flagIcon . $sexIcon . $name . '|' . $row['serverID'] . 'u' . $row['pilotID'] . "\n"; $serverIDview = $row["serverID"]; $pilotIDview = $row["pilotID"]; $photo = ''; if ($row['PilotPhoto'] > 0) { //checkPilotPhoto($serverIDview,$pilotIDview); $imgBigRel = getPilotPhotoRelFilename($serverIDview, $pilotIDview); $imgBig = getPilotPhotoFilename($serverIDview, $pilotIDview); // echo $imgBig."<BR>"; list($width, $height, $type, $attr) = getimagesize($imgBig); //echo $imgBig." $CONF['photos']['mid']['max_width'], $CONF['photos']['mid']['max_height'], $width, $height <br>"; list($width, $height) = CLimage::getJPG_NewSize($CONF['photos']['mid']['max_width'], $CONF['photos']['mid']['max_height'], $width, $height); $photo = "<a href='{$imgBigRel}' target='_blank'><img src='" . getPilotPhotoRelFilename($serverIDview, $pilotIDview, 1) . "'\n\t\t\tonmouseover=\"trailOn('{$imgBigRel}','','','','','','1','{$width}','{$height}','','.');\" onmouseout=\"hidetrail();\"\n\t\t\t border=0></a>"; $photo = "<img src='" . getPilotPhotoRelFilename($serverIDview, $pilotIDview, 1) . "'>"; } if ($_GET['json']) { $photo = json::prepStr($photo); } if ($_GET['json']) { $json = ' { "firstName":"' . json::prepStr($row["FirstName"]) . '", "lastName":"' . json::prepStr($row["LastName"]) . '", ' . ' "name":"' . json::prepStr($name) . '",' . ' "flag":"' . json::prepStr($flagIcon) . '",' . ' "photo":"' . $photo . '", ' . ' "sex":"' . json::prepStr($sexIcon) . '", "userID":"' . json::prepStr($row["serverID"] . 'u' . $row["pilotID"]) . '" } '; } else { $jsom = ''; }
if (!is_dir($path)) { makeDir($path); } if (move_uploaded_file($_FILES['PilotPhoto']['tmp_name'], getPilotPhotoFilename($serverIDview, $pilotIDview))) { CLimage::resizeJPG(150, 150, getPilotPhotoFilename($serverIDview, $pilotIDview), getPilotPhotoFilename($serverIDview, $pilotIDview, 1), 15); CLimage::resizeJPG(800, 800, getPilotPhotoFilename($serverIDview, $pilotIDview), getPilotPhotoFilename($serverIDview, $pilotIDview), 15); $PilotPhoto = 1; } else { //upload not successfull @unlink(getPilotPhotoFilename($serverIDview, $pilotIDview, 1)); @unlink(getPilotPhotoFilename($serverIDview, $pilotIDview, 0)); $PilotPhoto = 0; } } else { // no change if (is_file(getPilotPhotoFilename($serverIDview, $pilotIDview))) { $PilotPhoto = 1; } else { $PilotPhoto = 0; } } } if ($CONF['userdb']['edit']['enabled']) { # Martin Jursa 26.04.2007 # save password and/or email if ($_POST['user_email'] == $_POST['user_email_old']) { $newEmail = '#same_as_old#leonardo#'; } else { $newEmail = $_POST['user_email']; } $changeMsg = saveLoginData($pilotIDview, $newEmail, !empty($_POST['pwd1']) ? $_POST['pwd1'] : '', !empty($_POST['pwd2']) ? $_POST['pwd2'] : '');