} if ($_SESSION['account_position'] == "Admin") { $ip = "(Removed For Privacy Reasons)"; } $_SESSION['IP'] = $ip; //Log successful login logText("{$user} Logged In With The Ip: {$ip} At " . date("h:i A") . "", "good"); $_SESSION['LoggedIn'] = True; Header("Location: /main.php"); return; } else { $arr = mysql_fetch_array($finalQuery); $user = $arr['username']; $ip = $arr['registration_ip']; //Log bad login logText("{$ip} Tried To Login As The User {$user} At " . date("h:i A") . "", "bad"); $eMsg = "You have entered an invalid login"; } } } echo '<style>body{background-image: url(' . imageToBase64($background) . ');}</style>'; disableRightClick(); ?> <title><?php echo "{$title}"; ?> </title> <head> <link href="/stylesheets/default.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/css_buttons.css" rel="stylesheet" type="text/css"> </head>
function logUnban() { global $username; global $user; if ($_SESSION['account_position'] == "Admin") { $ip = "(Removed For Privacy Reasons)"; } else { $ip = $_SERVER['REMOTE_ADDR']; } $time = date("h:i A"); logText("{$user} <b>Unbanned</b> {$username} with the Ip {$ip} at {$time}", "ban"); }
function insertMedia($data) { global $connection; $sql = 'SELECT trackId FROM media WHERE trackId = ' . $data["trackId"]; $result = $connection->query($sql); if (!$result || $result->num_rows == 0) { $sql = 'INSERT INTO media VALUES(' . $data["trackId"] . ',' . '"' . $data["trackName"] . '",' . $data["artistId"] . ',' . '"' . $data["artistName"] . '",' . $data["collectionId"] . ',' . '"' . $data["collectionName"] . '",' . '"' . $data["previewUrl"] . '",' . '"' . $data["artworkUrl100"] . '",' . $data["trackPrice"] . ',' . '"' . date("Y-m-d H:i:s", strtotime($data["releaseDate"])) . '",' . $data["trackTimeMillis"] . ',' . '"' . $data["primaryGenreName"] . '",' . '"' . $data["radioStationUrl"] . '",' . '"' . $data["trackViewUrl"] . '"' . ');'; if (!$connection->query($sql)) { logText('Error : (' . $connection->errno . ') ' . $connection->error); } else { logText($data["trackName"] . " inserted"); } } if ($result) { $result->close(); } $sql = 'INSERT INTO plays VALUES(' . $data["trackId"] . ', CURRENT_TIMESTAMP);'; if (!$connection->query($sql)) { logText('Error : (' . $connection->errno . ') ' . $connection->error); } else { logText($data["trackName"] . " recorder"); } // echo "<pre>"; // var_dump($data); // echo "</pre>"; }
function sendEmail($configData,$formData) { // build the message body from the configured fields $body = "From ".$formData['fromName']." at ".$formData['fromAddress']."\r\n"; if (!empty($formData['list1'])) $body .= $configData['list_prompt'].": ".$configData['list_array'][$formData['list1']]."\r\n"; if (!empty($formData['line1'])) $body .= $configData['line1_prompt'].": ".$formData['line1']."\r\n"; if (!empty($formData['line2'])) $body .= $configData['line2_prompt'].": ".$formData['line2']."\r\n"; if (!empty($formData['line3'])) $body .= $configData['line3_prompt'].": ".$formData['line3']."\r\n"; if (!empty($formData['line4'])) $body .= $configData['line4_prompt'].": ".$formData['line4']."\r\n"; if (!empty($formData['line5'])) $body .= $configData['line5_prompt'].": ".$formData['line5']."\r\n"; if (!empty($formData['area_data'])) $body .= $configData['area_prompt'].": ".$formData['area_data']."\r\n"; // make sure the body and subject don't contain anything they shouldn't jimport('joomla.mail.helper'); $body = JMailHelper::cleanBody($body); $subject = JMailHelper::cleanSubject($formData['subject']); // get the client information $ip = getIPaddress(); $ipmsg = "Client IP: ".$ip."\r\n"; $ipmsg .= $_SERVER["HTTP_USER_AGENT"]."\r\n"; // from version 2.11 we now send the mail using the Joomla sendMail function (instead of php mail) // which uses the mail settings configured in Joomla Global Configuration $app = &JFactory::getApplication(); $from = $app->getCfg('mailfrom'); $fromname = $app->getCfg('fromname'); $recipient = $configData['toPrimary']; $cc = $configData['cc']; $bcc = $configData['bcc']; $replyto = $formData['fromAddress']; $replytoname = $formData['fromName']; // from version 2.15 we build the mail object ourselves so that we can get at the ErrorInfo $mail =& JFactory::getMailer(); $mail->setSender(array($from, $fromname)); $mail->setSubject($subject); $mail->setBody($body.$ipmsg); $mail->addRecipient($recipient); if ($cc != '') $mail->addCC($cc); if ($bcc != '') $mail->addBCC($bcc); $mail->addReplyTo(array($replyto, $replytoname)); $ret_main = $mail->Send(); if ($ret_main === true) $status = "Sent OK\r\n"; else $status = "Mail was NOT accepted for delivery (".$mail->ErrorInfo.")\r\n"; logText(JText::_('SUBJECT').": $subject\r\n". "To: $recipient\r\n". "From: $fromname at $from\r\n". "Cc: $cc\r\n". "Bcc: $bcc\r\n". "ReplyTo: $replytoname at $replyto\r\n". $ipmsg. $body. $status. "-------------------------\r\n"); // if the user wanted a copy, send that separately if ($formData['copyMe'] == 1) { $mail =& JFactory::getMailer(); $mail->setSender(array($from, $fromname)); $mail->setSubject($subject); $mail->setBody($body); $mail->addRecipient($formData['fromAddress']); $ret_copy = $mail->Send(); if ($ret_copy === true) $status = "Sent OK\r\n"; else $status = "Mail was NOT accepted for delivery (".$mail->ErrorInfo.")\r\n"; logText("Copy to: $recipient\r\n". $status. "-------------------------\r\n"); } return $ret_main; }
$output .= ' <source src="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '.webm" type="video/webm" />' . $newline; $output .= ' <source src="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '.ogv" type="video/ogg" />' . $newline; $output .= ' <object type="application/x-shockwave-flash" data="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" width="' . $width . '" height="' . $height . '">' . $newline; $output .= ' <param name="movie" value="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" />' . $newline; $output .= ' <param name="allowFullScreen" value="true" />' . $newline; $output .= ' <param name="wmode" value="transparent" />' . $newline; $output .= ' <param name="flashVars" value="controls=true&poster=' . urlencode('http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '_stills_3.png') . '&src=' . urlencode('http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '_x264_qt_faststart.mp4') . '" />' . $newline; $output .= ' <img alt="Video" src="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '_stills_3.png" width="' . $width . '" height="' . $height . '" title="No video playback capabilities, please download the video below" />' . $newline; $output .= ' </object>' . $newline; $output .= '</video>' . $newline; $output .= '<p>' . $newline; $output .= ' <strong>Download video:</strong> <a href="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '_x264_qt_faststart.mp4">MP4 format</a> | <a href="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '.ogv">Ogg format</a> | <a href="http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '.webm">WebM format</a>' . $newline; $output .= '</p>' . $newline; $output_end = '</body></html>' . $newline; list($log, $logPath, $logName) = logFile($filePath . $convertedLocation, $uploadedFilename . '_html5_player_.html'); logText($logPath . $logName, $output_start . $output . $output_end); // redirect to the html player header('Location: http://' . $_SERVER['HTTP_HOST'] . $webPath . $convertedLocation . $uploadedFilename . '_html5_player_.html'); } } } } else { $error = "Error - Invalid file size<br />"; $error .= "Size: " . $_FILES["file"]["size"] . " bytes<br />"; } } else { $error = "Error - Invalid file type<br />"; $error .= "Type: " . $_FILES["file"]["type"] . "<br />"; } } ?>
//iTunes API request $term = urlencode($artist . (isset($album) ? " " . $album : "") . " " . $title); // //echo $term; $iTunesJSON = file_get_contents('http://itunes.apple.com/search?term=' . $term . '&media=music&entity=song&limit=1'); $iTunesData = json_decode($iTunesJSON, true); if ($iTunesData["resultCount"] > 0) { $iTunesMetadata = $iTunesData["results"][0]; //timeExecution("Pull iTunes data"); insertMedia($iTunesMetadata); //timeExecution("Add media"); } else { logText("No itunes info"); } //$content = "<div style='background-image: url({$artwork});'><h1>{$artist} - {$title}</h1></div>"; // $contentFile = fopen("content.php", "w"); // fwrite($contentFile, $content); // fclose($contentFile); } elseif ($lastRecord) { //UPDATE filename in DB updateRecord($lastRecord->id, $fileName); //timeExecution("Update record"); logText("Song duplicate"); } } else { logText("Not enough info"); logText($file); } } else { logText("File duplicate"); } disconnect();