/    Sign up×
Community /Pin to ProfileBookmark

How to structure a site for social networking?

So, I have a site showcasing some of the stuff I’ve programmed, and I have a little php script on a page, that shows random images. ([URL=”http://www.neurofuzzydev.com/img/randpage.php”]this page[/URL])

I want it so that each individual image can be liked on facebook and stumbleupon. I know that it’s easy as pie to do that for a single page… but I’m confused as to how to allow that for each individual image.

I guess it’s more of a general structure question. I mean… with most websites, do they write a script to generate a page for each image, so that you have hundreds of near-identical php documents?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@lordspaceApr 02.2011 — Here are my suggestions.

Get a nice Web 2.0 button that says "Get New Image" or something similar.

People don't read much these days.

For the liking part try this code but make sure you generate PUT_THE_FULL_LINK_TO_THE_IMAGE for each image.

<i>
</i>&lt;iframe src="http://www.facebook.com/plugins/like.php?href=[B]PUT_THE_FULL_LINK_TO_THE_IMAGE[/B]&amp;amp;layout=standard&amp;amp;show_faces=false&amp;amp;width=450&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"&gt;&lt;/iframe&gt;


update: I guess the link must be urlencoded so it doesn't break the other params.
Copy linkTweet thisAlerts:
@NeuroFuzzyauthorApr 03.2011 — Ah, yeah, I probably should have a "get new image" button.

I don't want to link to "just" the image. I guess I should change the code to use $_GET with the image name passed in the url. I'll test if something like this works:

...src="http://www.facebook.com/plugins/like.php?href=http://www.neurofuzzydev.com/img/randpage.php%3F%3D.ext&amp; ...
Copy linkTweet thisAlerts:
@lordspaceApr 03.2011 — I think should not be linking to randpage.php script.

do you have another script which contains the image that was randomly displayed ?

e.g.

image.php?id=1234
×

Success!

Help @NeuroFuzzy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...