Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getSmilies($url) {
- $xml = new DOMDocument();
- $smilies = array();
- if (substr($url, 0, 7) != "http://") {
- $url = "http://" . $url;
- }
- if (substr($url, -1) != "/") {
- $url = $url . "/";
- }
- $xml->loadHTMLFile($url . 'post?mode=smilies');
- foreach ($xml->getElementsByTagName('a') as $smiley) {
- if (substr($smiley->getAttribute('href'), 0, 31) == 'javascript:insert_chatboxsmilie') {
- $img = $smiley->getElementsByTagName('img');
- $img = $img->item(0);
- $smilies[] = array('code' => substr($smiley->getAttribute('href'), 33, -2), 'img' => $img->getAttribute('src'));
- }
- }
- return $smilies;
- }
Advertisement
Add Comment
Please, Sign In to add comment