Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $debug_globalemails = get_db_column("SELECT * FROM debug WHERE id='1'", "active");
- $globalemails = implode($debug_globalemails, ",");
- $c = get_post_var("c");
- //Nohing changed before this point
- $users = array( //I need all these values to run the loop
- "rick" => "chamb0",
- "ross" => "Ross",
- "john" => "john",
- "simon" => "simon",
- "codge" => "codge",
- "alex" => "alex");
- $emails = array( //These are needed for the emails part... T_T
- "rick" => "rickychambo@gmail.com",
- "ross" => "rosshurrell@gmail.com",
- "john" => "john.martin117@googlemail.com",
- "simon" => "simon.ansah@googlemail.com",
- "codge" => "danielsmith1983ds@googlemail.com",
- "alex" => "alex.sheekey@gmail.com");
- /*
- Loop through the users and the databases
- Note the dynamic variable name created like this: $n="name" $$n
- Now we have a variable called $name
- The {} brackets used basically evaluates the content to create the name ${$n.$n.'boobs'} would be $namenameboobs
- */
- //First batch
- foreach($users as $db => $u) {
- ${'comment_'.$db.'_db'}= get_db_column("SELECT * FROM comments WHERE torrent=$id AND user=\"$u\" OR torrent=$id AND user=\"$u\" Limit 1", "user");
- ${'comment_'.$db} = implode(${'comment_'.$db.'_db'});
- }
- //Second batch
- if(($globalemails=="On") && isset($c['comment'])) {
- if($_POST['emailall'] == "yes"){
- $everyone_email = implode(", ",$emails).", actionboll@gmail.com"; //Just collapse the email array and add mine >_>
- } else {
- foreach($users as $db => $u) { //Same loop as before
- //strtolower needed due to all the oddities, also below as the variable now is chamb0 and not Chamb0 or rick... confusion!
- if(strtolower($username)==strtolower($u)||strtolower($newspost['username'])==strtolower($u)||strtolower(${'comment_'.$db})==strtolower($u)) {
- ${strtolower($u).'_email'} = $email[$db].', ';
- }
- }
- }
- //Nothing changed beyond this point
- $to = $chamb0_email.$ross_email.$john_email.$simon_email.$codge_email.$alex_email.$everyone_email;
- $subject = "Comment added: ".$news_post['title'];
- $body = $username.": ".$c['comment'];
- $headers = "From: chamb0.com<deluge@chamb0.com>\r\n" .
- "X-Mailer: php";
- mail($to, $subject, $body, $headers);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement