Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

paging like google

Posted on 2008-10-02
5
Medium Priority
?
1,063 Views
Last Modified: 2012-06-21
when you search anything in google, at the bottom of the page there is a Gooooooooogle. and the page number correspond to the word "o". i'm trying to understand that concept but i can't. could someone explain to me how they do it? i can get the page to display 1 2 3 4 5 but to do the word i can't think of the way to approach. thanks guys
0
Comment
Question by:StewSupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 22630378
>> i can get the page to display 1 2 3 4 5 but to do the word
OK, but the links you currently have are really something like:
<a href="something.php?page=1">1</a><a href="something.php?page=1">2</a><a href="something.php?page=1">3</a>... 
The number between the <a></a> tags is irrelevant to your script. Your script only needs the number right after "page=".So what you can do is to define an array of letters:
$letters=array("","G","o","o","o","o","o","g","l","e"); 
and instead of printing 1, 2, 3 in between those <a> tags you would print:
$letters[$page]; 
echo "<a href='something.php?page=$page'>$letters[$page]</a>";

Open in new window

0
 

Author Comment

by:StewSupport
ID: 22632868
but then they also have the number at the bottom. does that mean they do it twice? and what if the number of page is 100 how does it know what to letter to repeat
0
 
LVL 82

Expert Comment

by:hielo
ID: 22638743
>>but then they also have the number at the bottom.
They are creating an html table. Each td of that table has a background image. Withing the td, they have the numeric links. The numeric links are positioned towards the bottom of the cell (td) and the height of each cell is beg enough so that the image appears on top of the numeric link
0
 

Author Comment

by:StewSupport
ID: 22659875
ok i understand that part. but how do i know when to repeat the Os' when and to not repeat the o and display the gles.
0
 
LVL 82

Accepted Solution

by:
hielo earned 1000 total points
ID: 22663514
>>but how do i know when to repeat the Os'
That depends on how many links you are generating for the pagination. The are using 10, but Google does not have 10, so they "DECIDED" to elongate the word by putting more Os. Whatever YOU are doing, it would be your call on which letter to elongate. In reference to my first post, this:
$letters=array("","G","o","o","o","o","o","g","l","e");

could very well be:
$letters=array("","S","t","e","e","e","e","w");

assuming you are providing a 7-link/number pagination.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question