"Like" Button with ZF2 - php

Couple of weeks ago I started working with ZF2, with a new project. I need some guidance about how to implement a
feature. I want to implement a "Like" button (E.g FB like button) this button will be attach to almost all the components
like uploaded Photos, Videos, Etc.., Honestly I don't have a much idea how this should be implemented with ZF2. Can someone
put me to the correct track. I don't need to know how to code it but just need to know what path should I take what is the best way ?
Thanks,

Well, since a Facebook Button is nothing but a little Javascript-Snippet with a URL attached, all you'd have to do is to build a ViewHelper that get's the current Route or URL injected. That ViewHelper would then print out the JS Snippet and create the specific like button.
The JavaScript that is required for that would be injected using the head*()-viewHelpers.
No need to make it any more complex than that. Furthermore i see no easier solution than this, as the position of the button and the displayStatus would be different on pretty much each page.

Related

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.

Getting a discussion forum /query support on my website

I want to have a forum like thing on my website.I dont want any complicated thing, just the user must be able to post questions and the administrator(that is me) can answer them..(It would be nice if it has tree like structure but even without that it is fine) ..All the users can read the questions on the forum anytime(obvious) ..I dont want to put phpbb3 or any such readymade tool..I just want to be it simple (something like this scroll to the bottom) ..How to get this thing done..If possible in php please tell that..Otherwise tell other options..Please help me out..
You could probably do something like this in WordPress. (Your local webserver would need to be running MySQL as well as PHP to achieve this.) At the simplest level you could set up a page and allow user comments on it.
A really simple way is just to have a basic form with text-input, textarea, and submit button. Then have the person input their name, question, and submit it. Make sure you validate the form with js and/or php. Then update a password protected page that only you can access with the name and question. Then using whatever cms you have for this page (or just static html if you have the patience) you can just update the front page with the new question and answer above the form.
The best way, though, is going to be some kind of "readymade" system that you tweak...

How would I go about implementing share buttons automatically?

There are many sites that auto-generates pages with like buttons, tweet buttons, and stumbleupon buttons. My question is, how?
I'm kind of interested in the logic behind it, but if there's a code out there that makes it easy to do, I'd gladly hear it.
I do not plan for my site to be dynamic, but this automatic way of inserting share buttons can be a great lazy way to add share buttons to a page.
There is a great service called AddThis.
It also includes analytics, and works using JavaScript rather than PHP.
Search Google for tons more similar services.

Script to insert data on different domain

I am thinking about writing a script that will perform a sort of checkout procedure automatically similar to a program like Ebay snipe.
I will know what the page exactly looks like. All I really want to do is load the page from a different domain than the one that is running my script into an iframe, have jquery insert the data into the appropriate fields and then use javascript so click the submit button.
I have been reading about security issues with accessing information across different domains. On the domain I am trying to submit to I would like to call a few jquery functions such as .find() to get the id of the submit buttons so I can programatically click on them.
This might sound malicious or something which its not there is something going on sale that will sell out quick and I will not be around to click refresh one hundred times to try and buy it. I figured it would be a cool project to make a script that buys it for me.
Anyway my first question is, is this possible? Secondly, what would be the best way to solve this problem? I was going to use PHP/Javascript/Jquery. Will this even work/be allowed. Also if anyone has any other information that might help me out that would be great. Thanks.
Not going to happen... The only way I think you can accomplish this, for yourself, is by inserting your code with FireBug (or the like) on a per-use basis, or perhaps in a GreaseMonkey configuration... but it's not something that you could publish so that others would get the same functionality just by going to your page.
In Firefox, you can create a bookmark that runs JavaScript (instead of navigating to another page). So, now you can inject any javascript into your own page.
With this info, you can load jQuery from another domain along with any other scripts and automate whatever you like.
This only works for you, the person with the special bookmark, but you can hand the bookmark to others for their use.

How to make a basic Forum Thread on my website?

How to make a basic Forum Thread on my website ?
Like they click it shows the thread without going to a new page and what not.
EDIT*** Like the user he clicks something that says Thread or a Programming* and it shows all the posts and they may view that post as if it were on a whole new page without the Programming and thread just the post.
You wont be able to do this PHP only...
You can do this with JavaScript though I prefer JQuery as it makes dealing with JavaScript easier. This is a great tutorial on getting started with JQuery which covers show/hide effects (which is what you want to look at to achieve the functionality you've described.)
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
Good Luck!

Categories