".str_clean($ReaderInfo["UserName"])."\n\r"; if (str_clean($selections) == "") $selections=""; //No author alerts currently available for deletion fileparser("../data/templates/userconsole/deleteauthoralert.html", "//", $selections); }//end deleteAuthorAlert_disp() //=============== addAuthorAlert ====================== function addAuthorAlert($postdata) { if (!is_numeric($postdata["wid"])) { if (!$errors) errormsg_internal("Author ID #", "The author ID # you entered is not currently valid. Please enter a different ID #"); $errors=true; }//if the author id they entered isn't a number if (!$errors) { $query="SELECT COUNT(UserID) AS UserNumber FROM UserInfo WHERE UserID=".str_clean($postdata["wid"]); $result=myquery($query) or errormsg("$query"); $ainfo=mysql_fetch_array($result, MYSQL_ASSOC); //See if the user's email is currently up to date $query="SELECT COUNT(AuthorID) AS UserNumber FROM AuthorAlerts WHERE AuthorID=".str_clean($postdata["wid"])." AND UserID=$_SESSION[id]"; $result=myquery($query) or errormsg("$query"); $alrtinfo=mysql_fetch_array($result, MYSQL_ASSOC); }//don't perform these queries if its not a numeric entry if ($ainfo["UserNumber"]==0) { if (!$errors) errormsg_internal("Author ID #", "The author ID # you entered is not currently valid. Please enter a different ID #"); $errors=true; }//if the author doesn't exist under that ID # if ($alrtinfo["UserNumber"] >=1) { if (!$errors) errormsg_internal("Author Alert", "You already have an Author Alert for this Author. Please enter the UserID of a different Author."); $errors=true; }//if they already have an alert for this author if ($postdata["wid"] == $_SESSION["id"]) { if (!$errors) errormsg_internal("Author Alert", "You CANNOT add an author alert for YOURSELF."); $errors=true; }//if they are trying to add themselves if ($errors) addAuthorAlert_disp(); else { $Aaquery="INSERT INTO AuthorAlerts (UserID, AuthorID) VALUES ($_SESSION[id], $postdata[wid])"; myquery($Aaquery) or errormsg("$Aaquery"); finishpage("Congratulations, the Author Alert has been successfully Added!"); }//if there's no errors }//end addAuthorAlert //=============== deleteAuthorAlert ==================== function deleteAuthorAlert($postdata) { //Check for User Mistakes/errors/stupidity if ($postdata["wid"] == array() || $postdata["wid"] == "") { errormsg_internal("Author Alert", "You Need to Select an Author Alert to Remove"); deleteAuthorAlert_disp(); return; }//If the user didn't select anything if (!is_numeric($postdata["wid"][0])) { errormsg_internal("Author Alert", "You Need to Select an Author Alert to Remove"); deleteAuthorAlert_disp(); return; }//If the user didn't select anything //If there was correct usage, go and remove the author alerts foreach($postdata["wid"] as $UserID) { $query="DELETE FROM AuthorAlerts WHERE UserID=$_SESSION[id] AND AuthorID=$UserID"; myquery($query) or errormsg("$query"); }//remove each entry finishpage("Congratulations, the Author Alert(s) have been successfully deleted."); }//end delete authoralert // =================================== END OF USER CONTROL FUNCTIONS ======================== //Send alert sends alert messages for the readers function sendAuthorAlert($AlertEntry, $is_fanfic, $info=array()) { $alertbody=""; //Initialize the string. //If there's no Readers to Alert, drop out //====== Get my Email address ============= if (is_array($AlertEntry)) foreach($AlertEntry as $Alert) $alertbody.="\r".generateAlertMessage($Alert, $is_fanfic, array_shift($info)); //if its multiple alerts, to save on email traffic. else $alertbody=generateAlertMessage($AlertEntry, $is_fanfic, $info); //if its only a single. if (trim($alertbody) == null || trim($alertbody) == "") return; //$_SESSION["username"] $message=" Dear Reader(s), Your Author, ".$_SESSION["username"].", has posted/update the following pieces: $alertbody "; $query="SELECT UserID FROM AuthorAlerts WHERE AuthorAlerts.AuthorID=$_SESSION[id]"; $result=myquery($query) or errormsg("$query"); $query="INSERT INTO PrivateMessages (MailSenderID, MailRecipientID, MailSubject, MailBody, DateSent) VALUES "; while ($UserInfo=mysql_fetch_array($result, MYSQL_ASSOC)) $query.="($_SESSION[id], $UserInfo[UserID], '".addslashes($_SESSION["username"]." has Posted New Material!")."', '".addslashes($message)."', '".addslashes(date("M d, Y G:i:sA"))."'),\n"; $query=substr($query, 0, -2); if (mysql_num_rows($result) > 0) myquery($query) OR errormsg($query); }//end send author alerts function generateAlertMessage($storyID, $is_fanfic, $info=array()) { global $HTTPHOST; if (isset($storyID) && is_numeric($storyID) && $info != array()) { $AlertMsg=" Title: ".$info["StoryTitle"]." Rated: ".$info["Rating"]." Genre: ".$info["Genre"]." Description: \n\n\r\r".$info["Description"]."\r\n"; if ($info["DatePosted"] == $info["DateUpdated"]) $AlertMsg .= "\r\nPosted: ".date("m/d/Y h:i:sa",$info["DatePosted"]); else $AlertMsg .= "\r\nUpdated: ".date("m/d/Y h:i:sa",$info["DateUpdated"]); if ($is_fanfic) $AlertMsg .="\n\rThis story can be viewed at the following URL:\n\rhttp://$HTTPHOST/view.php?storyid=$storyID"; else $AlertMsg .="\n\rThis story can be viewed at the following URL:\n\rhttp://$HTTPHOST/view.php?pictureid=$storyID"; }//if its working properly else return null; return $AlertMsg; }//end line generator ?>".str_clean($ReaderInfo["UserName"])."\n\r"; if (str_clean($selections) == "") $selections=""; //No author alerts currently available for deletion fileparser("../data/templates/userconsole/deleteviewer.html", "//", $selections); }//end deleteViewer_disp() //=============== addAuthorAlert ====================== function addViewer($postdata) { $query="SELECT COUNT(UserID) AS UserNumber FROM UserInfo WHERE UserID=".str_clean($postdata["wid"]); $result=myquery($query) or errormsg("$query"); $ainfo=mysql_fetch_array($result, MYSQL_ASSOC); //See if the user's email is currently up to date $query="SELECT COUNT(ViewerID) AS UserNumber FROM PrivateViewers WHERE ViewerID=".str_clean($postdata["wid"])." AND UserID=$_SESSION[id]"; $result=myquery($query) or errormsg("$query"); $alrtinfo=mysql_fetch_array($result, MYSQL_ASSOC); $errors=false; if ($ainfo["UserNumber"]==0) { if (!$errors) errormsg_internal("Viewer ID #", "The viewer ID # you entered is not currently valid. Please enter a different ID #"); $errors=true; }//if the author doesn't exist under that ID # if ($alrtinfo["UserNumber"] >=1) { if (!$errors) errormsg_internal("Authorized Viewer", "You already have authorized this viewer. Please enter the UserID of a different user."); $errors=true; }//if they already have an alert for this author if ($postdata["wid"] == $_SESSION["id"]) { if (!$errors) errormsg_internal("Authorized Viewer", "You CANNOT add YOURSELF."); $errors=true; }//if they are trying to add themselves if ($errors) addViewer_disp(); else { $Aaquery="INSERT INTO PrivateViewers (UserID, ViewerID) VALUES ($_SESSION[id], $postdata[wid])"; myquery($Aaquery) or errormsg("$Aaquery"); finishpage("Congratulations, the Reader has been successfully Authorized!"); }//if there's no errors }//end addAuthorAlert //=============== deleteAuthorAlert ==================== function deleteViewer($postdata) { //Check for User Mistakes/errors/stupidity if ($postdata["wid"] == array() || $postdata["wid"] == "") { errormsg_internal("Authorized Viewer", "You Need to Select an Viewer to Remove"); deleteViewer_disp(); return; }//If the user didn't select anything if (!is_numeric($postdata["wid"][0])) { errormsg_internal("Authorized Viewer", "You Need to Select an Viewer to Remove"); deleteAuthorAlert_disp(); return; }//If the user didn't select anything //If there was correct usage, go and remove the author alerts foreach($postdata["wid"] as $UserID) { $query="DELETE FROM PrivateViewers WHERE UserID=$_SESSION[id] AND ViewerID=$UserID"; myquery($query) or errormsg("$query"); }//remove each entry finishpage("Congratulations, the Viewer(s) have been successfully removed from the list."); }//end delete authoralert // =================================== END OF USER CONTROL FUNCTIONS ======================== ?>".ucwords(str_clean($xtrainfo["StoryTitle"])). " >> ".substr(html_entities_decode(ucwords(str_clean($FavoriteInfo["Title"]))),0,25); if (strlen(html_entity_decode(str_clean($FavoriteInfo["Title"]))) > 25) $stories.="......"; $stories.="\n\r"; } else $stories.="\n\r"; else $authors.="\n\r"; if (str_clean($stories) == "") $stories=""; //No favorite stories currently available for deletion if (str_clean($authors) == "") $authors=""; //No favorite authors currently available for deletion fileparser("../data/templates/userconsole/deletefavorites.html", array("//", "//"), array($authors, $stories)); }//end del_favorites_disp() //=============== deleteAuthorAlert ==================== function del_favorites($postdata) { if (!is_array($postdata["wid1"]) && !is_array($postdata["wid2"])) $wid=array(); if (!is_array($postdata["wid1"]) && is_array($postdata["wid2"])) $wid=$postdata["wid2"]; if (!is_array($postdata["wid2"]) && is_array($postdata["wid1"])) $wid=$postdata["wid1"]; if (is_array($postdata["wid1"]) && is_array($postdata["wid2"])) $wid=array_unique(array_merge($postdata["wid1"], $postdata["wid2"])); /* DebugLog("favoritescode.log", " \$postdata[wid1] ".print_r($postdata["wid1"], true)." \$postdata[wid2] ".print_r($postdata["wid2"], true)." \$wid ".print_r($wid), true); */ //Check for User Mistakes/errors/stupidity if ($wid == array() || $wid == "") { errormsg_internal("Favorite(s)", "You Need to Select Favorite(s) to Remove"); del_favorites_disp(); return; }//If the user didn't select anything if ($wid[0]==0) { errormsg_internal("Favorite(s)", "You Need to Select Favorite(s) to Remove"); del_favorites_disp(); return; }//If the user didn't select anything //If there was correct usage, go and remove the author alerts foreach($wid as $FavoriteID) if ($FavoriteID != 0) { $query="DELETE FROM Favorites WHERE UserID=$_SESSION[id] AND FavoriteID=$FavoriteID"; myquery($query) or errormsg("$query"); }//remove each entry finishpage("Congratulations, the Favorites(s) have been successfully deleted."); }//end delete favorites $width_max) $percent=$width_max/$width; else $percent=1; $new_width = $width * $percent; $new_height = $height * $percent; // Resample $image_p = imagecreatetruecolor($new_width, $new_height); @imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $image_q = imagecreatetruecolor($thumb_x, $thumb_y); @imagecopyresampled($image_q, $image, 0, 0, 0, 0, $thumb_x, $thumb_y, $width, $height); // Output if ($mimetype=="image/jpeg" || $mimetype=="image/pjpeg") { @imagejpeg($image_q, "../$ARTFOLDER/_thumbs/TN$filename", $quality); @imagejpeg($image_p, "../$ARTFOLDER/$dir/$filename", $quality); }//if its a Jpeg else { @imagegif($image_q, "../$ARTFOLDER/_thumbs/TN$filename", $quality); @imagegif($image_p, "../$ARTFOLDER/$dir/$filename", $quality); }//if its a Gif imagedestroy($image_p); imagedestroy($image_q); imagedestroy($image); }//end SaveImage //-- End the Library File ?>
Warning: Cannot modify header information - headers already sent by (output started at /var/www/fanworks-org/users/headers/authoralert.php:1) in /var/www/fanworks-org/users/user.php on line 23

Warning: session_start(): Cannot start session when headers already sent in /var/www/fanworks-org/users/user.php on line 55
FanWorks.org :: Fan Works Inc. - Upgrades Under Way!
Administration Login Only

Fan Works Inc. is Closed right now for upgrades! We'll reopen as soon as the improvements are complete, please check back soon, or check your email for notice of the completion of the upgrades.

Thanks for Visiting!

TOS  |  Privacy Policy  |  Questions/Comments?  |  Found a bug?  |  Report violations of the TOS
Powered by E-FanWorks v3.9.9b © Null Referrence Software 2003-2006 The PDX Senpais 2020