| <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include("_projectCommon.php"); # All on the same line to unclutter the user's desktop' |
| |
| #***************************************************************************** |
| # |
| # template.php |
| # |
| # Author: Denis Roy |
| # Date: 2005-06-16 |
| # |
| # Description: Type your page comments here - these are not sent to the browser |
| # |
| # |
| #**************************************************************************** |
| exit; |
| # This needs SQL injection cleanup. |
| # |
| # Begin: page-specific settings. Change these. |
| $pageTitle = "Eclipse Membership"; |
| $pageKeywords = "Type, page, keywords, here"; |
| $pageAuthor = "Type your name here"; |
| |
| # Add page-specific Nav bars here |
| # Format is Link text, link URL (can be http://www.someothersite.com/), target (_self, _blank) |
| # $Nav->addCustomNav("My Link", "mypage.php", "_self"); |
| # $Nav->addCustomNav("Google", "http://www.google.com/", "_blank"); |
| |
| # End: page-specific settings |
| # |
| |
| # Paste your HTML content between the EOHTML markers! |
| |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/membership/scripts/db_access.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/membership/scripts/common.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/membership/scripts/tabs.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/smartconnection.class.php"); |
| |
| $dbc = new DBConnection(); |
| $dbc->connect(); |
| ob_start(); |
| ?> |
| <script language="javascript" type="text/javascript" src="scripts/functions.js"></script> |
| <link rel="stylesheet" type="text/css" href="tabs.css" media="screen" /> |
| <div id="maincontent"> |
| <div id="midcolumn"> |
| <? |
| if ($_POST['submit'] == "Suggest New Tag") |
| { |
| $_org_id = $_POST['orgID']; |
| $_org_name = $_POST['orgName']; |
| $_tag_suggestion = $_POST['newTag']; |
| $_email_address = $_POST['email']; |
| $_captcha = $_POST['captcha']; |
| |
| if ($_captcha != 21) |
| { echo "BAD CAPTCHA HIT BACK AND TRY AGAIN"; exit();} |
| |
| $sntx = array("\"", "\\", "/", "*", "-", "=", "'", "#", ";", "<", ">", "+", "%"); |
| $_org_id = str_replace($sntx, "", $_org_id ); |
| $_org_name = str_replace($sntx, "", $_org_name ); |
| $_tag_suggestion = str_replace($sntx, "", $_tag_suggestion ); |
| $_email_address = str_replace($sntx, "", $_email_address ); |
| |
| |
| |
| $row = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS numrows FROM TagNames where tag_name='".$_tag_suggestion."';")); |
| $tag_exists = $row['numrows'] != 0; |
| |
| if ($tag_exists) { |
| echo "<font color=\"red\">Tag Already Exists! <br> Please use \"Suggest Existing Tags\" option. Email tags.suggest at eclipse dot org for |
| further explanation.</font>"; |
| } else { |
| $content = "<html>A new tag: ".$_tag_suggestion. " was suggested to be added to ". $_org_name." <a href=\"https://dev.eclipse.org/committers/membership/processTag.php?type=AddNew&tagName=".$_tag_suggestion."&orgID=".$_org_id."\">Process</a>\r\n</html>"; |
| $subject = "Membership Tag Suggestion for " . $_org_name; |
| |
| processMail($subject, $content, $_email_address); |
| echo "<font color=\"darkgreen\">Suggestion received! Your tag suggestion <i>$_tag_suggestion</i> will appear as soon as it is reviewed for applicability, thanks for your suggestion!</font>"; |
| } |
| } |
| elseif ($_POST['submit'] == "Suggest Existing Tags") |
| { |
| $_org_id = $_POST['orgID']; |
| $_org_name = $_POST['orgName']; |
| $_tagName_Array = $_POST['tagIDs']; |
| $_email_address = $_POST['email']; |
| |
| $_captcha = $_POST['captcha']; |
| if ($_captcha != 21) |
| { echo "BAD CAPTCHA HIT BACK AND TRY AGAIN"; exit();} |
| |
| $sntx = array("\"", "\\", "/", "*", "-", "=", "'", "#", ";", "<", ">", "+", "%"); |
| $_org_id = str_replace($sntx, "", $_org_id ); |
| $_org_name = str_replace($sntx, "", $_org_name ); |
| $_email_address = str_replace($sntx, "", $_email_address ); |
| |
| $content = "<html>"; |
| $subject = "Membership Tag Suggestion for " . $_org_name; |
| foreach ($_tagName_Array as &$value) |
| { |
| $query = "SELECT tag_name from TagNames where TagID = $value"; |
| $tagName = mysql_fetch_array(mysql_query($query)); |
| $content .="An Existing Tag ". $tagName[0] ." was suggested to be added to ". $_org_name ." <a href=\"https://dev.eclipse.org/committers/membership/processTag.php?type=AddExisting&tagID=". $value ."&orgID=".$_org_id."\">Process</a>\r\n</html>"; |
| } |
| |
| processMail($subject, $content, $_email_address); |
| echo "<font color=\"darkgreen\">Suggestion(s) received! Your tag suggestion(s) will appear as soon as it is reviewed for applicability, thanks for your suggestion!</font>"; |
| } |
| elseif ($_POST['submit'] == "Suggest Tag No Member") |
| { |
| $_tag_suggestion = $_POST['newTag']; |
| $_email_address = $_POST['email']; |
| |
| $_captcha = $_POST['captcha']; |
| if ($_captcha != 21) |
| { echo "BAD CAPTCHA HIT BACK AND TRY AGAIN"; exit();} |
| |
| |
| $sntx = array("\"", "\\", "/", "*", "-", "=", "'", "#", ";", "<", ">", "+", "%"); |
| $_tag_suggestion = str_replace($sntx, "", $_tag_suggestion ); |
| $_email_address = str_replace($sntx, "", $_email_address ); |
| |
| $row = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS numrows FROM TagNames where tag_name='".$_tag_suggestion."';")); |
| $tag_exists = $row['numrows'] != 0; |
| |
| if ($tag_exists) { |
| echo "<font color=\"red\">Tag Already Exists! <br> Please go back and try again. Email tags.suggest at eclipse dot org for |
| further explanation.</font>"; |
| } else { |
| $content = "<html>A new tag: ".$_tag_suggestion. " was suggested to be added. <a href=\"https://dev.eclipse.org/committers/membership/processTag.php?type=AddNewNoOrg&tagName=".$_tag_suggestion."\">Process</a>\r\n</html>"; |
| $subject = "Membership Tag Suggestion for " . $_org_name; |
| |
| processMail($subject, $content, $_email_address); |
| echo "<font color=\"darkgreen\">Suggestion received! Your tag suggestion <i>$_tag_suggestion</i> will appear as soon as it is reviewed for applicability, thanks for your suggestion!</font>"; |
| } |
| } |
| |
| if (is_null($_GET['id']) == FALSE) |
| $_input_id = $_GET['id']; |
| else |
| $_input_id = $_POST['orgID']; |
| |
| if ($_input_id != null) { |
| $sntx = array("\"", "\\", "/", "*", "-", "=", "'", "#", ";", "<", ">", "+", "%"); |
| $_input_id = str_replace($sntx, "", $_input_id ); |
| |
| $query = "SELECT name1 from organizations where organization_id = $_input_id"; |
| $result = mysql_query($query); |
| $memberName = mysql_fetch_array($result); |
| |
| $existingTagArray = existingTagPopulate($_input_id); |
| |
| $industryTagQuery = "SELECT tag_name, TagID FROM TagNames WHERE is_industry_tag = 1 OR is_project_tag = 1 ORDER BY tag_name"; |
| $industryTagResult = mysql_query($industryTagQuery); |
| $existingTagList = "Current Tags: "; |
| $first = 0; |
| while($industryTagIterator = mysql_fetch_array($industryTagResult)) |
| { |
| $tagName = $industryTagIterator['tag_name']; |
| $tagID = $industryTagIterator['TagID']; |
| if (checkExistingTags($tagID, $existingTagArray) != "checked") |
| $industryTagList .= "<input name=\"tagIDs[]\" type=\"checkbox\" value=\"$tagID\"/>". $tagName ."<br/><br/>"; |
| else |
| if ($first==0) {$first=1; $existingTagList .= $tagName;} else $existingTagList .= ", " . $tagName; |
| } |
| } |
| |
| ?> |
| |
| <h2>Suggest Tag<?=$_input_id ? "s for ".$memberName[0] : "";?></h2> |
| <p><?=$existingTagList;?></p> |
| <? if ($_input_id != "") { ?> |
| <?=displayTabs();?> |
| <table style="border: 1px solid #595791;" width="400"> |
| <tr> |
| <td> |
| <div id="addNewTag"> |
| <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> |
| <input type="hidden" name="orgID" value="<?=$_input_id;?>"/> |
| <input type="hidden" name="orgName" value="<?=$memberName[0];?>"/><br/> |
| <input type="text" name="newTag"/> Tag Suggestion<br/><br/> |
| <input type="text" name="email"/> Email Address*<br/><br/> |
| <input type="text" name="captcha"/>What is 18+3?<br/><br/> |
| <input type="submit" name="submit" value="Suggest New Tag"/><br/><br/> |
| </form> |
| </div> |
| <div id="addExistingTag" style="display:none;"> |
| <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> |
| <input type="hidden" name="orgID" value="<?=$_input_id;?>"/> |
| <input type="hidden" name="orgName" value="<?=$memberName[0];?>"/> |
| <?=$industryTagList;?> |
| <input type="text" name="email"/> Email Address*<br/><br/> |
| <input type="text" name="captcha"/>What is 18+3?<br/><br/> |
| <input type="submit" name="submit" value="Suggest Existing Tags"/><br/><br/> |
| </form> |
| </div> |
| </td> |
| </tr> |
| </table> |
| |
| <? } else { ?> |
| <p>The best way to suggest new tags is from a member page that would be associated |
| with the new tag. If you would like to do this, press "back" in your browser, browse for |
| a member organization and use the "suggest tags" link in the right nav bar on the member |
| page. Otherwise, feel free to suggest a new tag below:</p> |
| <table style="border: 1px solid #595791;" width="400"> |
| <tr> |
| <td> |
| <div id="addNewTag"> |
| <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> |
| <input type="text" name="newTag"/> Tag Suggestion<br/><br/> |
| <input type="text" name="email"/> Email Address*<br/><br/> |
| <input type="text" name="captcha"/>What is 18+3?<br/><br/> |
| <input type="submit" name="submit" value="Suggest Tag No Member"/><br/><br/> |
| </form> |
| </div> |
| </td> |
| </tr> |
| </table> |
| |
| <? } ?> |
| <p style="font-size:8pt"><b> Instructions:</b> <font color="red">If suggesting new tags, suggest only one tag at a time.</font> Tags must be alpha-numeric (spaces are permitted). If you would like to suggest the removal |
| of a tag, please email tags.suggest at eclipse dot org.</p> |
| |
| <p style="font-size:8pt">*Your Email Address is only used to process the suggestions and are subject to the terms |
| listed in our <a href="/legal/privacy.php">Privacy Policy</a>. Be careful to use a valid email address or your |
| suggestion will not be processed.</p> |
| |
| </div> |
| </div> |
| <? |
| $html = ob_get_clean(); |
| |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |