\r\n"; return $string; } function suggested_artists($search_phrase){ $allartists=artists_array(); $rowtext=""; $rowcount=0; foreach($allartists as $ID2=>$artist2){ if((metaphone($search_phrase)==metaphone($artist2)) and $artist!=$artist2){ $rowtext.= "$artist2 \r\n"; // $rowtext.= "$artist2 - "; $rowcount++; } } if($rowcount>0){ // $returntext= "The following artists are phonetically similar to your search:
\r\n"; // $returntext.="\r\n"; $returntext= "Did you mean to search for: \r\n"; $returntext.= $rowtext."\r\n"; $returntext.= "


\r\n"; } return $returntext; } function artists_array($num=false){ if($num){ $query="SELECT ID,artist FROM `nm_artists` order by artist limit 0,$num;"; }else{ $query="SELECT ID,artist FROM `nm_artists` order by artist;"; } $numvenues=0; $result = mysql_query ($query) or die ("Query failed"); if ($row = mysql_fetch_array($result)) { do { $artistID=$row[0]; $artist=$row[1]; $artists[$artistID]=$artist; } while($row = mysql_fetch_array($result)); } return $artists; } function printarticle($id){ $query="SELECT `subject`,`titletext`,`maintext` FROM `phpnews_news` WHERE `id` =$id"; $result = mysql_query ($query) or die ("Query failed"); if ($row = mysql_fetch_array($result)) { do { $subject=$row[0]; $titletext=$row[1]; $maintext=$row[2]; $story="

$subject

\r\n$titletext\r\n$maintext\r\n"; } while($row = mysql_fetch_array($result)); } return $story; } function nm_get_news_title($id){ $query="SELECT `subject` FROM `phpnews_news` WHERE `id` =$id"; $result = mysql_query ($query) or die ("Query failed"); if ($row = mysql_fetch_array($result)) { do { $subject=$row[0]; } while($row = mysql_fetch_array($result)); } return $subject; } function nm_get_news_catname($id){ $query="SELECT `catname` FROM `phpnews_categories` WHERE `id` =$id"; $result = mysql_query ($query) or die ("Query failed - $query"); if ($row = mysql_fetch_array($result)) { do { $catname=$row[0]; } while($row = mysql_fetch_array($result)); } return $catname; } function getyear($dt) { $yr=strval(substr($dt,0,4)); return $yr; } function getmonth($dt) { if (substr($dt,5,1)==0){ $mo=strval(substr($dt,6,1)); } else { $mo=strval(substr($dt,5,2)); } return $mo; } function getday($dt) { if (substr($dt,8,1)==0){ $da=strval(substr($dt,9,1)); }else{ $da=strval(substr($dt,8,2)); } return $da; } function gethour($dt) { $hr=strval(substr($dt,11,2)); return $hr; } function getminute($dt) { $mi=strval(substr($dt,10,2)); return $mi; } function getsecond($dt) { $se=strval(substr($dt,12,2)); return $se; } function nm_musicweek_events_tabletable($day,$month,$year,$profile,$venue,$artistID){ $whereclause=""; $whereclause.="WHERE 1 "; if($day!=""){ $whereclause.="and day=$day "; } if($month!=""){ $whereclause.="and month=$month "; } if($year!=""){ $whereclause.="and year=$year "; } if($profile!=""){ $whereclause.="and artistID=$profile "; $printvenue=true; } if($artistID!=""){ $whereclause.="and artistID=$artistID "; $printvenue=true; $printdate=true; } if($venue!=""){ $whereclause.="and venue='$venue' "; } $text= ""; $menus= "
\r\n"; $menus.= "
\r\n"; $menus.= "Sunday - \r\n"; $menus.= "Monday - \r\n"; $menus.= "Tuesday - \r\n"; $menus.= "Wednesday - \r\n"; $menus.= "Thursday - \r\n"; $menus.= "Friday - \r\n"; $menus.= "Saturday\r\n"; $menus.= "
\r\n"; $menus.= "Wheeler Place - \r\n"; $menus.= "Mayfield Hotel - \r\n"; $menus.= "Lucky Country

\r\n"; $menus.= "
\r\n"; $text.= "

Newcastle Music Week 2003

\r\n"; // $text.= "
\r\n"; if($venue=="" and $day=="" and $profile=="" and $artistID==""){ $wholelist=true; } $text.= $menus; if($day==""){ // $text.="

October 26th to November 1st 2003

\r\n"; } $venueold="dummy"; $dayold="dummy"; if($wholelist){ $query="SELECT `ID` , `musicweek_profileID` , `name` , `venue` , `date` , `day` , `month` , `year` , `start_hour` , `start_minute` , `finish_hour` , `finish_minute` , `mysql_start_time` , `musql_finish_time` , `unix_start_time` , `unix_finish_time`,`artistID` FROM `musicweek_events` ORDER BY `name` , `date`, `venue`;"; $text.= "
\r\n"; $text.=""; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; }else{ $query="SELECT `ID` , `musicweek_profileID` , `name` , `venue` , `date` , `day` , `month` , `year` , `start_hour` , `start_minute` , `finish_hour` , `finish_minute` , `mysql_start_time` , `musql_finish_time` , `unix_start_time` , `unix_finish_time`,`artistID` FROM `musicweek_events` $whereclause ORDER BY `venue`,`date`,`start_hour`,`start_minute` ;"; $text.= "
\r\n"; if($venue!=""){ $text.= "

$venue

\r\n"; } if($day!=""){ $text.= "

".nm_formatted_date($day,$month,$year)."

\r\n"; } if($artistID!=""){ // $text.= "

".nm_getartist($artistID)."

\r\n"; } } $result = mysql_query ($query) or die ("snippet Query failed $query"); $numrows=mysql_num_rows($result); if ($row = mysql_fetch_array($result)) { do { $profileID=$row[1]; $profilename=htmlentities($row[2]); $eventvenue=$row[3]; $eventdate=$row[4]; $eventday=$row[5]; $eventmonth=$row[6]; $eventyear=$row[7]; $start_hour=$row[8]; $start_minute=$row[9]; $finish_hour=$row[10]; $finish_minute=$row[11]; $mysql_start_time=$row[12]; $mysql_finish_time=$row[13]; $unix_start_time=$row[14]; $unix_finish_time=$row[15]; $nm_artistID=$row[16]; $display_start_minute=str_pad($start_minute,2,"0", STR_PAD_LEFT); if($start_hour>12){ $display_start_hour=$start_hour-12; $startsuffix="PM"; }elseif($start_hour==0){ $display_start_hour=12; $startsuffix="AM"; }else{ $display_start_hour=$start_hour; $startsuffix="AM"; } if($eventvenue!=$venueold and $day!=""){ // $text.= "
\r\n"; $text.= "
\r\n"; $text.= "
\r\n"; // $text.= "
\r\n"; $text.= "

$eventvenue

\r\n"; } if($eventday!=$dayold and $venue!=""){ // $text.= "
\r\n"; $text.= "
\r\n"; $text.= "
\r\n"; // $text.= "
\r\n"; // $text.= "

\r\n"; // $text.= "$eventvenue

\r\n"; $text.= "

\r\n"; $text.= nm_formatted_date($eventday,$eventmonth,$eventyear)."

\r\n"; } if($wholelist){ $text.="
\r\n"; if($nm_artistID!=0){ $text.="\r\n"; }else{ // $text.="\r\n"; $text.="\r\n"; } $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; // $text.="\r\n"; // $text.="\r\n"; // $text.="\r\n"; // $text.="\r\n"; $text.="\r\n"; }else{ if($nm_artistID!=0){ $text.="$profilename\r\n"; }else{ // $text.="$profilename\r\n"; $text.="$profilename\r\n"; } if($printdate){ $text.=" - ".nm_formatted_date($eventday,$eventmonth,$eventyear)."\r\n"; } $text.=" - $display_start_hour:$display_start_minute $startsuffix\r\n"; if($printvenue){ $text.=" - $eventvenue\r\n"; } $text.="
\r\n"; } $venueold=$eventvenue; $dayold=$eventday; } while($row = mysql_fetch_array($result)); } if($wholelist){ $text.="

Artist

Venue

Date

Start Time

$profilename$profilename$profilename$eventvenue".nm_formatted_date($eventday,$eventmonth,$eventyear)."$display_start_hour:$display_start_minute $startsuffix$profilename$eventvenue".nm_formatted_date($eventday,$eventmonth,$eventyear)."$display_start_hour:$display_start_minute $startsuffix
\r\n"; }else{ } $text.= "
\r\n"; // $text.="
"; // $text.= "
\r\n"; // $text.= "
\r\n"; $text.= $menus; $text.="
"; $text.="
For more information see: "; $text.="http://www.newcastlemusicweek.com/
"; $text.="
"; $text.=""; return $text; } function nm_musicweekeventsforartist($ID){ $query="SELECT `ID` , `musicweek_profileID` , `name` , `artistID` , `venue` , `venueID` , `date` , `day` , `month` , `year` , `start_hour` , `start_minute` , `finish_hour` , `finish_minute` , `mysql_start_time` , `musql_finish_time` , `unix_start_time` , `unix_finish_time` FROM `musicweek_events` WHERE `artistID` = $ID order by `date`;"; // $text="

Song List

"; $result = mysql_query ($query) or die ("snippet Query failed $query"); $numrows=mysql_num_rows($result); $text=""; $artist_name=nm_getartist($ID); if ($row = mysql_fetch_array($result)) { // $text.="
"; //

Events for $artist_name

$text.="
"; $text.= "

Newcastle Music Week 2003

\r\n"; $text.="
"; $text.="
"; $text.="$artist_name is performing during Newcastle Music Week 2003.


\r\n"; do { $musicweek_profileID=$row[1]; $venue=$row[4]; $date=$row[6]; $day=$row[7]; $month=$row[8]; $year=$row[9]; $start_hour=$row[10]; $start_minute=$row[11]; $display_start_minute=str_pad($start_minute,2,"0", STR_PAD_LEFT); if($start_hour>12){ $display_start_hour=$start_hour-12; $startsuffix="PM"; }elseif($start_hour==0){ $display_start_hour=12; $startsuffix="AM"; }else{ $display_start_hour=$start_hour; $startsuffix="AM"; } if($venue=="Wheeler Place"){ $showbox=TRUE; // $text.="
Venue: $venue
\r\n"; // $text.="Date: ".nm_formatted_date($day,$month,$year)."
\r\n"; $text.="
Venue: $venue
\r\n"; $text.="Date: ".nm_formatted_date($day,$month,$year)."
\r\n"; $text.="Time: $display_start_hour:$display_start_minute $startsuffix
\r\n"; $text.="
\r\n"; $text.="
\r\n"; if($description){ // $text.=" - $description"; } } } while($row = mysql_fetch_array($result)); // $text.="View the $artist_name Profile at the Newcastle Music Week Information Site

\r\n"; $text.="
For more information see:
"; $text.="
"; $text.="
"; $text.="
"; if($showbox){ return $text; }else{ return false; } }else{ return false; } } function nm_mp3list($artistID=""){ $query="SELECT `ID` , `filename` , `title` , `artist` , `album` , `year` , `description` , `genre` , `filesize` , `length` , `MPEGVersion` , `bitrate` , `frequency` , `mode` , `frames` , `original` FROM `mp3` WHERE artistID=$artistID;"; // $text="
$query

Song List

"; $result = mysql_query ($query) or die ("snippet Query failed $query"); $numrows=mysql_num_rows($result); if ($row = mysql_fetch_array($result)) { $text= "

MP3's by ".nm_getartist($artistID)."

\r\n"; $text.=""; do { $filename=$row[1]; $title=$row[2]; $artist=$row[3]; $album=$row[4]; $year=$row[5]; $description=$row[6]; $genre=$row[7]; $filesize=$row[8]; $length=$row[9]; $version=$row[10]; $bitrate=$row[11]; $frequency=$row[12]; $mode=$row[13]; $frames=$row[14]; $original=$row[15]; $text.="\r\n"; // $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; // $text.="\r\n"; $text.="\r\n"; $text.="\r\n"; // $text.="\r\n"; // $text.="\r\n"; // $text.="\r\n"; $text.="\r\n"; if($description){ // $text.=" - $description"; } } while($row = mysql_fetch_array($result)); $text.="
$title$artist$year$album$genre$filesize$length$version$bitrate$frequency$mode$frames$original
"; } return $text; } function maketextlink(){ if($_SERVER["QUERY_STRING"]!=""){ $currentURL='http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?".htmlentities($_SERVER["QUERY_STRING"]); }else{ $currentURL='http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; } $dashfile=strrchr ( $currentURL, "/"); $textURL = str_replace($dashfile, $temparray[host]."/text".$dashfile, $currentURL) ; return $textURL; } function nm_contact(){ $bodytext=""; // $bodytext.="

If you would like to suggest a new link to be included in the Directory please use the form provided on the Link Submission Page

\r\n"; $bodytext.="

If you have any comments or suggestions about this site, or if you would like to update any of the information in the directory please use the contact details below.

\r\n"; $bodytext.="

\r\n"; $bodytext.="
\r\n"; // $bodytext.=" Contact Details:

\r\n"; $bodytext.=" Email: contact@newcastlemusic.net\r\n"; $bodytext.="
\r\n"; // $bodytext.=" Phone: (+61) 0407 280 127
\r\n"; $bodytext.="
\r\n"; $bodytext.=" Newcastle Music Directory
\r\n"; $bodytext.=" PO Box 985
\r\n"; $bodytext.=" Newcastle 2300
\r\n"; $bodytext.=" NSW
\r\n"; $bodytext.=" Australia
\r\n"; $bodytext.="

\r\n"; $bodytext.="
\r\n"; return $bodytext; } function nm_about(){ global $lastupdated; $bodytext="

The Newcastle Music Directory has gradually grown in size to become a unique resource for the local music community. This site aims to showcase the music of the Hunter Region and provide a comprehensive index of thousands of websites that highlight musical diversity of the region.

\r\n"; // $bodytext.="

The directory is run on a non-profit basis and is maintained by Andrew Goodwin who began the compiling the database in 1999 while studying at the University of Newcastle. Andrew is a keen musician and has performed in many bands over the past 10 years including Pursuit, The Fables, Ivy, The Fables Duo (Brothers Grimm), Benign and more recently in Irish Folk/Rock band Erin.

\r\n"; $bodytext.="

The following is a brief timeline outlining the project's major milestones:

\r\n"; $bodytext.=" \r\n"; // $bodytext.="

The directory was last updated on $lastupdated.

\r\n"; // $bodytext.="

The Newcastle Music Directory is maintained by Andrew Goodwin.

\r\n"; $bodytext.=" Contact Details
\r\n"; // $bodytext.=" Privacy Policy
\r\n"; // $bodytext.=" Legal Disclaimer
\r\n"; // $bodytext.="

All links on this site are checked every 6 to 8 weeks to see whether they still exist. Dead links are removed from the database however if you discover a link that leads you to a page that no longer exists please let me know.

\r\n"; // $bodytext.="

The pages on this site are generated using the PHP scripting language. The data uses live data stored in a MySQL database.

\r\n"; /* $bodytext.="
\r\n"; $bodytext.="
\r\n"; $bodytext.=" \r\n"; // $bodytext.=" \r\n"; $bodytext.=" \r\n"; $bodytext.=" \r\n"; // $bodytext.=" \r\n"; $bodytext.="
\"Viewable\"Powered\"Powered\"Valid
\r\n"; $bodytext.="
\r\n"; */ $bodytext.="
\r\n"; return $bodytext; } function nm_artisthasrelatedartists($ID){ $articlesquery = "SELECT COUNT(ID) FROM `nm_artist_relationships` where `artistID`=$ID and `related_artist_ID`<>0;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $numrelatedartists=$articlesrow[0]; } while($articlesrow = mysql_fetch_array($articlesresult)); } return $numrelatedartists; } function nm_NBlink($ID){ $articlesquery = "SELECT nbID,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $nbID=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($nbID<>0){ $linktext="

View this artists profile at newcastlebands.com"; } return $linktext; } function nm_NBid($ID){ $articlesquery = "SELECT nbID,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $nbID=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($nbID<>0){ return $nbID; }else{ return false; } } function nm_mp3_com_au_link($ID){ $articlesquery = "SELECT mp3_com_au_id,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $mp3_com_au_id=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($mp3_com_au_id<>0){ $linktext="

View this artists profile at mp3.com.au "; } return $linktext; } function nm_mp3_com_au_id($ID){ $articlesquery = "SELECT mp3_com_au_id,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $mp3_com_au_id=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($mp3_com_au_id<>0){ return $mp3_com_au_id; }else{ return false; } } function nm_jjj_unearthed_link($ID){ $articlesquery = "SELECT jjj_unearthed_ID ,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $jjj_unearthed_ID=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($jjj_unearthed_ID<>0){ $linktext="

Triple J Unearthed - First Round"; } return $linktext; } function nm_new_jjj_unearthed_link($ID){ $articlesquery = "SELECT new_jjj_unearthed_ID ,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $new_jjj_unearthed_ID=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($new_jjj_unearthed_ID<>0){ $linktext="

View this artists entries in Triple J Unearthed"; } return $linktext; } function nm_myspace_link($ID){ $articlesquery = "SELECT myspace_name ,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $myspace_name=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($myspace_name){ $linktext="

View this artists profile at www.myspace.com/$myspace_name"; } return $linktext; } function nm_garageband_com_link($ID){ $articlesquery = "SELECT garageband_com_name ,artist FROM `nm_artists` where `ID`=$ID;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $garageband_com_name=$articlesrow[0]; $artist=$articlesrow[1]; } while($articlesrow = mysql_fetch_array($articlesresult)); } if($garageband_com_name){ $linktext="

View this artists profile at www.garageband.com/$garageband_com_name"; } return $linktext; } function nm_artists_indexed_links($ID){ $query = "SELECT `ID` ,`artist`, `nbID` , `mp3_com_au_id` , `myspace_name` , `garageband_com_name` , `new_jjj_unearthed_ID` , `myspace_friendID` , `brackets_and_jam_ID` , `soundclick_bandID` , `purevolume_name` , `wikipedia_entry` , `songwriters_live_ID` , `whatsoncentralcoast_filename` , `amo_profile_ID` FROM `nm_artists` where `ID`=$ID;"; $result = mysql_query ($query) or die ("snippet Query failed $query".mysql_error()); if ($row = mysql_fetch_array($result)) { do { $artistID=$row[0]; $artist=$row[1]; $nbID=$row[2]; $mp3_com_au_id=$row[3]; $myspace_name=$row[4]; $garageband_com_name=$row[5]; $new_jjj_unearthed_ID=$row[6]; $myspace_friendID=$row[7]; $brackets_and_jam_ID=$row[8]; $soundclick_bandID=$row[9]; $purevolume_name=$row[10]; $wikipedia_entry=$row[11]; $songwriters_live_ID=$row[12]; $whatsoncentralcoast_filename=$row[13]; $amo_profile_ID=$row[14]; } while($row = mysql_fetch_array($result)); } $linktext.="
\r\n"; if($nbID<>0){ $linktext.="
View this artists profile at newcastlebands.com"; } if($mp3_com_au_id<>0){ $linktext.="

View this artists profile at mp3.com.au "; } if($new_jjj_unearthed_ID<>0){ $linktext.="

View this artists entries in Triple J Unearthed"; } if($myspace_name){ $linktext.="

View this artists profile at www.myspace.com/$myspace_name"; } if($garageband_com_name){ $linktext.="

View this artists profile at www.garageband.com/$garageband_com_name"; } if($brackets_and_jam_ID){ $linktext.="

View this artists profile at bracketsandjam.com"; } if($purevolume_name){ $linktext.="

View this artists profile at purevolume.com/$purevolume_name"; } if($wikipedia_entry){ $linktext.="

View this artists Wikipedia Entry"; } if($songwriters_live_ID<>0){ $linktext.="

View this artists bio at Songwriters Live"; } if($whatsoncentralcoast_filename){ $linktext.="

View this artists page at whatson-centralcoast.com.au"; } if($amo_profile_ID){ $linktext.="

View this artists page at www.amo.org.au"; } if($soundclick_bandID){ $linktext.="

View this artists page at soundclick.com"; } return $linktext; } function nm_relatedartists_snippet($ID){ $articlesquery = "SELECT `ID` , `artistID` , `related_link_ID` , `related_artist_ID` , `title` , `type` , `description` FROM `nm_artist_relationships` WHERE `artistID`=$ID and `related_artist_ID`<>0 ORDER BY `title`;"; // $text="$articlesquery"; $text="

Related Artists

"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $related_artist_ID=$articlesrow[3]; $title=$articlesrow[4]; $type=$articlesrow[5]; $description=$articlesrow[6]; $text.="$title"; if($description){ $text.=" - $description"; } $text.="

"; } while($articlesrow = mysql_fetch_array($articlesresult)); } return $text; } function nm_artisthasrelatedlinks($ID){ $articlesquery = "SELECT COUNT(ID) FROM `nm_artist_relationships` where `artistID`=$ID and `related_link_ID`<>0;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $numrelatedlinks=$articlesrow[0]; } while($articlesrow = mysql_fetch_array($articlesresult)); } return $numrelatedlinks; } function nm_relatedlinks_snippet($ID){ $articlesquery = "SELECT `ID` , `artistID` , `related_link_ID` , `related_artist_ID` , `title` , `type` , `description` FROM `nm_artist_relationships` WHERE `artistID`=$ID and `related_link_ID`<>0 ORDER BY `title`;"; // $text="$articlesquery"; $text="

Related Links

"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $related_link_ID=$articlesrow[2]; $title=$articlesrow[4]; $type=$articlesrow[5]; $description=$articlesrow[6]; $text.="$title"; if($description){ $text.=" - $description"; } $text.="

"; } while($articlesrow = mysql_fetch_array($articlesresult)); } return $text; } function te_artistsnippet($ID,$numchars=150){ $articlesquery = "SELECT `content` FROM `te_articles` where `artistID`=$ID ORDER BY `eventdate`;"; $articlesresult = mysql_query ($articlesquery) or die ("snippet Query failed $articlesquery"); $numrows=mysql_num_rows($articlesresult); $count=1; if ($articlesrow = mysql_fetch_array($articlesresult)) { do { $content[$count]=htmlentities($articlesrow[0],ENT_QUOTES); $newcontent[$count] = substr($content[$count], 0, $numchars); $revnewcontent=strrev($newcontent[$count]); $space=" "; $lastplace=strstr($revnewcontent, $space); $newcontent[$count] = strrev($lastplace); $contentstring=str_replace("\r\n", " ", "$newcontent[$count]"); $snippet="$contentstring ..."; } while($articlesrow = mysql_fetch_array($articlesresult)); } return $snippet; } function nm_artistsletter($letter){ if($letter=="0-10"){ $query="SELECT nm_artists.ID, nm_artists.artist, nm_artists.linkID, nm_artists.tearticle, nm_artists.foldername, nm_links.linkurl, nm_links.linktitle, nm_links.description, nm_artists.category, nm_artists.description FROM (nm_artists LEFT JOIN nm_links ON nm_artists.linkID = nm_links.linkid) WHERE ((nm_artists.artist) NOT LIKE 'A%') AND ((nm_artists.artist) NOT LIKE 'B%') AND ((nm_artists.artist) NOT LIKE 'C%') AND ((nm_artists.artist) NOT LIKE 'D%') AND ((nm_artists.artist) NOT LIKE 'E%') AND ((nm_artists.artist) NOT LIKE 'F%') AND ((nm_artists.artist) NOT LIKE 'G%') AND ((nm_artists.artist) NOT LIKE 'H%') AND ((nm_artists.artist) NOT LIKE 'I%') AND ((nm_artists.artist) NOT LIKE 'J%') AND ((nm_artists.artist) NOT LIKE 'K%') AND ((nm_artists.artist) NOT LIKE 'L%') AND ((nm_artists.artist) NOT LIKE 'M%') AND ((nm_artists.artist) NOT LIKE 'N%') AND ((nm_artists.artist) NOT LIKE 'O%') AND ((nm_artists.artist) NOT LIKE 'P%') AND ((nm_artists.artist) NOT LIKE 'Q%') AND ((nm_artists.artist) NOT LIKE 'R%') AND ((nm_artists.artist) NOT LIKE 'S%') AND ((nm_artists.artist) NOT LIKE 'T%') AND ((nm_artists.artist) NOT LIKE 'U%') AND ((nm_artists.artist) NOT LIKE 'V%') AND ((nm_artists.artist) NOT LIKE 'W%') AND ((nm_artists.artist) NOT LIKE 'X%') AND ((nm_artists.artist) NOT LIKE 'Y%') AND ((nm_artists.artist) NOT LIKE 'Z%') AND (((nm_artists.local)=1)) ORDER BY nm_artists.artist;"; }else{ $query="SELECT nm_artists.ID, nm_artists.artist, nm_artists.linkID, nm_artists.tearticle, nm_artists.foldername, nm_links.linkurl, nm_links.linktitle, nm_links.description, nm_artists.category, nm_artists.description FROM (nm_artists LEFT JOIN nm_links ON nm_artists.linkID = nm_links.linkid) WHERE ((nm_artists.artist) Like '$letter%') AND (((nm_artists.local)=1)) ORDER BY nm_artists.artist;"; } $numartists=0; $result = mysql_query ($query) or die ("Query failed: $query"); if ($row = mysql_fetch_array($result)) { // echo "
\r\n"; echo "
\r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; // echo " \r\n"; echo " \r\n"; echo " \r\n"; do { $numartists++; $artistID=$row[0]; $artist=$row[1]; $linkID=$row[2]; $tearticle=$row[3]; $foldername=$row[4]; $url=$row[5]; $link_title=$row[6]; $link_description=$row[7]; $catID=$row[8]; $link_description=$row[9]; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; echo " \r\n"; // echo " \r\n"; echo " \r\n"; echo " \r\n"; } while($row = mysql_fetch_array($result)); echo "
\r\n"; echo "

Artists: ".strtoupper($letter)."

\r\n"; // echo "

Artist or Band

\r\n"; echo "
\r\n"; echo "

Description

\r\n"; echo "
\r\n"; echo "

Website

\r\n"; echo "
\r\n"; echo "

TE Articles

\r\n"; echo "
\r\n"; echo "

Newcastle Music Awards

\r\n"; echo "
\r\n"; // echo "

2003 Music Week Performance

\r\n"; // echo "
\r\n"; echo "

Category

\r\n"; echo "
\r\n"; echo " $artist\r\n"; /* if($artist!=""){ if($url!="" and $tearticle!=1){ echo " $artist\r\n"; }elseif($tearticle==1){ echo " $artist\r\n"; }else{ echo " $artist\r\n"; } } */ // echo " $artist\r\n"; echo "

\r\n"; if($link_description!=""){ echo "$link_description\r\n"; }elseif($tearticle==1){ // echo te_artistsnippet($artistID,200); echo " \r\n"; }else{ echo " \r\n"; } echo "

\r\n"; if($url){ echo " Website\r\n"; // echo " www\r\n"; // echo " www\r\n"; }else{ echo "  \r\n"; } // echo "
\r\n"; echo "
\r\n"; if($tearticle==1){ $numarticles=te_getnumarticlesforartist($artistID); // echo te_printarticlelinksforartist($artistID); if($numarticles==1){ echo " ".$numarticles." Article\r\n"; }else{ echo " ".$numarticles." Articles\r\n"; } }else{ echo "  \r\n"; } echo " \r\n"; $numawardsentries=nm_count_awards_entries($artistID); if($numawardsentries>1){ echo $numawardsentries." Entries"; }elseif($numawardsentries==1){ echo $numawardsentries." Entry"; }else{ echo " "; } echo " \r\n"; // if(nm_musicweekeventsforartist($artistID)){ // echo "\r\n"; // echo "
Yes
\r\n"; // }else{ // echo " \r\n"; // } // echo "

\r\n"; if($newlink){ echo "(NEW!)\r\n"; } if($catID==4){ // echo "Original Bands\r\n"; echo "Original Band\r\n"; } if($catID==3){ // echo "Solo Artists\r\n"; echo "Solo Artist\r\n"; } if($catID==24){ // echo "Bands\r\n"; echo "Bands\r\n"; } if($catID==25){ // echo "Duos\r\n"; echo "Duo\r\n"; } if($catID==8){ // echo "Band\r\n"; echo "Band\r\n"; } echo " \r\n"; echo "
\r\n"; echo "
\r\n"; echo "
\r\n"; echo "
\r\n"; } } function nm_artistsletter3($letter){ if($letter=="0-10"){ $query="SELECT nm_artists.ID, nm_artists.artist, nm_artists.linkID, nm_artists.tearticle, nm_artists.foldername, nm_links.linkurl, nm_links.linktitle, nm_links.description, nm_artists.category, nm_artists.description FROM (nm_artists LEFT JOIN nm_links ON nm_artists.linkID = nm_links.linkid) WHERE ((nm_artists.artist) NOT LIKE 'A%') AND ((nm_artists.artist) NOT LIKE 'B%') AND ((nm_artists.artist) NOT LIKE 'C%') AND ((nm_artists.artist) NOT LIKE 'D%') AND ((nm_artists.artist) NOT LIKE 'E%') AND ((nm_artists.artist) NOT LIKE 'F%') AND ((nm_artists.artist) NOT LIKE 'G%') AND ((nm_artists.artist) NOT LIKE 'H%') AND ((nm_artists.artist) NOT LIKE 'I%') AND ((nm_artists.artist) NOT LIKE 'J%') AND ((nm_artists.artist) NOT LIKE 'K%') AND ((nm_artists.artist) NOT LIKE 'L%') AND ((nm_artists.artist) NOT LIKE 'M%') AND ((nm_artists.artist) NOT LIKE 'N%') AND ((nm_artists.artist) NOT LIKE 'O%') AND ((nm_artists.artist) NOT LIKE 'P%') AND ((nm_artists.artist) NOT LIKE 'Q%') AND ((nm_artists.artist) NOT LIKE 'R%') AND ((nm_artists.artist) NOT LIKE 'S%') AND ((nm_artists.artist) NOT LIKE 'T%') AND ((nm_artists.artist) NOT LIKE 'U%') AND ((nm_artists.artist) NOT LIKE 'V%') AND ((nm_artists.artist) NOT LIKE 'W%') AND ((nm_artists.artist) NOT LIKE 'X%') AND ((nm_artists.artist) NOT LIKE 'Y%') AND ((nm_artists.artist) NOT LIKE 'Z%') AND (((nm_artists.local)=1)) ORDER BY nm_artists.artist;"; }else{ $query="SELECT nm_artists.ID, nm_artists.artist, nm_artists.linkID, nm_artists.tearticle, nm_artists.foldername, nm_links.linkurl, nm_links.linktitle, nm_links.description, nm_artists.category, nm_artists.description FROM (nm_artists LEFT JOIN nm_links ON nm_artists.linkID = nm_links.linkid) WHERE ((nm_artists.artist) Like '$letter%') AND (((nm_artists.local)=1)) ORDER BY nm_artists.artist;"; } $numartists=0; $result = mysql_query ($query) or die ("Query failed: $query"); if ($row = mysql_fetch_array($result)) { echo "

Artists : $letter

\r\n"; echo " \r\n"; echo "
\r\n"; echo "
\r\n"; } } function nm_artistslinks(){ $linklist="
\r\n"; // $linklist.="Artists : \r\n"; $linklist.="Original Bands : \r\n"; $linklist.="Solo Artists : \r\n"; $linklist.="Duos : \r\n"; $linklist.="Bands\r\n"; // $linklist.="Orchestras\r\n"; $linklist.="
\r\n"; return $linklist; } function nm_articlelinks(){ $linklist="
\r\n"; $linklist.="1998 : \r\n"; $linklist.="1999 : \r\n"; $linklist.="2000 : \r\n"; $linklist.="2001 : \r\n"; $linklist.="2002 : \r\n"; $linklist.="2003\r\n"; $linklist.="
\r\n"; return $linklist; } function nm_catlist(){ $catlist=""; global $global_base_url; $catlist.="

Link Categories

\r\n"; $catlist.="\r\n"; return $catlist; } function nm_newlinklist(){ if($cat!=3 and $cat!=4 and $cat!=24 and $cat!=25){ $query="SELECT DISTINCTROW nm_links.linkid, nm_links.linkurl, nm_links.linktitle, nm_links.keywords, nm_links.description, nm_links.newlink, nm_link_mappings.catID FROM nm_links INNER JOIN nm_link_mappings ON nm_links.linkid = nm_link_mappings.linkID WHERE (((nm_links.newlink)=1)) ORDER BY -nm_links.linkid;"; $numlinks=0; $result = mysql_query ($query) or die ("Query failed $query"); if ($row = mysql_fetch_array($result)) { echo "

Newest Links

\r\n"; echo ""; } } echo "
\r\n"; } function nm_newartistlist(){ $query="SELECT `ID` , `artist` , `linkID` , `tearticle` , `foldername` , `local` , `category` , `description` FROM `nm_artists` where local=1 ORDER BY -`ID` LIMIT 0 , 20"; $numlinks=0; $result = mysql_query ($query) or die ("Query failed $query"); if ($row = mysql_fetch_array($result)) { echo "

Recently Added Artists

\r\n"; echo ""; } // echo "
\r\n"; } function nm_wordpress_linklist($cat){ $query="SELECT `link_id` , `link_url` , `link_name` , `link_description` FROM `wordpress_links` WHERE `link_category` =$cat ORDER BY `link_name`;"; $numlinks=0; $result = mysql_query ($query) or die ("Query failed"); if ($row = mysql_fetch_array($result)) { if($cat!=7){ echo "

".nm_getcatname($cat)."

"; } echo ""; } if($cat==15){ // echo nm_letterbar($letter); echo "
"; // echo "

Radio Programs

"; echo nm_wordpress_linklist(16); // echo "
\r\n"; // echo "
\r\n"; // echo "

See Also

\r\n"; // echo nm_linklist(7); } $returnstring.="Artists : \r\n"; echo "
\r\n"; } function nm_linklist($cat){ if($cat!=3 and $cat!=4 and $cat!=24 and $cat!=25){ $query="SELECT DISTINCTROW nm_links.linkid, nm_links.linkurl, nm_links.linktitle, nm_links.keywords, nm_links.description, nm_links.newlink, nm_link_mappings.catID FROM nm_links INNER JOIN nm_link_mappings ON nm_links.linkid = nm_link_mappings.linkID WHERE (((nm_link_mappings.catID)=$cat)) ORDER BY nm_links.linktitle;"; $numlinks=0; $result = mysql_query ($query) or die ("Query failed"); if ($row = mysql_fetch_array($result)) { if($cat!=7){ echo "

".nm_getcatname($cat)."

"; } echo ""; } } if($cat==4){ // echo nm_letterbar($letter); echo "

".nm_getcatname($cat)."

"; echo nmlinklist2(4); echo "
\r\n"; echo "
\r\n"; echo "

See Also

\r\n"; echo nm_linklist(7); } if($cat==3){ // echo nm_letterbar($letter); echo "

".nm_getcatname($cat)."

"; echo nmlinklist2(3); echo "
\r\n"; echo "
\r\n"; echo "

See Also

\r\n"; echo nm_linklist(7); } if($cat==24){ // echo nm_letterbar($letter); echo "

".nm_getcatname($cat)."

"; echo nmlinklist2(24); echo "
\r\n"; echo "
\r\n"; echo "

See Also

\r\n"; echo nm_linklist(7); } if($cat==25){ // echo nm_letterbar($letter); echo "

".nm_getcatname($cat)."

"; echo nmlinklist2(25); echo "
\r\n"; echo "
\r\n"; echo "

See Also

\r\n"; echo nm_linklist(7); } if($cat==15){ // echo nm_letterbar($letter); echo "
"; // echo "

".nm_getcatname(16)."

"; echo nm_linklist(16); // echo "
\r\n"; // echo "
\r\n"; // echo "

See Also

\r\n"; // echo nm_linklist(7); } $returnstring.="Artists : \r\n"; echo "
\r\n"; } function nmlinklist2($cat){ if($cat){ $query="SELECT nm_artists.ID, nm_artists.artist, nm_artists.linkID, nm_artists.tearticle, nm_artists.foldername, nm_links.linkurl, nm_links.linktitle, nm_links.description, nm_artists.category, nm_links.newlink FROM (nm_artists LEFT JOIN nm_links ON nm_artists.linkID = nm_links.linkid) WHERE ((nm_artists.category) =$cat) ORDER BY nm_artists.artist;"; } $numartists=0; $result = mysql_query ($query) or die ("Query failed: $query"); if ($row = mysql_fetch_array($result)) { // echo "