Fancybox with Cakephp not opening - fancybox

I am trying to implement fancybox with cakephp 2.3. Is their any other method to do so. Because I am implementing traditional way. Issue is its not working above all its not showing any error..
I am using jquery-1.9.1 version & fancybox version is 2.1.5.
I tried .. .
<script type="text/javascript">
$(document).ready(function(){
$('.various').fancybox({
openEffect : 'fade',
closeEffect : 'fade'
});
});
</script>
and cake Link is like
<?php echo $this->Html->link($enquiry['Enquiry']['name'], array('controller' => 'enquiries', 'action' => 'view', $enquiry['Enquiry']['id']), array('escape' => false, "class" => "various fancybox.ajax")); ?>
I am also using requesthandler as well of Cakephp
I am not getting any error in console but its not working as well.
I tried lower version of fancybox that is 1.3.4 that is working fine.

Related

How to adjust facebook page plugin to 100%?

I am using this facebook page plugin to integrate it to my website. However, it seems that the maximum width is only 500px. There are many advices on the internet about other plugins but not about this.
Does anyone know a workaround how to make this page plugin expand to 100% of my web page?
Actually, you can't!
As plugin page source code resides inside iframe where CSS styles are applied locally.
Moreover plugin page iframe is out of your domain/server, so you cannot modify any resources because the SOP.
See:
In some point facebook says:
The plugin will by default adapt to the width of its parent container
on page load (min. 180px / max. 500px), useful for changing layout.
So no there's any workaround, even something ugly?
Yes, there is.
It's possible fetch the response page content (from iframe url) and replace the tag whith inline CSS from 500px to 100%, like this:
<?php
$url = 'IFRAME URL GOES HERE'; #copy and paste url from iframe plugin
$http_headers = array(
'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: pt-BR,en-US;q=0.7,en;q=0.3',
);
$opener = curl_init($url);
curl_setopt_array($opener, array(
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_HTTPHEADER => $http_headers,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER => true,
CURLOPT_RETURNTRANSFER => true,
));
$content = curl_exec($opener);
curl_close($opener);
# Maybe you want to use DomDocument + DOMXPath
echo str_replace('width: 500px', 'width: 100%', $content);
However, it isn't a proper solution. If some user click over button "like", for instance, the facebook popup can't open properly, then this may be a problem.

How to build a proper link with options in a View in Zend Framework

Hi I am new in Zend Framework 1.12.
I want to build a link that simulates the same result than when I submit a form in Get method.
When I submit my form, the URL generated is mysite.com/mymodule/mycontroller/myaction?steps%5B%5D=3
How could I build that link in a View, except in that ugly way :
<a href="<?php echo $this->baseUrl('mymodule/mycontroller/myaction?steps%5B%5D=3'); ?>">
My link
</a>
May be by passing an array on something like that ?
You can try this:
$this->url(array('action' => 'myaction',
'controller' => 'mycontroller',
'module' => 'mymodule',
'steps[]' => 3));
$this->url() is a View Helper
Here a little solution to avoid the use of %5B%5D.
<a href="<?php echo $this->baseUrl('mymodule/mycontroller/myaction?'.urlencode('steps[]').'=3'); ?>">
My link
</a>

Pass value to a zend framework based application from IFrame integrated another site

I've been facing a strange problem.
I've an application based on zend framework and i need to load this application using IFrame from another domain. While loading i need to pass a value from IFrame to the application based on Zend Framework. I tried it the following way but it's not working.
It's giving Page Not Found Exception.
Created _initRouting() method at bootstrap
Integrated the application using IFrame
_initRouting()
public function _initRouting()
{
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addRoute(
'deal',
new Zend_Controller_Router_Route('/deal/:q', array(
'module' => 'default',
'controller' => 'index',
'action' => 'index'
))
);
}
IFrame Integration
<iframe src="http://www.example.com/deal/123" width="1022px" height="710px"></iframe>
Default Module->Index Controller->Index Action
public function indexAction()
{
echo $this->_request->getParam('q');
}
Cant figure out the problem. Your help would be greatly appreciated.

Facebook page post as admin using javascript api

I do lots of stuff in my javascript code for posting feed in page as m`, but how i can get permission through javascript with just one click.
This is my code.
<body>
<div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p>
<a href="javascript:;" onclick='postToFeed(); return false;'>Post to Group</a>
</p>
<p id='msg'></p>
<script>
FB.init({appId: "apid", status: true, cookie: true});
function postToFeed() {
FB.api('/page_id/feed', 'post',
{
message : "It's awesome ...",
link : 'http://csslight.com',
picture : 'http://csslight.com/application/upload/WebsitePhoto/567-grafmiville.png',
name : 'Featured of the Day',
from: 'pageid',
description : 'CSS Light is a showcase for web design encouragement, submitted by web designers of all over the world. We simply accept the websites with high quality and professional touch.'
},
function(response) {
alert(JSON.stringify(response));
});
}
</script>
</body>
Output of above script is
But i wan't to post as a BeCrazzy.com not Rajnish..!
simply, i want to post feed in page as a admin. please help me. :)
There is a tutorial here that shows you exactly how to do this:
https://developers.facebook.com/docs/howtos/login/login-as-page/
You will not be able to use the Facebook Javascript SDK to make the API call signed with the Page access token, you'll need to use something like jQuery.ajax() to do so.

Connect to Facebook with Javascript Client Library using Adobe AIR

I'm having an issue connecting to Facebook through the Javascript Client Library in Adobe AIR. It works fine in the browser but in Adobe AIR it seems to not be able to find the Facebook functions. Here is some code I copied from the Facebook website: (Oh and I have the xd_receiver.htm file in the correct path too)
<textarea style="width: 1000px; height: 300px;" id="_traceTextBox">
</textarea>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
//
var api = FB.Facebook.apiClient;
// require user to login
api.requireLogin(function(exception){
FB.FBDebug.logLevel=1;
FB.FBDebug.dump("Current user id is " + api.get_session().uid);
// Get friends list
//5-14-09: this code below is broken, correct code follows
//api.friends_get(null, function(result){
// Debug.dump(result, 'friendsResult from non-batch execution ');
// });
api.friends_get(new Array(), function(result, exception){
FB.FBDebug.dump(result, 'friendsResult from non-batch execution ');
});
});
});
//]]>
</script>
It's not that simple actually man, the problem with loading external script files from the application sandbox is that it's not supported. Technically, by using iframes, you should be able to do this and it works but it's still impossible to use XFBML in the root document after from my experience. After two days of trial and error, the easiest way to do use Facebook Connect in an html/ajax adobe air application is to download the actionscript library and include it as such:
<script type="application/x-shockwave-flash" src="lib/facebook.swf"></script>
<script type="text/javascript">
var FB = window.runtime.com.facebook;
var fb = new FB.Facebook();
var session = new FB.utils.DesktopSessionHelper();
//etc...
</script>
then just refer to the documentation. my only problem now it that I still haven't found an efficient enough way of using XFBML in adobe air, simply adding the facebook namespace to the html tag doesn't do the trick unfortunately. If any knows, please do share thanks
you also need to change xml namespace (main html tag) to this:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en-gb" lang="en-gb">