Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
dynamic favicon from anchors
Old 07-14-2011, 12:03 AM dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
I want to put the little favicon next to all my A's on my site. I'm using php/css/jquery

1. is this possible to do dynamically with php?

2. how do you think they should be loaded?
I'm thinking that when the link is first used is should be cached (something like freelancer.com.gif) and then it should be dynamically assigned a class that links to it with css, or even just some inline css plopped on, like background-image: url('freelancer.com.gif')


I dunno, tell me what you think
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-14-2011, 08:23 AM Re: dynamic favicon from anchors
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You could probably use CSS to handle it

Code:
a:link {
     background-image: url(pathtoimage);
     background-position: left center;
     background-repeat: no-repeat;
     text-indent: pixel_width_of_image px:
     line-height: pixel_height_of_image;
}
Not tested BTW just thinking aloud
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-14-2011, 12:58 PM Re: dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
well what I've done in the past is just put a left padding of 20px or so, and just Set it as a no repeat background, I guess that text-indent does the same.

But the real problem is how I should store and assign them all.


I'll either have to figure out the base domain name
(http://tycoontalk.freelancer.com/php...m-anchors.html >>>>> freelancer.com)

Every time the page is loaded for each link, or store that in the database for each link.

Both ways sound bad.
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 07-14-2011, 01:17 PM Re: dynamic favicon from anchors
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I guess that text-indent does the same
Not quite. Padding would also push the background image over, while text-indent should only affect the text node of the content.

So is it that you want to use the favicon from the parent website of the target page not the favicon of the site the links are on, if so that is;
A: going to present cross site scripting issues
B: page speed rendering problems.
C: the target site getting pretty hacked off with you "hotlinking" their favicon.

or any combination/permutation of the three.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-14-2011, 03:35 PM Re: dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Not quite. Padding would also push the background image over, while text-indent should only affect the text node of the content.

So is it that you want to use the favicon from the parent website of the target page not the favicon of the site the links are on, if so that is;
A: going to present cross site scripting issues
B: page speed rendering problems.
C: the target site getting pretty hacked off with you "hotlinking" their favicon.

or any combination/permutation of the three.
No, I was hoping that they would get cached and stored on my web server rather than hot linking. I would only need to scan their page once to try to get it and then save it onto mine.

What cross site scripting issues?

Hopefully look like this
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 07-14-2011, 06:16 PM Re: dynamic favicon from anchors
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
I'm not sure if browsers will display .ico files as on-page images (?)
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-14-2011, 11:39 PM Re: dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by mgraphic View Post
I'm not sure if browsers will display .ico files as on-page images (?)
yeah I mean to convert them to something else, probably .gif
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 07-15-2011, 04:07 AM Re: dynamic favicon from anchors
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Then just take a screenshot of them, crop and store them in the database where you keep the links? Assuming you are allowed to do so. You might wanna get permission from the sites first.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 07-15-2011, 09:43 AM Re: dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by lizciz View Post
Then just take a screenshot of them, crop and store them in the database where you keep the links? Assuming you are allowed to do so. You might wanna get permission from the sites first.
it has to be done dynamically, with my users links
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 07-15-2011, 10:01 AM Re: dynamic favicon from anchors
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
First hit on google
http://www.labnol.org/internet/get-f...h-google/4404/
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 07-24-2011, 10:51 PM Re: dynamic favicon from anchors
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by lizciz View Post
yeah I want that, but would rather host my own, I don't trust that they'll keep it up forever, not to mention that it doesn't work for all sites:

http://skeddles.com/
Skeddles is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to dynamic favicon from anchors
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53683 seconds with 12 queries