FBML fb:tabs 问题

发布于 2024-09-24 18:04:56 字数 2596 浏览 1 评论 0原文

我在开发第一个 facebook api 时遇到问题,我在 api 中使用 fb:tabs。

但我遇到了一些问题。

<div>
        <fb:serverfbml style="width: 650px;">
            <script type="text/fbml">
                    <fb:fbml>
                    <fb:tabs>
                    <fb:tab-item href="http://apps.facebook.com/myapi/invite.php" title="Invite Friends" selected="true"/>
                    <fb:tab-item href="http://apps.facebook.com/myapi/inbox.php" title="inbox"/>
                    <fb:tab-item href="http://apps.facebook.com/myapi/sent.php" title="sent"/>
                    title="comm" align="right"/>
                    </fb:tabs>
                    </fb:fbml>
            </script>
        </fb:serverfbml>
        <div id="center-border">

        </div>
    </div>

我使用上面的代码来呈现选项卡。

  1. 我使用 id=“center-border” 的 div 来渲染页面的其余部分,尽管选项卡和页面内容之间出现了一个很大的间隙,当我用 fire bug 检查它时,它是 iframe。 注意:当页面的其余部分是 fb: elements inside 时,不会出现上述问题。
  2. 当在选项卡之间切换时,会出现 facebook 徽标,我必须单击它才能将我重定向到另一个选项卡。
  3. 我在每个页面都使用上面的代码来呈现选项卡,还有其他方法

更新: 我通过用实际引用替换选项卡中的链接解决了第二个问题,在我的情况下它是本地主机,如下所示:

<fb:tab-item href="http://localhost/facebook......./invite.php" title="Invite Friends" />

更新: 我又搜索了那个问题,现在我可以更清楚地重述它,我将它分成步骤以更清晰。

  1. 当像上面的代码一样使用fb:tabs时,似乎每个fb:tab-item都有自己的iframe,“href”链接在其上呈现(我猜是通过使用firebug)

  2. 当单击选项卡时,链接页面显示没有问题,问题是选项卡消失。

  3. 为了防止选项卡消失,我必须将上述代码放在每个页面上并更改所选选项卡。

  4. 选项卡栏和页面内容之间出现的间隙是选项卡的 iframe,不呈现任何内容,内容呈现在下面的“正确”iframe 中。

  5. 正如我上面提到的,当在同一个中渲染“内置”facebook 邀请页面时,不会发生问题。

  6. 我想到的解决方案之一是找到一个fb:“X”,它可以渲染一个HTML元素“例如”,这样我就可以解决这个问题,但我没有找到这样的东西。

更新: 我可以解决问题 3,通过将上面的代码放入 php 文件并在需要时包含它,我们可以像这样更改选定的选项卡:

    <?php $page = basename($_SERVER['PHP_SELF']);?>
<fb:tabs>
    <fb:tab-item href="http://localhost/facebook......./invite.php" title="Invite Friends" <?php if ($page == 'invite.php'):?>selected="true"<?php endif;?>/>
    <fb:tab-item href="http://localhost/facebook......./inbox.php" title="inbox" <?php if ($page == 'inbox.php'):?>selected="true"<?php endif;?>/>
    <fb:tab-item href="http://localhost/facebook......./sent.php" title="sent" <?php if ($page == 'sent.php'):?>selected="true"<?php endif;?>/>
</fb:tabs>

对于这篇长帖子,我深表歉意。

任何帮助将不胜感激。 提前致谢

I got a problem while developing my first facebook api, I am using fb:tabs in my api.

But I got some problems.

<div>
        <fb:serverfbml style="width: 650px;">
            <script type="text/fbml">
                    <fb:fbml>
                    <fb:tabs>
                    <fb:tab-item href="http://apps.facebook.com/myapi/invite.php" title="Invite Friends" selected="true"/>
                    <fb:tab-item href="http://apps.facebook.com/myapi/inbox.php" title="inbox"/>
                    <fb:tab-item href="http://apps.facebook.com/myapi/sent.php" title="sent"/>
                    title="comm" align="right"/>
                    </fb:tabs>
                    </fb:fbml>
            </script>
        </fb:serverfbml>
        <div id="center-border">

        </div>
    </div>

I used the above code to render tabs.

  1. I use the div with id= "center-border" to render the rest of the page, though a big gab appears between tabs and the content of the page, when I check it with fire bug it was iframe.
    note: the above problem does not appear when the rest of the page be fb: elements inside .
  2. when switching between tabs facebook logo appears, and I must click it to redirect me to the other tab.
  3. I use the above code at every page to render the tabs, is there any other ways

update:
I solved the second problems by replacing the links in tabs by actual reference in my case it was local host like that:

<fb:tab-item href="http://localhost/facebook......./invite.php" title="Invite Friends" />

update:
I searched in that problem again, now I can restate it more clearly, I will divide it to steps to be more clear.

  1. when use fb:tabs like above code it seems that each fb:tab-item has its own iframe that the "href" link is rendered on it (I guessed that by using firebug)

  2. when clicking a tab the linked page appears without problems, the problem is the tabs disappear.

  3. to prevent tabs from disappearing, I have to put the above code at every page and change the selected tab.

  4. then the gap that appears between the tabs bar and the content of the page, is the iframe of the tabs, that render no thing, and the contents are rendered in the "correct" iframe below.

  5. as I mentioned above that problem does not happen when render the "built in" facebook invite page in the same .

  6. one of the solutions that I thought of is to found a fb:"X" that can render a HTML element " for example" so that I can get around this problem, but I did not find such a thing.

update:
I could fix problem 3, by putting the above code in php file and include it when needed, we can change selected tabs like that:

    <?php $page = basename($_SERVER['PHP_SELF']);?>
<fb:tabs>
    <fb:tab-item href="http://localhost/facebook......./invite.php" title="Invite Friends" <?php if ($page == 'invite.php'):?>selected="true"<?php endif;?>/>
    <fb:tab-item href="http://localhost/facebook......./inbox.php" title="inbox" <?php if ($page == 'inbox.php'):?>selected="true"<?php endif;?>/>
    <fb:tab-item href="http://localhost/facebook......./sent.php" title="sent" <?php if ($page == 'sent.php'):?>selected="true"<?php endif;?>/>
</fb:tabs>

very sorry about the long post.

any help will be appreciated.
Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼眸印温柔 2024-10-01 18:04:56

我没有找到解决方案,但我解决了这个问题,我使用 firebug 获取面子书选项卡的本机 html 代码并将其放入 .php 文件中,并在需要时将其包含在

php 文件中

<?php $page = basename($_SERVER['PHP_SELF']);?>
<html>
    <head>
        <link href="http://static.ak.fbcdn.net/rsrc.php/z29RQ/hash/hdvsb40e.css" rel="stylesheet" type="text/css">
        <link href="http://static.ak.fbcdn.net/rsrc.php/z1LB3/hash/7zqkk7tm.css" rel="stylesheet" type="text/css">
        <link href="http://static.ak.fbcdn.net/rsrc.php/zD8FK/hash/87ukiib8.css" rel="stylesheet" type="text/css">
    </head>
    </body>
    <div class="fb_protected_wrapper" fb_protected="true">
        <div class="tabs clearfix">
            <center>
                <div class="left_tabs">
                    <ul id="toggle_tabs_unused" class="toggle_tabs">
                        <li class="first ">
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'invite.php') echo "selected";?>" href="http://localhost/facebook....../invite.php">Invite Friends</a>
                        </li>
                        <li>
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'inbox.php') echo "selected";?>" href="http://localhost/facebook....../inbox.php">inbox</a>
                        </li>
                        <li class="last ">
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'sent.php') echo "selected";?>" href="http://localhost/facebook...../sent.php">sent</a>
                        </li>

                    </ul>
                </div>
            </center>
        </div>
    </div>
    </body>
</html>

I did not find the solution, but I got around this problem, I used firebug to get the native html code for the face book tabs and put it in .php file, and include it when desired

the php file

<?php $page = basename($_SERVER['PHP_SELF']);?>
<html>
    <head>
        <link href="http://static.ak.fbcdn.net/rsrc.php/z29RQ/hash/hdvsb40e.css" rel="stylesheet" type="text/css">
        <link href="http://static.ak.fbcdn.net/rsrc.php/z1LB3/hash/7zqkk7tm.css" rel="stylesheet" type="text/css">
        <link href="http://static.ak.fbcdn.net/rsrc.php/zD8FK/hash/87ukiib8.css" rel="stylesheet" type="text/css">
    </head>
    </body>
    <div class="fb_protected_wrapper" fb_protected="true">
        <div class="tabs clearfix">
            <center>
                <div class="left_tabs">
                    <ul id="toggle_tabs_unused" class="toggle_tabs">
                        <li class="first ">
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'invite.php') echo "selected";?>" href="http://localhost/facebook....../invite.php">Invite Friends</a>
                        </li>
                        <li>
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'inbox.php') echo "selected";?>" href="http://localhost/facebook....../inbox.php">inbox</a>
                        </li>
                        <li class="last ">
                            <a onmousedown="" onclick="return true;" class="<?php if ($page == 'sent.php') echo "selected";?>" href="http://localhost/facebook...../sent.php">sent</a>
                        </li>

                    </ul>
                </div>
            </center>
        </div>
    </div>
    </body>
</html>
救星 2024-10-01 18:04:56

我建议您访问 www.facebook.com/thefanpagefactory
您会在那里找到答案。就问吧。

享受!

I suggest you go to www.facebook.com/thefanpagefactory
You will find your answer there. Just ask.

Enjoy!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文