Changeset 114 for scrabutility/www


Ignore:
Timestamp:
12/26/07 00:56:05 (10 years ago)
Author:
csnyder
Message:

Added lookup tool to callback url

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scrabutility/www/fb.php

    r113 r114  
    4040 
    4141// build form in FBML 
     42$version = 1; 
    4243ob_start(); 
    4344?> 
     45<!-- #<?=$version?>## --> 
    4446<form action="http://www.scrabutility.com/lookup_SOWPODS.php" method="get" target="_blank"> 
    4547<div class="label">Look up matches in the SOWPODS word list:</div> 
     
    5961$form_fbml = ob_get_clean(); 
    6062 
     63// update profile? 
     64$update = FALSE; 
     65$current = $fb->api_client->profile_getFBML( $user ); 
     66$vstart = strpos($current, '#')+1; 
     67$vend = strpos($current, '##'); 
     68$v = substr( $current, $vstart, ($vend-$vstart) ); 
     69if ( empty($v) || !is_numeric($v) || $v < $version ) { 
     70  $update = TRUE; 
     71} 
     72 
    6173// get profile url 
    6274$profile_url = $fb->get_facebook_url() . '/profile.php#a_'.$fb_appid; 
     
    6476<div style="padding: 20px;"> 
    6577<h3>Hello <fb:name uid="<?=h($user)?>" useyou="false" />,</h3> 
    66 <p>&nbsp;</p> 
     78<?if( $update ){ 
     79  $fb->api_client->profile_setFBML( $form_fbml, $user ); 
     80  ?> 
     81  <p><a href="<?=h($profile_url)?>">Your profile</a> has been updated to include the latest version of the lookup tool.</p> 
     82  <p>Happy hunting!</p> 
     83<?}?> 
    6784<table> 
    6885<tr> 
    6986<td><img src="http://www.scrabutility.com/scrabutility.png" alt="question tile" style="width: 48px; margin-right: 8px;"></td> 
    7087<td> 
    71 <p><a href="<?=h($profile_url)?>">Your profile</a> has been updated to include the handy <a href="http://www.scrabutility.com/">Scrabutility Lookup Tool</a>.</p> 
    72 <p>Happy hunting!</p></td> 
     88  <?=$form_fbml?> 
     89</td> 
    7390</tr> 
    7491</table> 
     
    7996<fb:google-analytics uacct="UA-3285066-3" /> 
    8097<? 
    81 $fb->api_client->profile_setFBML( $form_fbml, $user ); 
     98 
    8299 
    83100// EOF 
Note: See TracChangeset for help on using the changeset viewer.