"; while($row = mysql_fetch_array($result)) { echo ""; } }else if ($inputType == 'checkbox'){ $i = -1; while($row = mysql_fetch_array($result)) { if ($row[$field1] == "Sports Page Only") { $message = $message."".$row[$field1].""; } else if($row[$field1] == "General Release"){ $message = $message."".$row[$field1].""; } else { $i++; if (($i % 4)==0) { echo ""; } echo "".$row[$field1].""; } } echo $message; } mysql_free_result($result); } /***************************************************************************/ //get the ID value for field value or a field value for an ID value... function getID($table, $return_field, $field1, $field2) { $select = "SELECT * FROM ".$table." WHERE ".$field1." = '".$field2."'"; $result = mysql_query($select); $row = mysql_fetch_array($result); return $row[$return_field]; } /***************************************************************************/ //determine military time function calculate_military_time($hour, $minute, $AMPM) { /*do not remove the colons from this function because they are used to sparse the return value*/ /*do not remove the leading zero from the single digits numbers.*/ if ($AMPM == "PM") { if ($hour !== "12") { $hour = $hour+12; } $militaryTime = $hour.":".$minute.":00"; } else { if ($hour == "12") { $militaryTime = "00:".$minute.":00"; } else { $militaryTime = $hour.":".$minute.":00"; } } return $militaryTime; } /***************************************************************************/ //determine AMPM time from military time function calculate_AMPM_time($hour, $minute) { /*do not remove the colons from this function because they are used to sparse the return value*/ /*do not remove the leading zero from the single digits numbers.*/ if ($hour >= "12") { if ($hour == "12") { $time = $hour.":".$minute.":PM"; } else { $hour = $hour - 12; if ($hour < 10) { $hour = "0".$hour; } $time = $hour.":".$minute.":PM"; } } else { if ($hour == "00") { $hour = 12; } $time = $hour.":".$minute.":AM"; } return $time; } /***************************************************************************/ // Trim a string to specified legnth and append an end character (default = ...) function str_trim($str, $lim, $chr = '...') { // If length of string is less than $lim, return string if (strlen($str = html_entity_decode($str)) <= $lim) return $str; // Else, cut string down to size return htmlentities(substr($str, 0, $lim - 3)).$chr; } /******************************************************************************** ********************************* menu.php ************************************** ********************************************************************************/ function displayRecentReleases(){ //Connect to the database $_GET['db'] = 'releases_new'; include ('db_connect.php'); $pid=$_COOKIE['PID']; list($pid,$area)=split("\|",$pid); $sql="SELECT * FROM `release` WHERE releaseTypeID != '3' ORDER BY release.date DESC, release.post_time DESC LIMIT 15"; $result = mysql_query($sql); $numRows = mysql_num_rows($result); if ($numRows > 0) { $i = 0; while($row = mysql_fetch_array($result)) { if ($i < $numRows) { $abrv1=$abrv2=""; /*format date*/ $date = date('M j',strtotime($row['date'])); /*format time*/ $time = date('g:i a', strtotime($row['post_time'])); /*get abreviated sports*/ $select_sports="SELECT * FROM `sport_release_list` LEFT JOIN `sport` ON sport_release_list.sportID = sport.sportID WHERE sport_release_list.releaseID = '".$row['releaseID']."'"; $sports_result = mysql_query($select_sports); $sports_numRows = mysql_num_rows($sports_result); if($sports_numRows >= 3) {$abrv = "MULT";} else if ($sports_numRows == 1){ $sports_row = mysql_fetch_array($sports_result); $abrv = $sports_row['abrv']; } else{ $sports_row1 = mysql_fetch_array($sports_result); $abrv1 = $sports_row1['abrv']; $sports_row2 = mysql_fetch_array($sports_result); $abrv2 = $sports_row2['abrv']; if(($abrv1 != "SPO") && ($abrv2 != "SPO")) { $abrv = "MULT"; } else{ if($abrv1 != "SPO"){$abrv = $abrv1;} else{$abrv = $abrv2;} } } /*shorten title*/ $title = $row['title']; $tag = $row['tagline']; $title = html_entity_decode($title); echo "
"; if ($abrv1 == "SPO" || $abrv2 == "SPO") { echo "".$abrv.""; } else { echo $abrv; } echo "
"; if ($tag == "Game notes in pdf format") { echo ' '; } if ($row['isPosted'] == 3) { echo "".$title.""; } else { echo $title; } echo "
".$date." ".$time."
Edit
"; } $i++; } } else { echo "There are currently no releases in the database.";} echo ""; } /***************************************************************************/ /******************************************************************************** ********************************* post_release.php ****************************** ********************************************************************************/ //displaySports() :: for displaying the checkboxes of sports //PARAMETERS: releaseID function displaySports($releaseID){ if (is_numeric($releaseID)) { $sport = "SELECT * FROM sport"; $result1 = mysql_query($sport); $i = -1; while($row1 = mysql_fetch_array($result1)) { $i++; if (($i % 4)==0) { echo ""; } $sport_release_list = "SELECT * FROM sport_release_list WHERE sport_release_list.releaseID = ".$releaseID." AND sport_release_list.sportID = ".$row1['sportID']; $result2 = mysql_query($sport_release_list); $numRows = mysql_num_rows($result2); if ($numRows > 0) { while($row2 = mysql_fetch_array($result2)) { echo "".$row1['sport'].""; if ($row2['sport_only'] == "1") { $spo=1; } } } else { echo "".$row1['sport'].""; } } if ($spo=="1") { echo "Sports Page Only"; } else {echo "Sports Page Only";} } else { display_options('checkbox', 'sport', 'sport'); echo "Sports Page Only"; //echo ""; } } /***************************************************************************/ function displayDate($date){ if (isset($date)) { echo $date;} else {echo date("Y-m-d");} } /***************************************************************************/ function displayTime($time){ if (isset($time)) { /*get stored time*/ $post_time = explode(":", $time); $postHour = $post_time[0]; $postMin = $post_time[1]; } else { /*get current time*/ $postHour = date("H"); $postMin = date("i"); } $post_time = calculate_AMPM_time($postHour, $postMin); $post_time = explode(":", $post_time); $postHour = $post_time[0]; $postMin = $post_time[1]; $postAMPM = $post_time[2]; echo " : "; } /***************************************************************************/ function displayReleaseTypes($releaseType){ if (isset($releaseType)) { echo ""; display_options('selectbox', 'releaseType', 'type'); } else { display_options('selectbox', 'releaseType', 'type');} } /***************************************************************************/ function displayContent($content, $field){ if (isset($content)) { $content_text = $content; } else { $content_text = "

Type or paste text here.

"; } echo '
'; } /***************************************************************************/ //getLatestIssue() :: for getting the most recent issue of the magazine //NO PARAMETERS function getLatestIssue($issueID) { if (isset($issueID) && ($issueID != "0")){ $sql="SELECT * FROM issue WHERE issueID = '".$issueID."'"; }else{ $sql="SELECT * FROM issue ORDER BY issueID DESC"; } $result = mysql_query($sql); $row = mysql_fetch_array($result); echo ""; echo ""; echo "Volume ".$row['volumeNumID']." Issue ".$row['issueNumID']; } /***************************************************************************/ /******************************************************************************** ********************************* issue_home.php ******************************** ********************************************************************************/ /*code to display release type specifications*/ function displayReleases($issueID) { $select_issues = "SELECT * FROM `issue` WHERE issue.issueID = '".$issueID."'"; $issues = mysql_query($select_issues); $issue = mysql_fetch_array($issues); $test = "
"; $select_releases = "SELECT DISTINCT release.releaseID, release.title, release.content, sport_release_list.url, release.releaseType_mag, release.isPosted FROM `release` LEFT JOIN sport_release_list ON release.releaseID = sport_release_list.releaseID WHERE release.issueID = '".$issueID."' AND release.isPosted = '1' GROUP BY release.releaseID"; $releases = mysql_query($select_releases); $num_rows = mysql_num_rows($releases); if ($num_rows >= 1) { /*get magazine releases*/ $i=0; while (($release = mysql_fetch_array($releases))) { if ($release['releaseType_mag'] == "From the Editor's Desk") { $editors_desk = "

".$release['releaseType_mag']."

".$release['title']."

"; $content = stripslashes($release['content']); $content = strip_tags($content); $content = str_trim($content, 130); $content = html_entity_decode($content); $editors_desk = $editors_desk." ".$content."

"; $content = ""; }else if($release['releaseType_mag'] == "VT News and Notes"){ $news_notes = "

".$release['releaseType_mag']."

".$release['title']."

"; $content = stripslashes($release['content']); $content = strip_tags($content); $content = str_trim($content, 130); $content = html_entity_decode($content); $news_notes = $news_notes." ".$content."

"; $content = ""; }else if($release['releaseType_mag'] == "The Kroger Roth Report"){ $roth_report = "

".$release['releaseType_mag']."

".$release['title']."

"; $content = stripslashes($release['content']); $content = strip_tags($content); $content = str_replace(" "," ",$content); $content = str_trim($content, 130); $content = html_entity_decode($content); $roth_report = $roth_report." ".$content."

"; $content = ""; }else{ $other_releases = $other_releases."

".$release['releaseType_mag']."

".$release['title']."

"; $content = stripslashes($release['content']); $content = strip_tags($content); $content = str_trim($content, 130); $content = str_replace(" "," ",$content); $content = html_entity_decode($content); $other_releases = $other_releases." ".$content."

"; $content = ""; $i++; } } /*get roth report*/ /*$select_roth = "SELECT * FROM `release` LEFT JOIN sport_release_list ON release.releaseID = sport_release_list.releaseID WHERE release.releaseTypeID = '1' AND release.isPosted = '1' AND release.issueID = ".$issueID." ORDER BY release.date DESC"; $roth_result = mysql_query($select_roth); $roth_rows = mysql_num_rows($roth_result); if ($roth_rows >= 1) { $roth_report = mysql_fetch_array($roth_result); $roth = "

The Kroger Roth Report

".$roth_report['title']."

"; $content = stripslashes($roth_report['content']); $content = strip_tags($content); $content = str_trim($content, 130); $content = html_entity_decode($content); $roth_report = $roth.$content."

"; }*/ /*display releases*/ $test .= $editors_desk; $test .= $roth_report; $test .= $news_notes; $test .= $other_releases; } else { $test .= "

No releases were found for this issue.

"; } $test .= "
"; /*display inside this issue bar*/ $test .= "
"; $test .= "Download PDF :: Zoom Cover"; $test .= "
"; return $test; } /***************************************************************************/ ?> CAS Authentication wanted!

CAS Authentication wanted!

You should already have been redirected to the CAS server. Click here to continue.