Forum Replies Created
-
In case anyone googles here, the article posted by r-a-y works for different subdomains, but needs a bit of tweaking, based on this post:
Basically, we need to put the wordpress page with the adminbar only in an invisible iFrame and access its content from the parent.
To do this, first we add the iFrame to the external php / html file. Something like this works:
`
`
Next, we need to edit the `page-component.php` file, adding a head and body onload element:
`
document.domain = “site.com”
`
This sets document.domain to the same domain as we will specify in our external file. It also adds jQuery (needed for buddypress-ajax-chat on my site). Finally, it sets an onload event to tell the parent window to grab it’s content.
Next, we have to add some more javascript to the parent, along with the other links mentioned in the article above:
`document.domain=”sirimangalo.org”;
function getNav() {
var content = document.getElementById(‘bpsrc’).contentWindow.document.body.innerHTML;
document.getElementById(‘bpContainer’).innerHTML = content;
}`This sets the domain again, allowing the function to pass from the iFrame on up, and provides the function to grab the content of the source frame and output it to the “bpContainer” div.
I also use BWP-recaptcha for my other blogs on the network, so I can access the pub and priv keys from there, like so:
global $bwp_capt;
$publickey = $bwp_capt->options;and
global $bwp_capt;
$private_key = $bwp_capt->options;That way the keys are kept in one place.
The only problem I have with this is in Firefox I need to add css to put the div in the right place:
#recaptcha_widget_div {
clear:both;
}does the trick.
This code is working on my multi-site install:
Hopefully I’m not missing anything…
You could try this simple code:
Let me know if it works.
If you want a simple reCaptcha script, try this one: