Thanks, ptmuldoon
I seem to have located the code source for email blasts.
It's in functions/function_common.php lines 248-271:
Code:
//Send Email to Next Player
if($npmail == 1 ){ //0 is no updates, 1 is mail them
//Query Users for Email address of next player
$query4 = mysql_query("SELECT * FROM ". $_G['mysql_prefix'] ."users WHERE login = '{$nplayer}' ") or die(mysql_error());
$query4_row = mysql_fetch_assoc($query4);
$next_email = $query4_row['email'];
$EmailTo = $next_email;
$EmailFrom = "WebMaster@{$_SERVER['SERVER_NAME']}";
$FromName = "Webmaster";
$EMailSubject = "NetRisk Game: {$gname}";
$Glink = "<a href=\"{$_SERVER['SERVER_NAME']}". $_G['game_path'] ."login.php?id={$gid} \">Here</a>";
$EmailMessage = "It is your turn in the NetRisk Game: {$gname}.<br />";
$EmailMessage .= "You can visit the game here: {$Glink}.<br />";
SendEmail($EmailTo,$EmailFrom,$FromName,$EMailSubject,$EmailMessage);
}
//Update LastMove Time
update_last_move($gid);
}
}
}
And lines 353-379:
Code:
//Send Email to Dead Player
if($pmail == 1 ){ //0 is no updates, 1 is mail them
//Query Users for Email address of next player
$query4 = mysql_query("SELECT * FROM ". $_G['mysql_prefix'] ."users WHERE login = '{$opposing_player}' ") or die(mysql_error());
$query4_row = mysql_fetch_assoc($query4);
$dead_email = $query4_row['email'];
$EmailTo = $dead_email;
$EmailFrom = "WebMaster@{$_SERVER['SERVER_NAME']}";
$FromName = "Webmaster";
$EMailSubject = "NetRisk Game: {$gname} Player Defeated";
$Glink = "<a href=\"{$_SERVER['SERVER_NAME']}". $_G['game_path'] ."index.php?p=create \">Create a New Game</a>";
$EmailMessage = "Were sorry to inform you that your playder has died in the the NetRisk Game: {$gname}.<br />";
$EmailMessage .= "Perhaps you would like to {$Glink}?<br />";
SendEmail($EmailTo,$EmailFrom,$FromName,$EMailSubject,$EmailMessage);
}
//Check for Force Trade
force_card_trade($game_id, $attack_name);
} else {
//Return player to attacking state
$query_return = mysql_query("UPDATE ". $_G['mysql_prefix'] ."game_players SET pstate = 'attacking' WHERE gid = {$game_id} AND pid = {$attack_id} ") or die(mysql_error());
}
}
I notice the url after clicking "Here" in the email looks like this:
http ://mysite.com//netrisk//login.php?id=
instead of:
http ://www.mysite.com/netrisk/login.php?id=
Note the lack of "www" and the double slashes where they don't belong surrounding the "//netrisk//" folder. (I purposely broke the links in the above examples by putting in the space considering this is a forum).
Thanks again! I hear you about being busy with family and work and such. It's been nuts, but just found a little window to mess around with your game source and get it running on my site. Any suggestion how to properly re-code this without frying sql - existing games and users - or the code? (I've tried and got errors, then fried mysql... now dropping all my tables and re-installing).
Appreciate it!!