I am developing blog in codeigniter using tank authentication library(downloaded from net)
As you know blog contain like/dislike button .When click on like button(a view page) ,first control is transfer to controller where it is checked whether user is logged in or not,if user is logged in then control is transferred back to main blog page and blog is liked(ie like counter is incremented) but, if user is not logged in or is not the member of community then login/register form is displayed.
These all functionality is in-build in tank authentication library is it is working fine.
Problem: I want that if user is not logged in or is not a member ,then whichever page is displayed(login/register/forgot password/send email again),they should be opened in pop up on click of like/dislike button.
Work done: Used anchor popup function but no use. Result:It display view in new window
Placed the view of login/register form on same blog page,used jquery (fade in,fade out)etc function to display pop up. Result:pop up is displayed, but as that pop up is not coming from controller so is of no use.(as tank authentication library function are not getting envolved.)
So if possible then please help me to display view(called from controller as pop up). If possible then do send some proper links or any demo project. There is a function of jquery-fancy box,I guess that would work. I know the problem will be solved by applying concept of jquery+ mvc flow, but as I am new to php as well as codeigniter so I am not able to integrate my thoughts properly.
Thank you in advance.
Use
Fancybox
your problem will be solved. [Download] the package first. Then include theCSS
andJS
in your template.1Usage:
EDIT
Changes :
added the
fancybox
class in the link.Mandatory includes in the
<head>
section of the index page:Now in the page in the
<head>
section include this after the above includes: