php-general Digest 15 Oct 2008 10:22:46 -0000 Issue 5736

Topics (messages 281922 through 281942):

Re: utf8/quoted printable based mail renders raw html
        281922 by: Nathan Rixham
        281934 by: Eric Butera

Re: searching by tags....
        281923 by: Nathan Rixham
        281924 by: Ashley Sheridan
        281926 by: Nathan Rixham
        281928 by: Ashley Sheridan
        281930 by: Jochem Maas
        281932 by: Ashley Sheridan
        281933 by: Nathan Rixham
        281938 by: Ashley Sheridan
        281939 by: Jochem Maas
        281942 by: Nathan Rixham

Re: Output to matrix printer
        281925 by: Miles Thompson
        281927 by: Ashley Sheridan
        281929 by: Shawn McKenzie
        281937 by: Per Jessen

Re: 1 last error to fix before the application is done!
        281931 by: Jochem Maas
        281941 by: Colin Guthrie

pdo and dabase schema
        281935 by: Alain Roger
        281936 by: Chris

Brain dead... write image to file
        281940 by: Ryan S

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Eric Butera wrote:
On Tue, Oct 14, 2008 at 5:04 PM, Ashley Sheridan

From: "Some Company" <[EMAIL PROTECTED]>
Date: Tue, 14 Oct 2008 13:01:18 -0400
Date: Tue, 14 Oct 2008 13:01:18 -0400

maybe because you have two dates in the headers?

whats the mime type of the html block? if it's set to text/plain then..

Content-Type: text/plain; charset="utf-8"
doesn't need quotes so..
Content-Type: text/plain; charset=utf-8

is it all valid utf-8? (and indeed valid quoted-printable utf-8)?

+ something rings in my mind about either wrong line terminations in the mime headers OR having 1 too many..
--- End Message ---
--- Begin Message ---
On Tue, Oct 14, 2008 at 5:54 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote:
> Eric Butera wrote:
>>
>> On Tue, Oct 14, 2008 at 5:04 PM, Ashley Sheridan
>
>> From: "Some Company" <[EMAIL PROTECTED]>
>> Date: Tue, 14 Oct 2008 13:01:18 -0400
>> Date: Tue, 14 Oct 2008 13:01:18 -0400
>
> maybe because you have two dates in the headers?
>
> whats the mime type of the html block? if it's set to text/plain then..
>
> Content-Type: text/plain; charset="utf-8"
> doesn't need quotes so..
> Content-Type: text/plain; charset=utf-8
>
> is it all valid utf-8? (and indeed valid quoted-printable utf-8)?
>
> + something rings in my mind about either wrong line terminations in the
> mime headers OR having 1 too many..

There are two dates in there because of my copy & paste error.  I only
pasted a little bit and later revised by pasting more of my headers to
be more clear.  Whoops.

As for it being all valid utf-8, I'm pretty sure it is.  I have a
header that sets the content type to text/html charset utf8 along with
a meta tag.  My database tables are all utf8 (along with the
collation) and so is that connection.  I suppose I haven't gone
through the extreme of actually validating each character, but that is
a bit much.

As for the headers & mime encoding, well I'd have to search the Zend
Framework docs/forums to figure that out since it isn't really a
php-general question.  There are a lot of eyes on this code and it has
really good unit tests.  I'm fairly confident in its abilities, but
nothing is perfect.

I'd err on the side of my content before anything else.  Maybe looking
into the headers/quoting issue might provide some light.

Thanks!

--- End Message ---
--- Begin Message ---
Ryan S wrote:
Hey,

this the first time I am actually working with "tags" but it seems quite 
popular and am adding it on a clients requests.

By tags I mean something like wordpress' implementation of it, for example when 
an author writes an article on babies the tags might be
baby,babies, new borns, cribs, nappies

or a picture of a baby can have the tags
baby,babies, new born, cute kid, nappies

the tags are comma separated above of course.

The way i am doing it right now is i have sayyyy an article or a pic saved in the db as article_or_pic_address text
the_tags varchar(240)

My question is, when someone clicks on any one of the tags, do i do a  LIKE 
%search_term% search or...???

quite a few sites seem to have a very neat way of implementing this with (url 
rewriting?) something like http://sitename/blog/tags/tag-comes-here/

Any help in the form of advise, code or links would be appreciated.

TIA.

Cheers!
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)




you need to normalise you're db mate

table: tags
tagId int autoinc
tagString varchar(200)

table tags_ref
tagId (from above)
objectId (id of what you want to link the tag too)

that way you can simply join up the 3 tables and select from tags_ref where tagId=XXX to get all the objects (post, link, image, video etc) that the tag is associated to. (and allow much more functionality)
--- End Message ---
--- Begin Message ---
On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
> Hey,
> 
> this the first time I am actually working with "tags" but it seems quite 
> popular and am adding it on a clients requests.
> 
> By tags I mean something like wordpress' implementation of it, for example 
> when an author writes an article on babies the tags might be
> baby,babies, new borns, cribs, nappies
> 
> or a picture of a baby can have the tags 
> 
> baby,babies, new born, cute kid, nappies
> 
> the tags are comma separated above of course.
> 
> The way i am doing it right now is i have sayyyy an article or a pic saved in 
> the db as 
> article_or_pic_address text
> the_tags varchar(240)
> 
> My question is, when someone clicks on any one of the tags, do i do a  LIKE 
> %search_term% search or...???
> 
> quite a few sites seem to have a very neat way of implementing this with (url 
> rewriting?) something like http://sitename/blog/tags/tag-comes-here/
> 
> Any help in the form of advise, code or links would be appreciated.
> 
> TIA.
> 
> Cheers!
> Ryan
> ------
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
> 
> 
> 
>       
> 
I think your question has two parts there.

With regards to searching in the database, I'd do a LIKE '%search_term
%'.

As for getting those search terms, well a link in a page can contain GET
values, such as http://www.somedomain.com/blog?tag=search_term .
Alternatively, you could use mod-rewrite to rewrite the URL and turn the
path into tag variables. This is the same as the above but with the
added benefit that users can type in tags directly more easily, and
there are apparently benefits for SEO with this method as well (but I'm
not sure how true that is)


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
quite a few sites seem to have a very neat way of implementing this with (url 
rewriting?) something like http://sitename/blog/tags/tag-comes-here/

As for getting those search terms, well a link in a page can contain GET
values, such as http://www.somedomain.com/blog?tag=search_term .
Alternatively, you could use mod-rewrite to rewrite the URL and turn the
path into tag variables. This is the same as the above but with the
added benefit that users can type in tags directly more easily, and
there are apparently benefits for SEO with this method as well (but I'm
not sure how true that is)

it's very true; from the google webmaster guidelines:

If you decide to use dynamic pages (i.e., the URL contains a "?" character), be aware that not every search engine spider crawls dynamic pages as well as static pages. It helps to keep the parameters short and the number of them few.

previously it was text along the lines of "google doesn't index all pages with query parameters, so avoid them where possible"

additionally one of the weightier points in categorising pages within the SERPS is the text in the url (especially if the page is actually about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
--- End Message ---
--- Begin Message ---
On Tue, 2008-10-14 at 23:17 +0100, Nathan Rixham wrote:
> Ashley Sheridan wrote:
> > On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
> >> quite a few sites seem to have a very neat way of implementing this with 
> >> (url rewriting?) something like http://sitename/blog/tags/tag-comes-here/
> 
> > As for getting those search terms, well a link in a page can contain GET
> > values, such as http://www.somedomain.com/blog?tag=search_term .
> > Alternatively, you could use mod-rewrite to rewrite the URL and turn the
> > path into tag variables. This is the same as the above but with the
> > added benefit that users can type in tags directly more easily, and
> > there are apparently benefits for SEO with this method as well (but I'm
> > not sure how true that is)
> 
> it's very true; from the google webmaster guidelines:
> 
> If you decide to use dynamic pages (i.e., the URL contains a "?" 
> character), be aware that not every search engine spider crawls dynamic 
> pages as well as static pages. It helps to keep the parameters short and 
> the number of them few.
> 
> previously it was text along the lines of "google doesn't index all 
> pages with query parameters, so avoid them where possible"
> 
> additionally one of the weightier points in categorising pages within 
> the SERPS is the text in the url (especially if the page is actually 
> about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
> 
What I meant was this definately used to be the case, but I've not found
it to be anymore. Try searching the various engines with a
strange/obscure question (a real one obviously!) and look at the
results. Often you'll find forums are the main results, which almost
exclusively use GET parameters rather than URL rewriting. Also, you
mention about keywords in the URL; GET parameters qualify for this, but
I agree, certain parts of the URL (i.e. domain, path, querystring,
anchor) could have different weightings.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Nathan Rixham schreef:
> Ashley Sheridan wrote:
>> On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
>>> quite a few sites seem to have a very neat way of implementing this
>>> with (url rewriting?) something like
>>> http://sitename/blog/tags/tag-comes-here/
> 
>> As for getting those search terms, well a link in a page can contain GET
>> values, such as http://www.somedomain.com/blog?tag=search_term .
>> Alternatively, you could use mod-rewrite to rewrite the URL and turn the
>> path into tag variables. This is the same as the above but with the
>> added benefit that users can type in tags directly more easily, and
>> there are apparently benefits for SEO with this method as well (but I'm
>> not sure how true that is)
> 
> it's very true; from the google webmaster guidelines:
> 
> If you decide to use dynamic pages (i.e., the URL contains a "?"
> character), be aware that not every search engine spider crawls dynamic
> pages as well as static pages. It helps to keep the parameters short and
> the number of them few.
> 
> previously it was text along the lines of "google doesn't index all
> pages with query parameters, so avoid them where possible"
> 
> additionally one of the weightier points in categorising pages within
> the SERPS is the text in the url (especially if the page is actually
> about /the_tag_in_the_url : see http://www.google.com/search?q=tags)

                                                                ^-- some what 
ironic :-)
> 


--- End Message ---
--- Begin Message ---
On Wed, 2008-10-15 at 01:17 +0200, Jochem Maas wrote:
> Nathan Rixham schreef:
> > Ashley Sheridan wrote:
> >> On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
> >>> quite a few sites seem to have a very neat way of implementing this
> >>> with (url rewriting?) something like
> >>> http://sitename/blog/tags/tag-comes-here/
> > 
> >> As for getting those search terms, well a link in a page can contain GET
> >> values, such as http://www.somedomain.com/blog?tag=search_term .
> >> Alternatively, you could use mod-rewrite to rewrite the URL and turn the
> >> path into tag variables. This is the same as the above but with the
> >> added benefit that users can type in tags directly more easily, and
> >> there are apparently benefits for SEO with this method as well (but I'm
> >> not sure how true that is)
> > 
> > it's very true; from the google webmaster guidelines:
> > 
> > If you decide to use dynamic pages (i.e., the URL contains a "?"
> > character), be aware that not every search engine spider crawls dynamic
> > pages as well as static pages. It helps to keep the parameters short and
> > the number of them few.
> > 
> > previously it was text along the lines of "google doesn't index all
> > pages with query parameters, so avoid them where possible"
> > 
> > additionally one of the weightier points in categorising pages within
> > the SERPS is the text in the url (especially if the page is actually
> > about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
> 
>                                                               ^-- some what 
> ironic :-)
> > 
> 
> 
Yeah I saw that too...

What always gets me is that forums always feature really high on search
results, and I've yet to see one of these forums use URL rewriting! I
really think this belief about query-less URLs being more search engine
friendly is outdated.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Wed, 2008-10-15 at 01:17 +0200, Jochem Maas wrote:
Nathan Rixham schreef:
Ashley Sheridan wrote:
On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
quite a few sites seem to have a very neat way of implementing this
with (url rewriting?) something like
http://sitename/blog/tags/tag-comes-here/
As for getting those search terms, well a link in a page can contain GET
values, such as http://www.somedomain.com/blog?tag=search_term .
Alternatively, you could use mod-rewrite to rewrite the URL and turn the
path into tag variables. This is the same as the above but with the
added benefit that users can type in tags directly more easily, and
there are apparently benefits for SEO with this method as well (but I'm
not sure how true that is)
it's very true; from the google webmaster guidelines:

If you decide to use dynamic pages (i.e., the URL contains a "?"
character), be aware that not every search engine spider crawls dynamic
pages as well as static pages. It helps to keep the parameters short and
the number of them few.

previously it was text along the lines of "google doesn't index all
pages with query parameters, so avoid them where possible"

additionally one of the weightier points in categorising pages within
the SERPS is the text in the url (especially if the page is actually
about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
                                                                ^-- some what 
ironic :-)

Yeah I saw that too...

What always gets me is that forums always feature really high on search
results, and I've yet to see one of these forums use URL rewriting! I
really think this belief about query-less URLs being more search engine
friendly is outdated.


Ash
www.ashleysheridan.co.uk


a search engines main job is to send people to what they are looking for, not what an seo has determined they should be seeing, as such "content is king".

Forums, lists and newsgroups tend to hold more specific content on exactly what the user is searching for, hence why google shows it high (as it's one of the few documents on the net which relate most directly to what was searched for [long tail search terms]); additionally all the aforementioned often have a trail of replies; sometimes this is a bonus as the replies repeat the keyword terms; however sometimes it's to the detriment, particularly when they wander off topic.

It's also worth noting that sites which update frequently, especially those who update sitemaps and send out pings get crawled more frequently and thus indexed faster. On hot-topics this has a knock on effect, the posts get crawled by scrapers and content harvesters and re-published (often with a link back) - and this helps as the vote count for the original forum post goes up due to the link backs + the original source is detected as such and given prominence over the copies (most of the time).

Further people take care to title their posts/messages correctly in order to attract answers quickly, this text is then repeated on the forum page in all the prominent places (title, permalink, heading tags..) and further still, the post/message is normally perfectly matched to the user specified title - so it's natural seo at it's best. (Worth having a read up on contextual and semantic analysis as well)

Next up, the sites weight, as forums often have thousands (or hundreds of thousands) of pages/posts, and high volume traffic, the site is deemed more important and thus higher ranking, which brings in more traffic and so it spirals. On this note it's also worth considering that google track what you click on so if searchers continually click item 3 in the search results, over time they'll move it up as it's been classed as most accurate for that search (more.. obviously due to wide use of analytics and checking when a user comes back to the results to click another they can also harvest accuracy data by comparing bounce rates etc and adjust accordingly).

so much more on this subject but that's about the top and bottom of it in this scenario.

*yawn* getting late

--- End Message ---
--- Begin Message ---
On Wed, 2008-10-15 at 00:58 +0100, Nathan Rixham wrote:
> Ashley Sheridan wrote:
> > On Wed, 2008-10-15 at 01:17 +0200, Jochem Maas wrote:
> >> Nathan Rixham schreef:
> >>> Ashley Sheridan wrote:
> >>>> On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
> >>>>> quite a few sites seem to have a very neat way of implementing this
> >>>>> with (url rewriting?) something like
> >>>>> http://sitename/blog/tags/tag-comes-here/
> >>>> As for getting those search terms, well a link in a page can contain GET
> >>>> values, such as http://www.somedomain.com/blog?tag=search_term .
> >>>> Alternatively, you could use mod-rewrite to rewrite the URL and turn the
> >>>> path into tag variables. This is the same as the above but with the
> >>>> added benefit that users can type in tags directly more easily, and
> >>>> there are apparently benefits for SEO with this method as well (but I'm
> >>>> not sure how true that is)
> >>> it's very true; from the google webmaster guidelines:
> >>>
> >>> If you decide to use dynamic pages (i.e., the URL contains a "?"
> >>> character), be aware that not every search engine spider crawls dynamic
> >>> pages as well as static pages. It helps to keep the parameters short and
> >>> the number of them few.
> >>>
> >>> previously it was text along the lines of "google doesn't index all
> >>> pages with query parameters, so avoid them where possible"
> >>>
> >>> additionally one of the weightier points in categorising pages within
> >>> the SERPS is the text in the url (especially if the page is actually
> >>> about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
> >>                                                            ^-- some what 
> >> ironic :-)
> >>
> > Yeah I saw that too...
> > 
> > What always gets me is that forums always feature really high on search
> > results, and I've yet to see one of these forums use URL rewriting! I
> > really think this belief about query-less URLs being more search engine
> > friendly is outdated.
> > 
> > 
> > Ash
> > www.ashleysheridan.co.uk
> > 
> 
> a search engines main job is to send people to what they are looking 
> for, not what an seo has determined they should be seeing, as such 
> "content is king".
> 
> Forums, lists and newsgroups tend to hold more specific content on 
> exactly what the user is searching for, hence why google shows it high 
> (as it's one of the few documents on the net which relate most directly 
> to what was searched for [long tail search terms]); additionally all the 
> aforementioned often have a trail of replies; sometimes this is a bonus 
> as the replies repeat the keyword terms; however sometimes it's to the 
> detriment, particularly when they wander off topic.
> 
> It's also worth noting that sites which update frequently, especially 
> those who update sitemaps and send out pings get crawled more frequently 
> and thus indexed faster. On hot-topics this has a knock on effect, the 
> posts get crawled by scrapers and content harvesters and re-published 
> (often with a link back) - and this helps as the vote count for the 
> original forum post goes up due to the link backs + the original source 
> is detected as such and given prominence over the copies (most of the time).
> 
> Further people take care to title their posts/messages correctly in 
> order to attract answers quickly, this text is then repeated on the 
> forum page in all the prominent places (title, permalink, heading 
> tags..) and further still, the post/message is normally perfectly 
> matched to the user specified title - so it's natural seo at it's best. 
> (Worth having a read up on contextual and semantic analysis as well)
> 
> Next up, the sites weight, as forums often have thousands (or hundreds 
> of thousands) of pages/posts, and high volume traffic, the site is 
> deemed more important and thus higher ranking, which brings in more 
> traffic and so it spirals. On this note it's also worth considering that 
> google track what you click on so if searchers continually click item 3 
> in the search results, over time they'll move it up as it's been classed 
> as most accurate for that search (more.. obviously due to wide use of 
> analytics and checking when a user comes back to the results to click 
> another they can also harvest accuracy data by comparing bounce rates 
> etc and adjust accordingly).
> 
> so much more on this subject but that's about the top and bottom of it 
> in this scenario.
> 
> *yawn* getting late
> 
You're preaching to the converted on this topic, I've already put
together a couple of articles on my site about it in the past. What I
was saying was that the sites that seem to feature so prominently on
listings were in fact using querystring URLs; the very thing that SEO
guides tell us not to use. I think it's just an outdated belief that URL
rewriting is better, as clearly it doesn't ever seem to be.



Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Ashley Sheridan schreef:
> On Wed, 2008-10-15 at 00:58 +0100, Nathan Rixham wrote:
>> Ashley Sheridan wrote:
>>> On Wed, 2008-10-15 at 01:17 +0200, Jochem Maas wrote:
>>>> Nathan Rixham schreef:
>>>>> Ashley Sheridan wrote:
>>>>>> On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
>>>>>>> quite a few sites seem to have a very neat way of implementing this
>>>>>>> with (url rewriting?) something like
>>>>>>> http://sitename/blog/tags/tag-comes-here/
>>>>>> As for getting those search terms, well a link in a page can contain GET
>>>>>> values, such as http://www.somedomain.com/blog?tag=search_term .
>>>>>> Alternatively, you could use mod-rewrite to rewrite the URL and turn the
>>>>>> path into tag variables. This is the same as the above but with the
>>>>>> added benefit that users can type in tags directly more easily, and
>>>>>> there are apparently benefits for SEO with this method as well (but I'm
>>>>>> not sure how true that is)
>>>>> it's very true; from the google webmaster guidelines:
>>>>>
>>>>> If you decide to use dynamic pages (i.e., the URL contains a "?"
>>>>> character), be aware that not every search engine spider crawls dynamic
>>>>> pages as well as static pages. It helps to keep the parameters short and
>>>>> the number of them few.
>>>>>
>>>>> previously it was text along the lines of "google doesn't index all
>>>>> pages with query parameters, so avoid them where possible"
>>>>>
>>>>> additionally one of the weightier points in categorising pages within
>>>>> the SERPS is the text in the url (especially if the page is actually
>>>>> about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
>>>>                                                            ^-- some what 
>>>> ironic :-)
>>>>
>>> Yeah I saw that too...
>>>
>>> What always gets me is that forums always feature really high on search
>>> results, and I've yet to see one of these forums use URL rewriting! I
>>> really think this belief about query-less URLs being more search engine
>>> friendly is outdated.
>>>
>>>
>>> Ash
>>> www.ashleysheridan.co.uk
>>>
>> a search engines main job is to send people to what they are looking 
>> for, not what an seo has determined they should be seeing, as such 
>> "content is king".
>>
>> Forums, lists and newsgroups tend to hold more specific content on 
>> exactly what the user is searching for, hence why google shows it high 
>> (as it's one of the few documents on the net which relate most directly 
>> to what was searched for [long tail search terms]); additionally all the 
>> aforementioned often have a trail of replies; sometimes this is a bonus 
>> as the replies repeat the keyword terms; however sometimes it's to the 
>> detriment, particularly when they wander off topic.
>>
>> It's also worth noting that sites which update frequently, especially 
>> those who update sitemaps and send out pings get crawled more frequently 
>> and thus indexed faster. On hot-topics this has a knock on effect, the 
>> posts get crawled by scrapers and content harvesters and re-published 
>> (often with a link back) - and this helps as the vote count for the 
>> original forum post goes up due to the link backs + the original source 
>> is detected as such and given prominence over the copies (most of the time).
>>
>> Further people take care to title their posts/messages correctly in 
>> order to attract answers quickly, this text is then repeated on the 
>> forum page in all the prominent places (title, permalink, heading 
>> tags..) and further still, the post/message is normally perfectly 
>> matched to the user specified title - so it's natural seo at it's best. 
>> (Worth having a read up on contextual and semantic analysis as well)
>>
>> Next up, the sites weight, as forums often have thousands (or hundreds 
>> of thousands) of pages/posts, and high volume traffic, the site is 
>> deemed more important and thus higher ranking, which brings in more 
>> traffic and so it spirals. On this note it's also worth considering that 
>> google track what you click on so if searchers continually click item 3 
>> in the search results, over time they'll move it up as it's been classed 
>> as most accurate for that search (more.. obviously due to wide use of 
>> analytics and checking when a user comes back to the results to click 
>> another they can also harvest accuracy data by comparing bounce rates 
>> etc and adjust accordingly).
>>
>> so much more on this subject but that's about the top and bottom of it 
>> in this scenario.
>>
>> *yawn* getting late
>>
> You're preaching to the converted on this topic, I've already put
> together a couple of articles on my site about it in the past. What I
> was saying was that the sites that seem to feature so prominently on
> listings were in fact using querystring URLs; the very thing that SEO
> guides tell us not to use. I think it's just an outdated belief that URL
> rewriting is better, as clearly it doesn't ever seem to be.

obviously the converted weren't listening.

> 
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
> 


--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Ashley Sheridan schreef:
On Wed, 2008-10-15 at 00:58 +0100, Nathan Rixham wrote:
Ashley Sheridan wrote:
On Wed, 2008-10-15 at 01:17 +0200, Jochem Maas wrote:
Nathan Rixham schreef:
Ashley Sheridan wrote:
On Tue, 2008-10-14 at 14:54 -0700, Ryan S wrote:
quite a few sites seem to have a very neat way of implementing this
with (url rewriting?) something like
http://sitename/blog/tags/tag-comes-here/
As for getting those search terms, well a link in a page can contain GET
values, such as http://www.somedomain.com/blog?tag=search_term .
Alternatively, you could use mod-rewrite to rewrite the URL and turn the
path into tag variables. This is the same as the above but with the
added benefit that users can type in tags directly more easily, and
there are apparently benefits for SEO with this method as well (but I'm
not sure how true that is)
it's very true; from the google webmaster guidelines:

If you decide to use dynamic pages (i.e., the URL contains a "?"
character), be aware that not every search engine spider crawls dynamic
pages as well as static pages. It helps to keep the parameters short and
the number of them few.

previously it was text along the lines of "google doesn't index all
pages with query parameters, so avoid them where possible"

additionally one of the weightier points in categorising pages within
the SERPS is the text in the url (especially if the page is actually
about /the_tag_in_the_url : see http://www.google.com/search?q=tags)
                                                                ^-- some what 
ironic :-)

Yeah I saw that too...

What always gets me is that forums always feature really high on search
results, and I've yet to see one of these forums use URL rewriting! I
really think this belief about query-less URLs being more search engine
friendly is outdated.


Ash
www.ashleysheridan.co.uk

a search engines main job is to send people to what they are looking for, not what an seo has determined they should be seeing, as such "content is king".

Forums, lists and newsgroups tend to hold more specific content on exactly what the user is searching for, hence why google shows it high (as it's one of the few documents on the net which relate most directly to what was searched for [long tail search terms]); additionally all the aforementioned often have a trail of replies; sometimes this is a bonus as the replies repeat the keyword terms; however sometimes it's to the detriment, particularly when they wander off topic.

It's also worth noting that sites which update frequently, especially those who update sitemaps and send out pings get crawled more frequently and thus indexed faster. On hot-topics this has a knock on effect, the posts get crawled by scrapers and content harvesters and re-published (often with a link back) - and this helps as the vote count for the original forum post goes up due to the link backs + the original source is detected as such and given prominence over the copies (most of the time).

Further people take care to title their posts/messages correctly in order to attract answers quickly, this text is then repeated on the forum page in all the prominent places (title, permalink, heading tags..) and further still, the post/message is normally perfectly matched to the user specified title - so it's natural seo at it's best. (Worth having a read up on contextual and semantic analysis as well)

Next up, the sites weight, as forums often have thousands (or hundreds of thousands) of pages/posts, and high volume traffic, the site is deemed more important and thus higher ranking, which brings in more traffic and so it spirals. On this note it's also worth considering that google track what you click on so if searchers continually click item 3 in the search results, over time they'll move it up as it's been classed as most accurate for that search (more.. obviously due to wide use of analytics and checking when a user comes back to the results to click another they can also harvest accuracy data by comparing bounce rates etc and adjust accordingly).

so much more on this subject but that's about the top and bottom of it in this scenario.

*yawn* getting late

You're preaching to the converted on this topic, I've already put
together a couple of articles on my site about it in the past. What I
was saying was that the sites that seem to feature so prominently on
listings were in fact using querystring URLs; the very thing that SEO
guides tell us not to use. I think it's just an outdated belief that URL
rewriting is better, as clearly it doesn't ever seem to be.

obviously the converted weren't listening.


indeed, the point being (perhaps I didn't make it clear) is that the forum posts you are talking about are listed highly due to several other major factors, the difference between using dynamic (querystring) and static urls only comes in to play when all other factors are pretty much equal; in this scenario the static urls with keywords in will *always* out rank the dynamic urls. (fact: a keyword in a static url is +1 to the weight of the page, without it you can't get that +1).

Additionally (feel free to test this) a site with 3000 unique pages all using static urls will invariably get fully indexed - whereas the same site with 3000 dynamic urls generally will not.

--
nathan ( [EMAIL PROTECTED] )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

--- End Message ---
--- Begin Message ---
On Tue, Oct 14, 2008 at 6:23 PM, Dušan Novaković <[EMAIL PROTECTED]> wrote:

> I have some request to sent text to matrix printer to print ticket for
> theater. Is it possible to do that whit some php functions? Main point
> is how to control length of paper that will be drawn inside and to
> print text on a specific place. It would be nice if somebody can write
> the code about this as example.
>
> Thnx, Dusan
>
> --
> made by Dusan
>

Decide on the font you will use - either 10 or 12 characters per inch.
A line is usually 1/8" high.

So you essentially have a matrix running at "n" characters per inch
horizontally, and "m" fractions of an inch vertically.

Fit your print into this matrix - some people do it with an array, others
just work the spaces.

Provide a "test" ticket so the operator can get the printer lined up. With
a  tractor feed, after that you are good for a whole box of tickets.

Oh - one more thing - you may have to advance a number of lines so the
ticket can be torn off after printing, then reverse feed the same number.

Another tip - set your page length just to the height of the ticket.

You really want to exploit the basic native font built into the printer.

Hope this helps - Miles

--- End Message ---
--- Begin Message ---
On Tue, 2008-10-14 at 19:15 -0300, Miles Thompson wrote:
> On Tue, Oct 14, 2008 at 6:23 PM, Dušan Novaković <[EMAIL PROTECTED]> wrote:
> 
> > I have some request to sent text to matrix printer to print ticket for
> > theater. Is it possible to do that whit some php functions? Main point
> > is how to control length of paper that will be drawn inside and to
> > print text on a specific place. It would be nice if somebody can write
> > the code about this as example.
> >
> > Thnx, Dusan
> >
> > --
> > made by Dusan
> >
> 
> Decide on the font you will use - either 10 or 12 characters per inch.
> A line is usually 1/8" high.
> 
> So you essentially have a matrix running at "n" characters per inch
> horizontally, and "m" fractions of an inch vertically.
> 
> Fit your print into this matrix - some people do it with an array, others
> just work the spaces.
> 
> Provide a "test" ticket so the operator can get the printer lined up. With
> a  tractor feed, after that you are good for a whole box of tickets.
> 
> Oh - one more thing - you may have to advance a number of lines so the
> ticket can be torn off after printing, then reverse feed the same number.
> 
> Another tip - set your page length just to the height of the ticket.
> 
> You really want to exploit the basic native font built into the printer.
> 
> Hope this helps - Miles

I'm not sure I would have chosen PHP as the ideal language for this kind
of thing, as it's strengths are mainly in the web server field. I
suppose it could be done with the PHP CLI. Have you found a spec for the
printer, i.e. what inputs it accepts, or is there a driver API that you
know it uses?


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Dušan Novaković wrote:
> I have some request to sent text to matrix printer to print ticket for
> theater. Is it possible to do that whit some php functions? Main point
> is how to control length of paper that will be drawn inside and to
> print text on a specific place. It would be nice if somebody can write
> the code about this as example.
> 
> Thnx, Dusan
> 

Matrix printer?  Is this an awesomely powerful matrix of multiple
printers high output printers?

-Shawn


--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:

> Matrix printer?  Is this an awesomely powerful matrix of multiple
> printers high output printers?
> 
> -Shawn

http://en.wikipedia.org/wiki/Matrix_printer


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
Colin Guthrie schreef:
> Jochem Maas wrote:
>> Jason Pruim schreef:
>>> Good morning everyone!
>>>
>>> I think I might be having a "to early in the morning/not enough
>>> caffeine" moment... But I am down to 1 error on my timecard application
>>> that I would like to clean up. It's a small undefined index error, and
>>> the program works jsut fine the way it is, but why leave an error if you
>>> don't need to? :)
>>>
>>> Here is the error:
>>>
>>> [Tue Oct 14 08:19:47 2008] [error] PHP Notice:  Undefined index:
>>> userInfo in
>>> /Volumes/RAIDer/webserver/Documents/dev/stimecard/inc/function/authentication.func.php
>>>
>>> on line 22
>>>
>>> and here is the relevant code:
>>>
>>> ======> Line 22        if($_SESSION['userInfo']['loggedin'] == TRUE) {
>>>            
>>
>> if(isset($_SESSION['userInfo']['loggedin']) &&
>> $_SESSION['userInfo']['loggedin'] == TRUE) {
> 
> Or, seeing as I'm a stickler for compact code:

me too, I also like to be able to change stuff at a single point
in the code so I usually wrap this kind of thing inside a function/class
where I don't have to look at the length of the LOC that does the actual work 
:-)

...

>   if(!empty($_SESSION['userInfo']['loggedin'])) {

if (Sess::userLoggedIn()) { /* ... :-) */ }

> 
> empty() is like isset() but tests for all sorts of "empty" cases ('',
> false, null and 0 are all considered, "empty").

all true, but just as often you'd want to test for not only a non-empty value
but a very specific value. in which case you'd be back to using isset and a
comparison expression.

> 
> Col
> 
> 


--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Colin Guthrie schreef:
  if(!empty($_SESSION['userInfo']['loggedin'])) {

if (Sess::userLoggedIn()) { /* ... :-) */ }


Well, yes, that's how I do it in my apps too, but in internally in that function you may want to use the empty() call :)

I agree that when checking for values other than boolean and such you need to do more checks but quite often in practical coding, I find that using empty cuts down quite a lot on function call overhead and double statements.

Everyone's different tho' so each to their own way :)

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---
--- Begin Message ---
Hi,

is there a way with PDO class to not have:
- to execute a simple SET search_path TO myschema;
- and after to fletch another SQL request, like select to be sure that the
SQL statement will be perform on this schema ?
(basically i want to do it in 1 step)

because i tried to specify the schema into my sql statement but in this case
PDO returns me 0 record.
thanks a lot,

-- 
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

--- End Message ---
--- Begin Message ---
Alain Roger wrote:
Hi,

is there a way with PDO class to not have:
- to execute a simple SET search_path TO myschema;

can you alter the postgres users path?

alter user <username> set search_path to new_schema, current_schemas();

or some variation on that.

- and after to fletch another SQL request, like select to be sure that the
SQL statement will be perform on this schema ?
(basically i want to do it in 1 step)

You can't. After you connect you have to change the schema.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
Hey all,

am feeling a bit brain dead, pulled an all nighter and would appreciate some 
help as have already wasted over 2hrs on this :(
just not thinking straight.
I got this script off the net, cant even remember where :( its basically to 
resize an uploaded image (i have a script that does exactly this that i created 
ages ago... but cant find it and if i remember corrrectly that only resizes 
jpgs, this one does gifs and pngs as well)

the way the original guy wrote it is that it writes the uploaded image to the 
DB, i'm just trying for it to create a resized image *instead of writing to the 
db*.

The code is below, needless to say, my little block of code to write an the 
image to file is not working... would appreciate some help.

<?php 
//$conn = mysql_connect("localhost", "username", "password") or 
die(mysql_error()); 
//mysql_select_db('test', $conn) or die(mysql_error()); 


if($_FILES['userfile']['tmp_name']){ 
    resize(); 
//$q = "INSERT INTO test VALUES ('', '".$blob_arr['image']."', 
'".$blob_arr['thumb']."', '".$blob_arr['type']."')"; 
//    $aa = mysql_query($q,$conn) or die(mysql_error());  

/////////########## Start my code try
$uploaddir = 'C:\\wamp\\www\\ezee\\funny\\';
$filename = $uploaddir.'test.jpg';
$somecontent = $blob_arr['thumb'];

if (is_writable($filename)) {
    if (!$handle = fopen($filename, 'w')) {
         echo "Cannot open file ($filename)";
         exit;
    }
   if (fwrite($handle, $somecontent) === FALSE) {
        echo "Cannot write to file ($filename)";
        exit;
    }

    fclose($handle);

} else {    echo "The file $filename is not writable";}



    header( "Content-type: ".$blob_arr['type'].""); 
}
/////////########## End my code try



function resize(){ 
    global $blob_arr; 
    $temp_name =$_FILES['userfile']['tmp_name']; 
    $userfile_name =$_FILES['userfile']['name']; 
    $userfile_size =$_FILES['userfile']['size']; 
    $userfile_type =$_FILES['userfile']['type']; 

    $thumb_width=90; 
    $thumb_height=90; 
    $image_width=200; 
    $image_height=200; 

    if (!($userfile_type =="image/pjpeg" OR $userfile_type =="image/jpeg" OR 
$userfile_type=="image/gif" OR $userfile_type=="image/png" OR 
$userfile_type=="image/x-png")){ 
        die ("You can upload just images in .jpg .jpeg .gif and .png format!<br 
/ >"); 
    } 
    $data = fread(fopen($temp_name, "rb"), filesize($temp_name)); 
    $src_image = imagecreatefromstring($data); 
    $width = imagesx($src_image); 
    $height = imagesy($src_image); 
    if ($thumb_width && ($width < $height)) { 
           $thumb_width = ($thumb_height / $height) * $width; 
    } else { 
           $thumb_height = ($thumb_width / $width) * $height; 
    } 
    if ($image_width && ($width < $height)) { 
           $image_width = ($image_height / $height) * $width; 
    } else { 
           $image_height = ($image_width / $width) * $height; 
    } 
    $dest_img = imagecreatetruecolor($thumb_width, $thumb_height); 
    $i_dest_img = imagecreatetruecolor($image_width, $image_height);       
    imagecopyresized($dest_img, $src_image,0, 0, 0, 0,$thumb_width, 
$thumb_height,$width, $height); 
    imagecopyresized($i_dest_img, $src_image,0, 0, 0, 0,$image_width, 
$image_height,$width, $height); 
    ob_start(); 
    if($userfile_type == "image/jpeg" OR $userfile_type == "image/pjpeg"){ 
        imagejpeg($dest_img); 
    } 
    if($userfile_type == "image/gif"){ 
           imagegif($dest_img); 
    } 
    if($userfile_type == "image/png" OR $userfile_type == "image/x-png"){ 
        imagepng($dest_img); 
    } 
    $binaryThumbnail = ob_get_contents(); 
    ob_end_clean(); 
    ob_start(); 
    if($userfile_type == "image/jpeg" OR $userfile_type == "image/pjpeg"){ 
        imagejpeg($i_dest_img); 
    } 
    if($userfile_type == "image/gif"){ 
        imagegif($i_dest_img); 
    } 
    if($userfile_type == "image/png" OR $userfile_type == "image/x-png"){ 
        imagepng($i_dest_img); 
    } 
    $binaryImage = ob_get_contents(); 
    ob_end_clean(); 
    if(!get_magic_quotes_gpc()){ 
        $binaryThumbnail=addslashes($binaryThumbnail); 
        $binaryImage=addslashes($binaryImage); 
    } 
    $blob_arr['image']=$binaryImage; 
    $blob_arr['thumb']=$binaryThumbnail; 
    $blob_arr['type']=$userfile_type; 
} 
if($_POST['submit']){ 

    
    
//    $Rs = mysql_query("SELECT * FROM funny_test WHERE id = 
'".mysql_insert_id()."'") or die(mysql_error()); 
//    $row_Rs = mysql_fetch_assoc($Rs); 
//    header( "Content-type: ".$row_Rs['typ'].""); 
//    echo $row_Rs['thb']; 










}else{ 
?> 
<form name="form1" method="post"  enctype="multipart/form-data" action="<?php 
echo $PHP_SELF; ?>"> 
  <input id="userfile"  name="userfile" type="file" /> 
  <input type="submit" name="submit" value="Submit" /> 
</form> 
<?php 
} 
?> 



      

--- End Message ---

Reply via email to