| <?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' |
| |
| #***************************************************************************** |
| # |
| # Author: Donald Smith |
| # Date: 2005-11-11 |
| #**************************************************************************** |
| |
| # |
| # 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 |
| |
| //require_once("./scripts/dondebug.php"); |
| require_once("./scripts/db_access.php"); |
| require_once("../projects/web-api/commit-company-active-projects.php"); |
| |
| $_DEBUG = ($_GET['debug'] ? $_GET['debug'] : $_POST['debug']); |
| |
| //require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/dbconnection.class.php"); |
| //require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/dbconnection_marketplace_ro.class.php"); |
| include("lookup_exceptions.php"); |
| |
| function memberType ($_member_type) |
| { |
| if ($_member_type == "SD") |
| $retVal = "Strategic Developer"; |
| elseif($_member_type == "SC") |
| $retVal = "Strategic Consumer"; |
| elseif($_member_type == "ENTRP") |
| $retVal = "Enterprise"; |
| elseif($_member_type == "AP") |
| $retVal = "Solutions"; |
| elseif($_member_type == "AS") |
| $retVal = "Associate"; |
| return $retVal; |
| } |
| |
| // $dbc = new DBConnection(); |
| // $dbcHandle = $dbc->connect(); |
| // |
| // $dbcMarket = new DBConnectionMarket(); |
| // $dbcMarketHandle = $dbcMarket->connect(); |
| |
| $_MEMBER_ID = $_POST['member_id'] ? $_POST['member_id'] : $_GET['member_id']; |
| if(!preg_match('/^[0-9]+$/', $_MEMBER_ID)) { |
| unset($_MEMBER_ID); |
| } |
| |
| if (isset($_MEMBER_ID )) { |
| $sntx = array("\"", "\\", "/", "*", "-", "=", "'", "#", ";", "<", ">", "+", "%"); |
| $_MEMBER_ID = str_replace($sntx, "", $_MEMBER_ID ); |
| |
| |
| |
| $orgSql = "SELECT ORG.name1, ORG.member_type, ORGINFO.short_description, ORGINFO.long_description, ORGINFO.company_url |
| FROM OrganizationInformation as ORGINFO |
| INNER JOIN organizations as ORG on ORGINFO.OrganizationID = ORG.organization_id |
| WHERE ORGINFO.OrganizationID = $_MEMBER_ID and ORG.member_type in ('SD', 'SC', 'AP', 'AS', 'ENTRP')"; |
| |
| |
| $result = $App->eclipse_sql($orgSql); |
| $resultIterator = mysql_fetch_array($result); |
| $_MEMBER_NAME = $resultIterator[0]; |
| $_MEM_TYPE = $resultIterator[1]; |
| $_SHORT_DESC = $resultIterator[2]; |
| $_LONG_DESC = $resultIterator[3]; |
| $_COMPANY_URL = $resultIterator[4]; |
| |
| $_LONG_MEM_TYPE = "Eclipse " . memberType($_MEM_TYPE) . " Member"; |
| } |
| if ( $_MEMBER_NAME != "" ) { |
| $exceptions = epicException($_MEMBER_ID); |
| |
| $marketplaceQuery = "SELECT N.title, NR.teaser, CTR.field_version_value, N.nid FROM content_type_resource as CTR |
| INNER JOIN node as N on CTR.nid = N.nid |
| INNER JOIN node_revisions as NR on CTR.nid = NR.nid |
| WHERE N.status = 1 AND CTR.field_companyname_value "; |
| //$epicQuery = "SELECT pn_title, pn_cat_id, pn_description, pn_version FROM nuke_links_links WHERE pn_blocked = 0 AND pn_company "; |
| if (sizeof($exceptions) > 0) { |
| $marketplaceQuery .= "in ('$_MEMBER_NAME'"; |
| foreach($exceptions as $e) |
| $marketplaceQuery .= ", '$e'"; |
| $marketplaceQuery .= ")"; |
| } else { |
| $marketplaceQuery .= "= '$_MEMBER_NAME'"; |
| } |
| |
| $marketplaceTCQuery = "SELECT N.title, NR.teaser, N.nid, CTT.field_trainingdesc_value, CTT.field_consultingdesc_value FROM node as N |
| INNER JOIN node_revisions as NR on N.nid = NR.nid |
| INNER JOIN content_type_training as CTT on N.nid = CTT.nid |
| WHERE N.status = 1 AND N.type = 'training' AND N.title "; |
| //$epicConsultingQuery = "SELECT pn_cat_id, pn_description_training, pn_trainingurl, pn_description_consulting, pn_consultingurl FROM nuke_services_links where pn_company "; |
| if (sizeof($exceptions) > 0) { |
| $marketplaceTCQuery .= "in ('$_MEMBER_NAME'"; |
| foreach($exceptions as $e) |
| $marketplaceTCQuery .= ", '$e'"; |
| $marketplaceTCQuery .= ")"; |
| } else { |
| $marketplaceTCQuery .= "= '$_MEMBER_NAME'"; |
| } |
| if ($_DEBUG) echo $marketplaceTCQuery; |
| |
| $marketplaceResult = $App->marketplace_sql($marketplaceQuery); |
| $marketplaceTCResult = $App->marketplace_sql($marketplaceTCQuery); |
| // $epicResult = mysql_query($epicQuery, $dbcEpicHandle); |
| // $epicConsultingResult = mysql_query($epicConsultingQuery, $dbcEpicHandle); |
| |
| $MARKET_STRING = '<div class="homeitem3col" style="clear:both"><h3>' . $_MEMBER_NAME . '\'s Marketplace Listings</h3><ul>'; |
| $EPICCOUNT = 0; |
| while($marketplaceIterator = mysql_fetch_array($marketplaceResult)) |
| { |
| $EPICCOUNT++; |
| $plugin_name = $marketplaceIterator['title']; |
| $pluginid = $marketplaceIterator['nid']; |
| $plugin_short_desc = $marketplaceIterator['teaser']; |
| $plugin_short_desc = substr(strip_tags(html_entity_decode($plugin_short_desc)), 0, 250) . "..."; |
| $pluginVersion = $marketplaceIterator['field_version_value']; |
| |
| $pluginNameOutput = $plugin_name; |
| if ($pluginVersion != "") |
| $pluginNameOutput .= " v" . $pluginVersion; |
| |
| $MARKET_STRING .= '<li><a href="http://marketplace.eclipse.org/node/' . $pluginid . '">' . $pluginNameOutput . '</a>' . ' - ' . $plugin_short_desc . '</li>'; |
| } |
| while($marketplaceIterator = mysql_fetch_array($marketplaceTCResult)) |
| { |
| $EPICCOUNT++; |
| $pluginURL = $marketplaceIterator['nid']; |
| $plugin_train = $marketplaceIterator['field_trainingdesc_value']; |
| $plugin_train_trim = substr(strip_tags(html_entity_decode($plugin_train)), 0, 250) . "..."; |
| $plugin_consult = $marketplaceIterator['field_consultingdesc_value']; |
| $plugin_consult_trim = substr(strip_tags(html_entity_decode($plugin_consult)), 0, 250) . "..."; |
| |
| if ($plugin_train != "") |
| $MARKET_STRING .= |
| '<li><a href="http://marketplace.eclipse.org/node/' |
| .$pluginURL |
| .'">' . $_MEMBER_NAME . ' Training</a>' |
| . ' - ' |
| . $plugin_train_trim |
| .'</li>'; |
| if ($plugin_consult != "") |
| $MARKET_STRING .= |
| '<li><a href="http://marketplace.eclipse.org/node/' |
| .$pluginURL |
| .'">' . $_MEMBER_NAME . ' Consulting</a>' |
| . ' - ' |
| . $plugin_consult_trim |
| .'</li>'; |
| } |
| if ($EPICCOUNT == 0) |
| $MARKET_STRING .= "<br/><i style=\"font-size:smaller\">No EPIC listings found for ". $_MEMBER_NAME . "</i><br/>"; |
| $MARKET_STRING .= '</ul></div>'; |
| |
| $NORGIE_SCRIPT = '<script language="javascript">function t(i, j) { |
| var e = document.getElementById(i); |
| var f = document.getElementById(j); |
| var t = e.className; |
| if (t.match(\'invisible\')) { t = t.replace(/invisible/gi, \'visible\'); } |
| else { t = t.replace(/visible/gi, \'invisible\'); } |
| e.className = t; |
| f.className = t; |
| } </script>'; |
| |
| |
| |
| $productQuery = "SELECT * from OrganizationProducts where OrganizationID = $_MEMBER_ID"; |
| $productResult = $App->eclipse_sql($productQuery); |
| |
| $PRODUCTSCOUNT = 0; |
| $PRODUCTS_STRING = '<div class="homeitem3col" style="clear:both"><h3>' . $_MEMBER_NAME . '\'s Other Products and Services</h3><ul>';; |
| while ($productIterator = mysql_fetch_array($productResult)) |
| { |
| $PRODUCTSCOUNT++; |
| $product_name = $productIterator['name']; |
| $product_desc = $productIterator['description']; |
| $productURL = $productIterator['product_url']; |
| |
| $product_desc .= ' External Link:<a href="' . $productURL . '"><img src="/home/categories/images/homepage.gif"></a>'; |
| ob_start(); |
| ?> |
| |
| <li> |
| <div class="invisible"id="<?=$product_name;?>"><a name="<?=$product_name;?>" class="norgie" onClick="t('<?=$product_name;?>', '<?=$product_name;?>a');"></a> |
| <a class="itemtitle" name="<?=$product_name;?>"onClick="t('<?=$product_name;?>', '<?=$product_name;?>a');"><?=$product_name;?></a> |
| </div> |
| <div class="invisible" id="<?=$product_name;?>a"> |
| <div class="item_contents"> <?=$product_desc;?></div></div> |
| |
| </li> |
| <? |
| $PRODUCTS_STRING .= ob_get_clean(); |
| } |
| if ($PRODUCTSCOUNT ==0) |
| $PRODUCTS_STRING .= "<br/><i style=\"font-size:smaller\">No other product listings found for ". $_MEMBER_NAME . "</i><br/>"; |
| $PRODUCTS_STRING .= '</ul></div>'; |
| |
| $tag_sql = "SELECT TAG.tag_name, ORGTAG.TagID |
| FROM OrganizationTags as ORGTAG |
| INNER JOIN TagNames as TAG on ORGTAG.TagID = TAG.TagID |
| WHERE ORGTAG.OrganizationID = $_MEMBER_ID"; |
| $tag_result = $App->eclipse_sql($tag_sql); |
| |
| $TAGS_STRING = '<ul>'; |
| while ($tagIterator = mysql_fetch_array($tag_result)) |
| { |
| $TAGS_STRING .= '<li><a href="./showMembersWithTag.php?TagID=' . $tagIterator[1] . '">'. $tagIterator[0] . '</a></li>'; |
| } |
| |
| switch ($_MEM_TYPE) { |
| case "ENTRP": |
| $TAGS_STRING .= '<li><a href="./showMembersWithTag.php?TagID=enterprise">Other Enterprise Members</a></li>'; |
| break; |
| case "AS": |
| $TAGS_STRING .= '<li><a href="./showMembersWithTag.php?TagID=associate">Other Associates</a></li>'; |
| break; |
| case "AP": |
| $TAGS_STRING .= '<li><a href="./showMembersWithTag.php?TagID=addin">Other Solutions Members</a></li>'; |
| break; |
| default: |
| $TAGS_STRING .= '<li><a href="./showMembersWithTag.php?TagID=strategic">Other Strategics</a></li>'; |
| } |
| $TAGS_STRING .= '</ul>'; |
| |
| |
| |
| |
| $activeProjects = get_projects_this_company_is_active_on( $_MEMBER_ID ); |
| $ACTIVE_STRING = ""; |
| $HEART_STRING = ""; |
| if (sizeof($activeProjects) > 0) { |
| $ACTIVE_STRING = '<div class="homeitem3col" style="clear:both"><h3 id="projects">' . $_MEMBER_NAME . ' is an Active Contributor to the following Project(s):</h3><table width="100%" border="0" style="margin-left: 10px">'; |
| $rowcnt = round(count($activeProjects)+2 / 3); |
| for( $i = 0; $i < $rowcnt; $i += 3 ) { |
| $ACTIVE_STRING .= '<tr><td><a href="/projects/project_summary.php?projectid='. $activeProjects[$i] . '">' . $activeProjects[$i] . '</a></td>'; |
| if( $i + 1 < count($activeProjects) ) { |
| $ACTIVE_STRING .= '<td><a href="/projects/project_summary.php?projectid='. $activeProjects[$i + 1] . '">' . $activeProjects[$i + 1] . '</a></td>'; |
| } |
| if( $i + 2 < count($activeProjects) ) { |
| $ACTIVE_STRING .= '<td><a href="/projects/project_summary.php?projectid='. $activeProjects[$i + 2] . '">' . $activeProjects[$i + 2] . '</a></td>'; |
| } |
| $ACTIVE_STRING .= '</tr>'; |
| } |
| $ACTIVE_STRING .= '</table></div>'; |
| $HEART_STRING = ' |
| <div align="center"> |
| <br><img src="http://dev.eclipse.org/huge_icons/emblems/emblem-favorite.png" align="center"><br> |
| '. $_MEMBER_NAME . ' Contributes to one or more <a href="#projects">Eclipse Projects</a>! |
| </div>'; |
| |
| } |
| |
| |
| |
| |
| $moreExplore = '<li><a href="/membership/suggestTags.php?id=' . $_MEMBER_ID . '">Suggest More Tags for ' . $_MEMBER_NAME . '</a></li>'; |
| $imageHTML = '<a href="'.$_COMPANY_URL.'"><img align="left" src="./scripts/get_image.php?id='.$_MEMBER_ID . '&size=large" style="padding:5px;" alt="'.$_MEMBER_NAME.'" /></a>'; |
| } else { #MEMBER NOT FOUND |
| $_MEMBER_NAME = '<font color="red">INVALID MEMBER ID</font>'; |
| $_LONG_MEM_TYPE = ""; |
| $_MEMBER_ID = 0; |
| $TAGS_STRING = "<ul><li>No related tags</li></ul>"; |
| $_LONG_DESC = '<br>No member could be found matching that ID. There are three possible |
| reasons why this can happen: <br><ul><li>You reached |
| this page through a bad link (malformed HTML),</li> |
| <li>this organization is no longer an active member,</li> |
| <li>OR, this organization has not yet setup their membership page.</li> |
| </ul><br> |
| Please <a href="mailto:membership@eclipse.org">email us</a> if you believe this |
| is an error we can fix or better yet -- |
| <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&version=unspecified&component=Website&rep_platform=PC&op_sys=Windows%20XP&priority=P3&bug_severity=normal&bug_status=NEW&bug_file_loc=http%3A%2F%2F&short_desc=Eclipse%20Membership%20Pages%20Suggestion%20or%20Issue&comment=&commentprivacy=0&maketemplate=Remember%20values%20as%20bookmarkable%20template&form_name=enter_bug&cc=membership%40eclipse.org">open a bug</a> |
| .'; |
| } |
| |
| |
| # Paste your HTML content between the EOHTML markers! |
| $html = <<<EOHTML |
| <style> |
| .visible .item_contents { display:block; } |
| .invisible .item_contents { display: none; } |
| .visible .item_menu { display:block; } |
| .invisible .item_menu { display: none; } |
| .visible a.norgie { background: url('/home/categories/images/minus.gif') no-repeat; padding-right:2px;} |
| .invisible a.norgie { background: url('/home/categories/images/plus.gif') no-repeat; padding-right:2px;} |
| .item_menu { position:relative; left:5px;margin:10px; margin-left: 15px; padding-left: 5px; padding-bottom:5px; font-weight: bold;} |
| .item_contents { margin:10px;background-color:#F8F8F8;border:1px dashed black;padding:5px;} |
| a.norgie {float:left; clear:all;height: 20px; width: 10px; margin-top:5px; margin-bottom:-5px;} |
| .homeitem3col ul li { list-style-image:none !important; list-style-type:none;} |
| .itemtitle {color:#663366;} |
| </style> |
| $NORGIE_SCRIPT |
| <div id="maincontent"> |
| <div id="midcolumn"> |
| <h1>$_MEMBER_NAME</h1> |
| <h2>$_LONG_MEM_TYPE</h2> |
| $imageHTML |
| $_LONG_DESC |
| $MARKET_STRING |
| $PRODUCTS_STRING |
| $ACTIVE_STRING |
| </div> |
| <div id="rightcolumn"> |
| $HEART_STRING |
| <div class="sideitem"> |
| <h6>Related Tags</h6> |
| $TAGS_STRING |
| </div> |
| <div class="sideitem"> |
| <h6>Interact</h6> |
| <ul> |
| <li><a href="/membership/exploreMembership.php">Explore All Members</a></li> |
| $moreExplore |
| <li><a href="/membership/faq/editMembershipPage.php">Edit This Page</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| |
| EOHTML; |
| |
| $html = mb_convert_encoding($html, "HTML-ENTITIES", "auto"); |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |