Jump to content

tommyinnn

Members
  • Posts

    35
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

tommyinnn's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi! I have built a type of website builder and wanted to allow my clients to goto their domain provider and enter custom nameservers. My question is how would I go about doing this? Currently the only solution is for my clients to set up domain forwarding with masking, which works great but not all domain providers offer this feature and it needs to be done the right way as I have spent a lot of time on this project. As this is not web hosting, just a sitebuilder I have developed, my only gold is to get the clients domain in the URL field, Here is the default (demo) link a client gets http://demo.32oneweb.com Here is the same site with domain masking (using GODaddy's domain forwarding with masking option) http://2k22day.com/ How can I set it up so clients enter some custom nameservers I would set up so I can do the same thing as with the domain masking option? Sorry I am very inexperienced with web servers, thanks for any help anyone can provide!
  2. yes thanks guys that was the problem, I moved the echo line up till it worked and was able to locate the problem, which as the variable $id, it was already being used in the members end of the script, changed it from $id to $num and it's fine, thanks again gristoi & Chud37!
  3. Does any1 know what would cause this problem? Here is the url www.mysite.com/profile.php?id=1447835&state=AL&firstname=TOM&lastname=ANDERSON When I try to echo the id, only 6 numbers appear, the 7th is stripped for some reason <? echo ($_GET["id"]); ?> would print 144783 if I change the $ID to 123456789 it will only echo 123456
  4. Sir thank you for your reply however this works 100% on a different server -- do you know what could be the difference, what can I install to correct this? The $tmp[2] missing means there is no title for the mp3 (uses last.fm api) - so what happens is when there is no title, nothing displays, when the mp3 does have a title in it's tag, all 4 items display (album artwork, title, artist and album)
  5. Hello, my script worked great with no errors until I had to migrate to a new server, which is using cpanel/WHM, I have run Apache update and ensured curl is installed but I keep getting this in the error log. Here is part of the code, the error is PHP Notice: Undefined offset: 2 in /home/username/public_html/control/ajax/actions/currently_playing.php on line 59 and here is that section of code (line 59 is labled) // Diaplays when sever is online but no song title } else { $title = str_replace('\'', '`', $split[6]); $title = str_replace(',', ' ', $title); $title = "$title"; // Diaplays song } } if($title) { $tmp = explode(" - ", $title); $artist = trim(str_replace("`", "'", $tmp[0])); $album = trim(str_replace("`", "'", $tmp[1])); $title = trim(str_replace("`", "'", $tmp[2])); //LINE 59 HERE $request = $this->albumGetInfo($artist, $album); $img = $request["album"]["image"][1]["#text"];
  6. WOW, that did it -- thank you so much -- ....you said "Yes, but ANY errors in ANY part of the XML file will cause a parser to fail" , that explains a lot ... you said, "Yes, but ANY errors in ANY part of the XML file will cause a parser to fail" , this also explains a lot, I have always hear other's complain about Shoutcast coding, everyone always said it was "messy coding", but to me Shoutcast seems to run well, very stable -- but now I can understand what this means "messy coding" Thanks again xyph!
  7. xyph -- there would not be any odd charters in this at all, it is the IP address I am after not the song title -- the special charters you were looking at were were mp3 titles.
  8. Thanks xyph -- been working on this for a while but still no luck, getting these errors Warning: fopen(http://98.158.187.150:9998/admin.cgi?mode=viewxml&pass=PASSWORDHERE) [function.fopen]: failed to open stream: HTTP request failed! ICY 404 Resource Not Found in /home/jockey/public_html/control/test.php on line 3 Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in /home/user/public_html/control/test.php on line 11 No listeners
  9. Thanks xyph! -- that is the SHOUTcast DNAS --- http://98.158.187.150:9998/ http://98.158.187.150:9998/admin.cgi?pass=<PASSWORD> Add mode=viewxml for xml view http://98.158.187.150:9998/admin.cgi?mode=viewxml&pass=<PASSWORD> I have sent you a PM with the full link with password if you want to take a look
  10. Sure - thanks so much for your help guys! <SHOUTCASTSERVER> <CURRENTLISTENERS>2</CURRENTLISTENERS> <PEAKLISTENERS>3</PEAKLISTENERS> <MAXLISTENERS>100</MAXLISTENERS> <REPORTEDLISTENERS>2</REPORTEDLISTENERS> <AVERAGETIME>64</AVERAGETIME> <SERVERGENRE>pop, hip hop, rap</SERVERGENRE> <SERVERURL>http://2k22day.com</SERVERURL> <SERVERTITLE> 2K22day.com - Playing the HOTTEST HITS from 2000 till 2day! </SERVERTITLE> <SONGTITLE>Benzino - Redemption - Rock the Party</SONGTITLE> <SONGURL/> <IRC>N/A</IRC> <ICQ>N/A</ICQ> <AIM>N/A</AIM> <WEBHITS>34563</WEBHITS> <STREAMHITS>705</STREAMHITS> <STREAMSTATUS>1</STREAMSTATUS> <BITRATE>64</BITRATE> <CONTENT>audio/mpeg</CONTENT> <VERSION>1.9.8</VERSION> <WEBDATA> <INDEX>9563</INDEX> <LISTEN>0</LISTEN> <PALM7>9589</PALM7> <LOGIN>0</LOGIN> <LOGINFAIL>21</LOGINFAIL> <PLAYED>9440</PLAYED> <COOKIE>0</COOKIE> <ADMIN>3</ADMIN> <UPDINFO>708</UPDINFO> <KICKSRC>0</KICKSRC> <KICKDST>0</KICKDST> <UNBANDST>0</UNBANDST> <BANDST>0</BANDST> <VIEWBAN>0</VIEWBAN> <UNRIPDST>0</UNRIPDST> <RIPDST>0</RIPDST> <VIEWRIP>0</VIEWRIP> <VIEWXML>5226</VIEWXML> <VIEWLOG>0</VIEWLOG> <INVALID>13</INVALID> </WEBDATA> <LISTENERS> <LISTENER> <HOSTNAME>50.9.81.180</HOSTNAME> <USERAGENT>MPEG OVERRIDE</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>49</CONNECTTIME> <POINTER>0</POINTER> <UID>703</UID> </LISTENER> <LISTENER> <HOSTNAME>173.132.159.43</HOSTNAME> <USERAGENT> WAFA/1.1.1 (Linux; Android 2.3.3; Winamp) Replicant/1.0 </USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>3</CONNECTTIME> <POINTER>1</POINTER> <UID>704</UID> </LISTENER> </LISTENERS> <SONGHISTORY> <SONG> <PLAYEDAT>1311786625</PLAYEDAT> <TITLE>Benzino - Redemption - Rock the Party</TITLE> </SONG> <SONG> <PLAYEDAT>1311786315</PLAYEDAT> <TITLE>Young Jeezy - The Recession - My President`s Black</TITLE> </SONG> <SONG> <PLAYEDAT>1311786076</PLAYEDAT> <TITLE>Mike Jones - The American Dream - Drop & Gimme 50</TITLE> </SONG> <SONG> <PLAYEDAT>1311785862</PLAYEDAT> <TITLE>Lil Flip - Undaground Legend - Game Over</TITLE> </SONG> <SONG> <PLAYEDAT>1311785660</PLAYEDAT> <TITLE>T.i. - Paper Trail - I`m the King</TITLE> </SONG> <SONG> <PLAYEDAT>1311785380</PLAYEDAT> <TITLE>Nelly (Ft Kelly Rowland) - Dilemma - Dilemma</TITLE> </SONG> <SONG> <PLAYEDAT>1311785328</PLAYEDAT> <TITLE>Ludacris - Release Therapy - What`s Your Fantasy</TITLE> </SONG> <SONG> <PLAYEDAT>1311784888</PLAYEDAT> <TITLE> Justin Timberlake - FutureSex / LoveSounds - What Goes Around </TITLE> </SONG> <SONG> <PLAYEDAT>1311784635</PLAYEDAT> <TITLE>Snoop Dogg - Ego Trippin` - Life Of Da Party</TITLE> </SONG> <SONG> <PLAYEDAT>1311784359</PLAYEDAT> <TITLE>The Game - The Documentary - Dreams</TITLE> </SONG> </SONGHISTORY> </SHOUTCASTSERVER>
  11. Here is what the xml file looks like, this has a single listener <SHOUTCASTSERVER> <CURRENTLISTENERS>1</CURRENTLISTENERS> <PEAKLISTENERS>3</PEAKLISTENERS> <MAXLISTENERS>100</MAXLISTENERS> <REPORTEDLISTENERS>1</REPORTEDLISTENERS> <AVERAGETIME>92</AVERAGETIME> <SERVERGENRE>pop</SERVERGENRE> <SERVERURL>http://stationname.com</SERVERURL> <SERVERTITLE> 2K22day.com - Playing the HOTTEST HITS ! </SERVERTITLE> <SONGTITLE> Young Jeezy - Let`s Get It: Thug Motivation 101 (CD & DVD) - Trap or Die </SONGTITLE> <SONGURL/> <IRC>N/A</IRC> <ICQ>N/A</ICQ> <AIM>N/A</AIM> <WEBHITS>31884</WEBHITS> <STREAMHITS>692</STREAMHITS> <STREAMSTATUS>1</STREAMSTATUS> <BITRATE>64</BITRATE> <CONTENT>audio/mpeg</CONTENT> <VERSION>1.9.8</VERSION> <WEBDATA> <INDEX>8839</INDEX> <LISTEN>0</LISTEN> <PALM7>8861</PALM7> <LOGIN>0</LOGIN> <LOGINFAIL>21</LOGINFAIL> <PLAYED>8718</PLAYED> <COOKIE>0</COOKIE> <ADMIN>3</ADMIN> <UPDINFO>640</UPDINFO> <KICKSRC>0</KICKSRC> <KICKDST>0</KICKDST> <UNBANDST>0</UNBANDST> <BANDST>0</BANDST> <VIEWBAN>0</VIEWBAN> <UNRIPDST>0</UNRIPDST> <RIPDST>0</RIPDST> <VIEWRIP>0</VIEWRIP> <VIEWXML>4791</VIEWXML> <VIEWLOG>0</VIEWLOG> <INVALID>11</INVALID> </WEBDATA> <LISTENERS> <LISTENER> <HOSTNAME>50.8.81.170</HOSTNAME> <USERAGENT>MPEG OVERRIDE</USERAGENT> <UNDERRUNS>0</UNDERRUNS> <CONNECTTIME>1</CONNECTTIME> <POINTER>0</POINTER> <UID>691</UID> </LISTENER> </LISTENERS> <SONGHISTORY> <SONG> <PLAYEDAT>1311770828</PLAYEDAT> <TITLE> Young Jeezy - Let`s Get It: Thug Motivation 101 (CD & DVD) - Trap or Die </TITLE> </SONG> <SONG> <PLAYEDAT>1311770536</PLAYEDAT> <TITLE>Lil Wayne - Tha Carter III - Lollipop</TITLE> </SONG> <SONG> <PLAYEDAT>1311770302</PLAYEDAT> <TITLE>OutKast - Speakerboxxx/ The Love Below - Hey Ya</TITLE> </SONG> <SONG> <PLAYEDAT>1311770084</PLAYEDAT> <TITLE>Young Jeezy - The Recession - Who Dat</TITLE> </SONG> <SONG> <PLAYEDAT>1311769865</PLAYEDAT> <TITLE>Jim Jones - Pray IV Reign - We Fly High (Ballin`)</TITLE> </SONG> <SONG> <PLAYEDAT>1311769630</PLAYEDAT> <TITLE>Lupe Fiasco - The Cool - Hip-Hop Saved My Life</TITLE> </SONG> <SONG> <PLAYEDAT>1311769428</PLAYEDAT> <TITLE>Rick Ross - Port of Miami - Push It</TITLE> </SONG> <SONG> <PLAYEDAT>1311769112</PLAYEDAT> <TITLE>T.i. - Paper Trail - Swagger like us</TITLE> </SONG> <SONG> <PLAYEDAT>1311768886</PLAYEDAT> <TITLE>Mya - Fear of Flying - Case of the Ex</TITLE> </SONG> <SONG> <PLAYEDAT>1311768717</PLAYEDAT> <TITLE> Three 6 Mafia - Most Known Unknown - Poppin My Collar </TITLE> </SONG> </SONGHISTORY> </SHOUTCASTSERVER>
  12. I changed the first line to $subject = $shoutcast_data['hostname']; and that displayed 81. 81 180 xyph -- did not display anything
  13. Thank you AyKay -- I did try this, and even searched for "multidimensional array php" -- never heard about it. Basically (I've deleted a lot of the code, but this will give you a idea how it works) ---- The script pulls the xml $shoutcast_httpreq = "GET /admin.cgi?pass=$shoutcast_password&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"; Then phases it -- $shoutcast_data = array('streamstatus' => '', 'currentlisteners' => '', 'maxlisteners' => '', 'useragent' => '', 'underruns' => '', 'connecttime' => '', 'pointer' => '', 'uid' => '', 'hostname' => ''); $shoutcast_xml = ""; Then prints it out foreach($files as $file){ $xml = simplexml_load_file($file); XMLToArrayFlat($xml, $xmlarray, $file.':', true); } echo '<h1>'; echo $shoutcast_data['hostname'];
  14. Can someone please help me with this code? I think this would need to be a foreach command - but not sure It's for Shoutcast, it displays the IP address of each listener - it works but I need to split the IP's up $shoutcast_data['hostname'] --- this displays each Ip address, but without line break, I need to split them up Have tried echo $shoutcast_data['hostname'] . '<br>'; But it lists the address as 56.49.987.5687.564.34.55 I need 56.49.987.56 87.564.34.55 Have tried several foreach examples also with no luck, it that what I need to be looking at? Thanks for any help! Here is the complete code if any1 wants it. <?php error_reporting(0); define ("DEBUG", "0"); $shoutcast_host = '<IP ADDRESS HERE>'; // SHOUTcast station url $shoutcast_port = '<PORT HERE>'; // SHOUTcast station port number $shoutcast_password = '<PASSWORD HERE>'; // SHOUTcast password $shoutcast_url = "http://" . $shoutcast_host . ':' . $shoutcast_port . "/listen.pls"; $fsock_time_out = 1; $fsock_error_number = 0; $fsock_error_text = ""; $shoutcast_data = array('streamstatus' => '', 'currentlisteners' => '', 'maxlisteners' => '', 'useragent' => '', 'underruns' => '', 'connecttime' => '', 'pointer' => '', 'uid' => '', 'hostname' => ''); $shoutcast_xml = ""; global $shoutcast_data, $shoutcast_xml_element; if (!function_exists('startElement')) { function startElement($parser, $name, $attrs) { global $shoutcast_xml_element; // track which xml element is being parsed $shoutcast_xml_element = strtolower($name); } } if (!function_exists('endElement')) { function endElement($parser, $name) { global $shoutcast_xml_element; // forget which xml element was being parsed $shoutcast_xml_element = ''; } } if (!function_exists('handleData')) { function handleData($parser, $data) { global $shoutcast_data, $shoutcast_xml_element; $shoutcast_data[$shoutcast_xml_element] .= $data; } } if (!function_exists('defaultHandler')) { function defaultHandler($parser, $data) {} } $shoutcast_fp = fsockopen($shoutcast_host, $shoutcast_port, $fsock_error_number, $fsock_error_text, $fsock_time_out); if($shoutcast_fp) { // socket connection is established, so the station is on-line // set 1 second timeout for communication with the station // stream_set_timeout($shoutcast_fp, 1); // build a string containing an HTTP request to your SHOUTcast server $shoutcast_httpreq = "GET /admin.cgi?pass=$shoutcast_password&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"; // send HTTP request to shoutcast server fputs($shoutcast_fp, $shoutcast_httpreq); // read entire xml output stream while(!feof($shoutcast_fp)) { $shoutcast_xml .= fgets($shoutcast_fp, 1000); } // close the socket now we no longer need it fclose($shoutcast_fp); // if we have got some XML back then we need to strip away some // stuff that we don't need if ($shoutcast_xml != '') $shoutcast_xml = strstr($shoutcast_xml, '<SHOUTCASTSERVER>'); // create an instane of the EXPAT XML parser $xml_parser = xml_parser_create(); // set element start and end element handler functions xml_set_element_handler($xml_parser, 'startElement', 'endElement'); // set character data handler function xml_set_character_data_handler($xml_parser, 'handleData'); xml_set_default_handler($xml_parser, 'defaultHandler'); // activate the XML parser $parsed = xml_parse($xml_parser, $shoutcast_xml, 1); // some debugging code if (DEBUG) { echo $shoutcast_xml; print_r ($shoutcast_data); } // check that the parsing operation worked correctly if ($parsed) { // it worked, so report the station status if ($shoutcast_data['streamstatus'] == '1') { foreach($files as $file){ $xml = simplexml_load_file($file); XMLToArrayFlat($xml, $xmlarray, $file.':', true); } echo '<p>Current listeners: '; echo $shoutcast_data['currentlisteners']; echo ' (only '; echo $shoutcast_data['maxlisteners']; echo ' allowed).</p>'; echo '<BR>'; echo '<BR>'; echo '<p>IP: '; echo $shoutcast_data['hostname']; echo '<BR>'; echo $shoutcast_data['currentlisteners']; echo '<BR>'; echo $shoutcast_data['useragent']; echo '<BR>'; echo $shoutcast_data['underruns']; echo '<BR>'; echo $shoutcast_data['connecttime']; echo '<BR>'; echo $shoutcast_data['pointer']; echo '<BR>'; echo $shoutcast_data['uid']; echo '</p>'; if (intval($shoutcast_data['currentlisteners']) < intval($shoutcast_data['maxlisteners'])) { } else { } } else { // no streaming content is available } } else { // parsing failed if (DEBUG) { echo 'XML Parser reported the following error:' . '<br />'; echo xml_error_string(xml_get_error_code($xml_parser)) . ' in line '; echo xml_get_current_line_number($xml_parser) . '<br />'; } } // the xml parser is no longer required xml_parser_free($xml_parser); } else { // socket connection could not be established echo '<p>The station is offline.</p>'; } ?>
  15. LOL - yes, it is hugh! As you guys can tell, I am not a php expert, but passing simple variables is the basics, while VIciDial is a amazing script - it is kinda hard for me to understand many parts of it - It must be installed on a dedicated server - or VPS (I'm running it on Linux) - not your average php script at all. There is no css file either, and for some reason, if I try and copy/paste that single line of working code on the line below it - the entire app fails. I'm not giving up - may be for the day but I am gonna work on this in the morning some more - I can't let it beat me!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.