How would I go about implementing share buttons automatically? - php

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.

Related

"Like" Button with ZF2

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.

Best way to create a kiosk app displaying a movie and a few contact links?

I'm trying to create a web based welcome display for a building entrance. The project would include:
1) A wmv movie play constantly on the digital display until some visitors touch the screen (this can be played either locally or on the internet, but it has to be able to go to number 2 when visitors touch the screen)
2) A couple of buttons with department names show up for visitors to choose who they are here to see
3) After the visitor touch on one button, an email is sent to the department
4) Thank you page, the site should go back to the number 1) again
My experience is html, css, php, javascript, and some Flash, but I'm open to learn new skills. Can someone please suggest some good ways to build this site? Is there any tutorials or good sites I can learn from, that would be a bonus.
Thanks very much.
Sam :)
Edit:
Thanks very much Vigrond and Lloyd! You guys' answers are equally helpful, so I'll use html5 and javascript.
I have a couple of further questions, I hope you guys or someone can help me. (Any part of questions' help is appreciated)
Since this is going to be a kiosk, the same movie is going to be played constantly, everytime after the customer has contacted us, the 'thank you' page is going to show briefly and go back to the first movie page. My question is how can I not let the movie load again and again everytime when there is a customer? Because the local data space for the display is going to be limited.
I've been thinking if I just create one page for the whole process and use a javascript slide to make each page as a div, so the movie div is going to be hiden so it doesn't need to be reloaded again, would that fix number 1) data space concern?
I'm thinking of using a horizontal slide like http://www.queness.com/post/356/create-a-vertical-horizontal-and-diagonal-sliding-content-website-with-jquery How can I make the last div (thank you) to show about 5 secs and go to the first div (movie) again?
Thanks very much! :)
This can be purely done using html5/javascript (+php for the email sending). Google Chrome also has a -kiosk mode, that will enable fullscreen.
I would probably use HTML5 video, along with something like the jQuery cycle plugin. On the video onclick handler, I would just cycle() to the next 'slide'. You can put in effects such as fadein, fadeout, slide, etc.
If you wanna get fancy, a mobile framework such as jQuery mobile or Sencha mobile may be right up your ally as well, (with aesthetic familiar interfaces and cool transitions)
beside some backend PHP to send email, this trivial app could be built using plain old HTML5, CSS and Javascript.. I wouldn't bloat it with jQuery or jQuery plug-ins unless necessary..
I don't recommend using WMV content, though - this proprietary format is not supported by any of the main browsers.. To ensure maximum browser support, encode you media using an open format like WebM:
http://www.webmproject.org/

Social Network & Dynamic vs Static pages. Where to draw the line?

As I come to the end of my project I am starting to wonder if I made it too dynamic. I have designed this social networking site and 90% of it is based on JQuery. It looks nice, it loads fast but I started to wonder if it is too dynamic...
My concern is that basically once you log in, 95% of what you do is JQuery based therefore the user never leaves the same URL. If this is true, how is a search engine like Google supposed to index my website?
Is this the part where I ask myself what parts of the site I want to be indexed and make them static pages instead?
Basically it has occurred to me that if when you browse my site for user profiles, these profiles are displayed to you through JQuery requests, then it is safe to assume that these profiles can never be found in a Google search, because the Google spider would never see it. Is this true?
Thank you for any thoughts on this,
Vini
Make your site work in both "modes". For example, I'm on my dashboard and I want to check out my friend Joe's profile, there should just be an A tag with the href set to something like "/profiles/joe".
Now, onDomReady, when the page loads, run your javascript to go through the links and attach click handers to those links, and load the profile dynamically using your existing jQuery style.
This development style is called "progressive enhancement" and allows both search engines and human accessibility devices to work better with your website. Check it out.

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.

Getting started with PHP and Expression Web

I want to build a basically interactive website with these tools. I need to make a navagation bar with a submenu. Ex:
Services
then when mouse is over Services it looks like:
Services
boo
foo
I'm familiar with adding css styles, i'm just not sure about sub menus.
On the php side of things, I want people to select from the products and write their quantities, then I'd like a paypal button at the bottom which when clicked redirects to paypal and lists products ordered and their quantities (basically the paypal checkout page)
The other thing I want is a mailing list. I want people to be able to give their name and email and have a button that sends me an email so I can add them manually.
I would appreciate insight on any or all of these topics, maybe tutorials? I think I can manage the rest of the web site on my own.
Thanks
This is too many questions at once.
Dropdown navigations can be done with HTML+CSS alone. You can also realize them with JavaScript. Since PHP is server-side, you would only generate HTML, CSS or JS from that (if at all)
If you are just getting started with PHP, you might best be off first reading the PHP manual.. At least the chapter named Language Reference. There is also this free book on PHP available.
Sitepoint is also a good resource for beginners for any of the above topics. They have many good introductory articles, a good reference and many tutorials.
As for PayPal, consult the PayPal developer site to get information on how to integrate it.
Consider trying to build the page on your own first and then come back to ask individual questions, whenever you run into problems and googling them did not help.

Categories