GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Can I get some xml parser assistance? (https://gfy.com/showthread.php?t=946014)

Waddymelon 12-31-2009 01:50 AM

Can I get some xml parser assistance?
 
Since AFF decided to add these stupid brackets to their xml feed, it broke my scripts.

Living in <![CDATA[Newport Beach]]>, <![CDATA[California]]><br>
<![CDATA[United States]]>

the damn <!CDATA[ and ]] used to not be there.... since they added it, my geo stuff isnt showing up on my pages because my parser doesnt work now.

Anybody know how to fix it? My parser has this:
Code:

    $g1 = strpos($xml, "<city>", $i);
    $g2 = strpos($xml, "</city>", $g1);
    $city = str_replace(array("<city>","</city>"), "", substr($xml, $g1, $g2 - $g1));

And of course its New Year's Eve and getting AFF help just isnt going to happen.

Waddymelon 12-31-2009 04:28 AM

I fixed it... left the parser alone and stripped the codes out in index.php

Code:

// swap listings into main template
 $template = str_replace('%listings%', $listings, $template);
 $template = str_replace('%sendurl%', $sendurl, $template);
 $template = str_replace('<![CDATA[', '', $template);
 $template = str_replace(']]>', '', $template);

 //display page
 echo $template;
}

Thanks to me, for fixing it myself.


All times are GMT -7. The time now is 12:36 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123