Tabris Daxter Posted March 10, 2012 Share Posted March 10, 2012 hey all,this is not really a LSL question but it relates to a SL project i'm working on.i'm using a free hosting company at the moment an even though it's no ads. inserted into the bottom of EVERY page is this code<!-- www.000webhost.com Analytics Code --> <script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script> <noscript><a href="http://www.hosting24.com/"><**Only uploaded images may be used in postings**://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript> <!-- End Of Analytics Code --> and it doesn't show on a webpage but it does show in SL.i'm using the example scripts from the wikikey http_request_id; default { state_entry() { http_request_id = llHTTPRequest("url", [], ""); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == http_request_id) { llSetText(body, <0,0,1>, 1); } } } and a bit of modded wiki code<?PHP // Author Waster Skronski. // General Public License (GPL). // Mind that some headers are not included because they're either useless or unreliable. $USE_APACHE_HEADERS = TRUE; // switch to false if you need cgi methods if ($USE_APACHE_HEADERS) { $headers = apache_request_headers(); $objectgrid = $headers["X-SecondLife-Shard"]; $objectname = $headers["X-SecondLife-Object-Name"]; $objectkey = $headers["X-SecondLife-Object-Key"]; $objectpos = $headers["X-SecondLife-Local-Position"]; $ownerkey = $headers["X-SecondLife-Owner-Key"]; $ownername = $headers["X-SecondLife-Owner-Name"]; $regiondata = $headers["X-SecondLife-Region"]; $regiontmp = explode ("(",$regiondata); // cut cords off $regionpos = explode (")",$regiontmp[1]); // $regionname = substr($regiontmp[0],0,-1); // cut last space from simname } else { $db = $GLOBALS; $headers = $db['HTTP_ENV_VARS']; $objectgrid = $headers["HTTP_X_SECONDLIFE_SHARD"]; $objectname = $headers["HTTP_X_SECONDLIFE_OBJECT_NAME"]; $objectkey = $headers["HTTP_X_SECONDLIFE_OBJECT_KEY"]; $ownerkey = $headers["HTTP_X_SECONDLIFE_OWNER_KEY"]; $objectpos = $headers["HTTP_X_SECONDLIFE_LOCAL_POSITION"]; $ownername = $headers["HTTP_X_SECONDLIFE_OWNER_NAME"]; $regiondata = $headers["HTTP_X_SECONDLIFE_REGION"]; $regiontmp = explode ("(",$regiondata); $regionpos = explode (")",$regiontmp[1]); $regionname = substr($regiontmp[0],0,-1); } print "\n$regiondata\n$ownername\n$ownerkey\n$ownername"; ?> Short of finding a new hosting service is there anyway in either LSL or PHP to not print the analytics code? Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted March 10, 2012 Share Posted March 10, 2012 Not really. The code is added automatically and outside the scope of your php. There are free hosters that don't add any code. Awardspace.com is one, if I remember correctly. Link to comment Share on other sites More sharing options...
Tabris Daxter Posted March 10, 2012 Author Share Posted March 10, 2012 is there a way to search through a string for characters and then delete everything after? EDIT: searching through the wiki and found Function: Left & Function: Right Link to comment Share on other sites More sharing options...
Ron Khondji Posted March 11, 2012 Share Posted March 11, 2012 Try this: body = llDeleteSubString( body, llSubStringIndex( body, "<!-- www.000webhost.com Analytics Code -->" ), -1 ); Edited to add a missing ) Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted March 11, 2012 Share Posted March 11, 2012 This method would be ok for this case - in other cases, the added code could make the result to long to get sent to SL completely. This is also the reason why I wouldn't look for the complete sub string, but would insert some marker to the end of the information you want - e.g.: print "\n$regiondata\n$ownername\n$ownerkey\n$ownername<END OF INFORMATION>"; And then in SL get the part in front of the marker: llGetSubString(body, 0, llSubStringIndex(body, "<END OF INFORMATION>")); 1 Link to comment Share on other sites More sharing options...
Tabris Daxter Posted March 11, 2012 Author Share Posted March 11, 2012 the "garbage" info already has a marker "<!--" i'm currently using the left function from the wiki. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now