Facebook App: User should first click like button to use the app - php

I have seen this in many apps where user is first asked to click like button and then redirected to the main app. How can I achieve this?
I am using php.
Adding a like button on top of the app pages doesn't attracts much likes.
Any help is appreciated!
-Sandy

There are so many solution already for this. Basically you just need a javascript script to hide the main page , and a php script to show the page so that until the user cliks like, then you show it.
A simple searching gave alot of code.
check this ones on stack, or this one and also, this one
Basically, you have to use jquery to hide the page
hope this helps!

Related

How do I find out that a link was seen

I'm trying to make a page with some links and when somebody clicks on a link, the score count will go up.
How can I find out the visitor who has really seen the page related to link? But not just click the link and close the page for score...
really seen means: page loads completed.
and my links opens in new window.
any solution?
You cant really see pages that aren't in the same domain. Chrome even puts them in a separate thread.
Back in the day you could have used a CSS exploit talked about here: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector
If you really want to make a page with this kind of functionality you will have to make a browser plugin/extension.
You can include a nonce token in the link, and post that token to the server, render the page embedding that same token in some javascript and have the javascript post back the token when the page is done rendering. Seems kinda overkill though.
The only thing I could thing of is maybe make the link to like a redirect page on your site and then you could control to see if the page was loaded and then like after the page was loaded redirect to the actual webpage to link is intended. This way you know for sure that the user waited to view the webpage.
Other than that I don't think there is any other way for you to go about this.

Lightbox in php to show information in pop-up

I'm Developing an application, that have several Pages for the application. And In it i thought to Say one information in it, it the user like to proceed means they can continue or can drop that..
Now i have query like,..
<input type="Button" onclick="window.open(myPage.php)" target="_blank" value="Guess It..!"/>
It opens a new page for showing the Data,.. Its looking good. But just now i came to knew about the Lightbox functionality in PHP with javascript. I Heard that it will perform my process in the Same page without disturbing the Previous one, it came as pop-up and after completing its Process we can close and continue our previous process..
I Hope i will help to my user to work easily without any confusion with the New Tab Open option, now i'm searching for the lightbox Tutorial, anybody suggest me for the Best tutorial or examples..
I think you shuuld look at Fancybox. Good documentation, easy to use, you can dynamic load content, images etc.
There is also tutorial and documentation.
http://fancybox.net/
Download and use this fancy box..This will be easy for you to implement and customize based on reqs.
For using it, refer http://fancybox.net/howto.
Hope it helps.

Link comment box to facebook page?

I got a really stupid question. But I'm in the startup-fase of integrating a webpage with Facebook.
My question is if a Facebook page has a App-id? If that's the case, how can I find it?
What I'm trying to do is add multiple comment-plugins and would like them to be linked to my page. Perhaps even so that the comments appears on the pages wall.
Thanks in advance!
If you are the admin of the page you can get the page ID.
Go to your page, click Edit Page then Update info (not sure if these are the terms cause I use FB in portuguese language).
The URL in the adress bar tells you the ID. Its the number between 'id=' and the '&' symbol. Lets say it's 1234567890. Copy it.
Now, in a comment just write #[1234567890:Name of the Page]. Submit your comment and see what happens.
Hope that helps.
A facebook page doesnt have an ID, you need to register a new app for your page.
You can create an app here

Facebook More Button on the Wall

I would like to create a more button similar to facebook that loads more items on the wall.
Could someone please advice on how I could get this working in PHP. Could you please point me to a resource or let me know a way how I can acheive this.
I think what you seek is called an infinite scroller.
Check out this tutorial on how to create an infinite scrolling gallery on PHP. This one doesn't have the "more" button, it loads more content automatically every time you scroll the page down to the bottom. But it's easy enough to adapt it to work with a "more" button.
Edit: here's another tutorial, this time with the button.

problem with ajax( page refresh)

hi im using ajax to extract all the pages into the main page but am not being able to control the refresh , if somebody refreshes the page returns back to the main page can anybody give me any solutions , i would really appreciate the help...
you could add anchor (#something) to your URL and change it to something you can decode to some particular page state on every ajax event.
then in body.onload check the anchor and decode it to some state.
back button (at least in firefox) will be working alright too. if you want back button to work in ie6, you should add some iframe magic.
check various javascript libraries designed to support back button or history in ajax environment - this is probably what you really need. for example, jQuery history plugin
You can rewrite the current url so it gives pointers to where the user was - see Facebook for examples of this.
I always store the 'current' state in PHP session.
So, user can refresh at any time and page will still be the same.
if somebody refreshes the page returns back to the main page can anybody give me any solutions
This is a feature, not a bug in the browser. You need to change the URL for different pages. Nothing is worse then websites that use any kind of magic either on the client side or the server side which causes a bunch of completely different pages to use the same URL. Why? How the heck am I gonna link to a specific page? What if I like something and want to copy & paste the URL into an IM window?
In other words, consider the use cases. What constitutes a "page"? For example, if you have a website for stock quotes--should each stock have a unique URL? Yes. Should you have a unique URL for every variation you can make to the graph (i.e. logarithmic vs linear, etc)? Depends--if you dont, at least provide a "share this" like google maps does so you can have some kind of URL that you can share.
That all said, I agree with the suggestion to mess with the #anchor and parse it out. Probably the most elegant solution.

Categories