예제 #1
0
                    }
                } else {
                    // people search retrieval failed
                    echo "Error retrieving followed companies:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response) . "</pre>";
                }
                ?>
            
            <hr />
            
            <h3 id="companySuggested">Suggested Companies:</h3>

            <p>Companies that LinkedIn suggests that you follow:</p>
            
            <?php 
                $OBJ_linkedin->setResponseFormat(LINKEDIN::_RESPONSE_XML);
                $response = $OBJ_linkedin->suggestedCompanies();
                if ($response['success'] === TRUE) {
                    $suggested = new SimpleXMLElement($response['linkedin']);
                    if ((int) $suggested['count'] > 0) {
                        foreach ($suggested->company as $company) {
                            $cid = $company->id;
                            $name = $company->name;
                            ?>
                  <div style=""><span style="font-weight: bold;"><?php 
                            echo $name;
                            ?>
</span></div>
                  <div style="margin: 0.5em 0 1em 2em;">
                    <?php 
                            echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . LINKEDIN::_GET_TYPE . '=followCompany&amp;nCompanyId=' . $cid . '">Follow</a>';
                            ?>