Your SlideShare is downloading. ×
  • Like
Using Google Picasa Inside CodeIgniter
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Using Google Picasa Inside CodeIgniter

  • 4,266 views
Published

Small tutorial on how to use the Google Data API with CodeIgniter

Small tutorial on how to use the Google Data API with CodeIgniter

Published in Technology , News & Politics
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
4,266
On SlideShare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
51
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Using Google Picasa inside CodeIgniter
  • 2. Content
    What will you need
    Getting everything
    Installing everything
    The controller
    The view page
  • 3. What will we need
    Apache+PHP 4.0
    CodeIgniter
    Zend library for Google Data API
  • 4. Getting everything
    For Apache+PHP download Wamp from http://www.wampserver.com/en/
    Download the CodeIgniter framework from http://codeigniter.com/downloads/
    Do use the Google Data API download http://framework.zend.com/download/gdata/
  • 5. Setting up the libraries
    Install Wamp in a directory on a local drive
    Extract the content of the archive with the CodeIgniter framework.
    Make a directory in the www folder from Wamp called codeigniter and copy there the content of the archive
    Copy the content of the archive wich contains the Zend library for Google Data API and copy it to www/codeigniter/application/libraries
  • 6. Setting up the libraries
    wwwcodeigniter folder should be like in the left picture:
    wwwcodeignitersystem
    applicationlibraries
    end folder should be like
    in the right picture:
  • 7. The controller
    <?php
    class Picassa extends Controller {
    function Picassa(){ parent::Controller();
    }
    function index()
    {
    $data['title']='Google Picasa example'; $data['tag']='dog';
    $this->load->view('Picassa',$data);
    }
    }
    ?>
    Extindemclasa Controller din CodeIgniter
    Setamdatele custom care vorfitrimise view-ului, in view vomavea o variabila $tag siuna $title cu valorilesetateaici
    Incarcam view-ulnecesar
  • 8. The view
    Avemacces la variabilasetata din controller
    <html>
    <head>
    <title><?php echo $title; ?> </title>
    </head>
    <body>
    <?php
    set_include_path("C:wampwwwcodeignitersystemapplicationlibraries");
    require_once'ZendLoader.php';
    Zend_Loader::loadClass('Zend_Gdata_Photos');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    Zend_Loader::loadClass('Zend_Gdata_AuthSub');
    $gp = new Zend_Gdata_Photos(null,"Google-DevelopersGuide-1.0");
    $query = $gp->newQuery("http://picasaweb.google.com/data/feed/api/all");
    $query->setParam("kind", "photo");
    Spunem PHP-uluiundetrebuiesa se uitedupalibrarii
    InitializamZendGdata API
  • 9. The view
    $query->setQuery($tag);
    // maximum of 10 results
    $query->setMaxResults("10");
    $userFeed = $gp->getUserFeed(null, $query);
    foreach($userFeed as $photoEntry)
    {
    echo "<p>";
    echo "<a href='".$photoEntry->getLink('alternate')->getHref() ."'>Link album</a><br /> ";
    if ($photoEntry->getMediaGroup()->getContent() != null)
    {
    $mediaContentArray = $photoEntry->getMediaGroup()->getContent();
    $contentUrl = $mediaContentArray[0]->getUrl();
    echo "<img style='width:300px;' src='".$contentUrl."'/>";
    }
    echo "</p>";
    }
    ?>
    </body>
    </html>
    Vomobtine maxim 10 poze in urmacautarii
    Luam din variabila $tag textuldupa care facemcautarea
    Luamurl-ulimaginii