English 中文(简体)
用户的现面目录,使用户能够选择可从中介绍照片的“册”。
原标题:Present facebook albums of a user and allow the user to choose the album from which, pictures will be presented

用户希望将用户的目录作为链接,然后用户可以选择在册。 这将使他改头一页,并附上具体名称的所有照片。

This is the code where the titles are presented as links. It works fine but i don t know how to make the other page work with this and present the right pictures.

$albums = $facebook->api( /me/albums );

Foreach($albums[ data ] as $album) 

{

print ( <a href= "albumPhotos.php"> .$album[ name ]. </a> . </br>  ) ;

}

当时,《守则》一文介绍了用户的所有情况。 这是法典的缩略语。

$albums = $facebook->api( /me/albums );
foreach($albums[ data ] as $album)
{

     $photos = $facebook->api("/{$album[ id ]}/photos");
     foreach($photos[ data ] as $photo)
     {
            echo "<img src= {$photo[ source ]}  />", "<br />";
     }
} 

请说一下我的劝说,一把一切! 如果有的话,请告诉我。

问题回答

In the albums summary page add a parameter ?album=album_id to the links to specific albums:

// albumsSummary.php
$albums = $facebook->api( /me/albums );    
foreach($albums[ data ] as $album)     
{
    print ( <a href= "albumPhotos.php?album_id="> .$album[ id ]. </a> . </br>  );
}

具体网页albumPhotos.php 核对<代码>album_id,参数仅显示请求的圆顶上的照片:

// albumPhotos.php
$album_id = $_REQUEST[ album_id ];
$photos = $facebook->api("/{$album[$album_id]}/photos");
foreach($photos[ data ] as $photo)
{
    echo "<img src= {$photo[ source ]}  />", "<br />";
}




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签