The module should be assumed to be cached, so you can't do it that
way.

You can use the _IG_FetchContent call to hit your back end with a
query parameter.  Note that there is currently no way to verify that
the user ID is not spoofed.

On Nov 5, 8:05 am, ArnB <[EMAIL PROTECTED]> wrote:
> I have a PHP script that generates Javascript, used to place  band,
> promoter and regional schedules outside of an IFrame on a foreign
> website and it works on a number of websites. The script uses some
> parameters coded in the URL to select the data, then optionally
> converts the result into a Javascript function.
>
> I have it functioning in Open Social, but I need to convert the Open
> Social Account Name into the appropriate id and I can't figure it out
> how to run the script with a dynamic parameter. Meaning I need to
> change the number, shown below as 53 into something dynamic based upon
> the account name. It's easy to convert the account name, but I can
> figure out how to run the script with the dynamic id in Open Social.
>
> The way the script works: PHP script on server generates a Javascript
> function JSGetDiv, when JSGetDiv executes at onload it places HTML
> into DIV ContainerDiv, creating the schedule. I developed this when I
> was unable to adjust the Height of a foreign IFRAME to fit the content
> due to browser security restrictions.
>
> Thank you
> Arn
>
> Sample  working script with the site name and script name changed, but
> still shows how it works.
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <Module>
>   <ModulePrefs title="Event Schedule by Arnb.Org">
>         <Require feature="opensocial-0.5" />
>         <Require feature="dynamic-height"/>
>   </ModulePrefs>
> <Content type="html">
>  <![CDATA[
> <script type="text/javascript" src="http://www.foobar.org/External.php?
> B=53&amp;JS=YES"></script>
> <script type="text/javascript">
> _IG_RegisterOnloadHandler(request);
> function request() {
>   var req = opensocial.newDataRequest();
>   req.add(req.newFetchPersonRequest("VIEWER"), "viewer");
>   req.send(response);
>
> }
>
> function response(data) {
>   var viewer = data.get("viewer").getData();
>   var name = viewer.getDisplayName();
>   var thumb = viewer.getField(opensocial.Person.Field.THUMBNAIL_URL);
>   var profile = viewer.getField(opensocial.Person.Field.PROFILE_URL);
>   profile = 'http://sandbox.orkut.com'+ profile;
>   var html = '<img src="' + thumb + '"/>';
>   html+='<a href="' + profile + '" target="_top">' + name + '</a>';
>   document.getElementById('ContentDiv').innerHTML = html;
>   JSGetDiv();
>  _IG_AdjustIFrameHeight()}
>
> </script>
> <div id='ContentDiv'/>
> ]]>
> </Content>
> </Module>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to