Plugin Directory

Changeset 166435


Ignore:
Timestamp:
10/23/2009 09:27:50 PM (16 years ago)
Author:
vincenzodb
Message:

fix bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • meemi-in-wordpress/trunk/meemi_in_wordpress_en.php

    r166385 r166435  
    426426            break;
    427427       
     428            }
     429         }
     430    }
     431}
     432
     433class MeemiFollowers {
     434
     435    function startElement($parser, $tagName, $attrs) {
     436        if ($this->insideitem) {
     437            $this->tag = $tagName;
     438        } elseif ($tagName == "INFO") {
     439            $this->insideitem = true;
     440           
     441            $this->name = $attrs['REAL_NAME'];
     442            $this->screen = $attrs['SCREEN_NAME'];
     443            $this->location = $attrs['LOCATION'];
     444           
     445           
     446        } elseif ($tagName == "AVATARS") {
     447            $this->avatar = $attrs['SMALL'];
     448        }
     449    }
     450
     451    function endElement($parser, $tagName) {
     452        if ($tagName == "INFO") {
     453            $n_followers = $this->followers;
     454            $n_following = $this->followings;
     455            $rname = $this->name;
     456            $sname = $this->screen;
     457            $loc = $this->location;
     458           
     459            echo "<p>My screen name is ".$sname.". I follow ".$n_following." Meemers, and ".$n_followers." follow me.<br/> My name is &egrave; ".$rname." and my current place is ".$loc."</p>\n";
     460            $this->name = "";
     461            $this->screen = "";
     462            $this->location = "";
     463            $this->followers = "";
     464            $this->followings = "";
     465            $this->insideitem = false;
     466           
     467        }
     468       
     469           
     470    }
     471
     472    function characterData($parser, $data) {
     473        if ($this->insideitem) {
     474           
     475            switch ($this->tag) {
     476                case "INFO":
     477                    $this->name .= $data;
     478                    $this->screen .= $data;
     479                    $this->location .= $data;
     480                break;
     481                case "FOLLOWERS":
     482                    $this->followers .= $data;
     483                break;
     484                case "FOLLOWINGS":
     485                    $this->followings .= $data;
     486                break;
    428487            }
    429488         }
Note: See TracChangeset for help on using the changeset viewer.