Go Back  FlyerTalk Forums > Travel&Dining > Travel Technology
Reload this Page >

Question for any php coders....

Community
Wiki Posts
Search

Question for any php coders....

Thread Tools
 
Search this Thread
 
Old Jul 21, 2007, 8:10 pm
  #1  
Original Poster
 
Join Date: Mar 2004
Location: NYC, CDG, NCE
Programs: DL DM
Posts: 2,633
Question for any php coders....

Browsing FT, I always think about this:

My Thinkpad X60 has dedicated browser 'page fwd' and 'page back' keys on the keyboard. I love the back key, but wish that the forward key could be mapped to the 'next page' or 'next thread' link on the page.

(Come to think of it, it should probably work on any keyboard. The question is can you link code to a keystroke?)

Is that possible? Either in the code or as an applet or setting on the client side or something else?

Anyone know off the top of their head?

As I think about it, I wonder if there a security risk in allowing code to be executed by a keystroke. Then again, you can tab around a page and hit the enter key to follow an html link.

Inquiring minds want to read FT faster....

Thanks
remyontheroad is offline  
Old Jul 22, 2007, 4:39 am
  #2  
 
Join Date: Nov 2003
Location: San Diego, CA USA
Posts: 534
No, not so easily.

The 'page back' and 'page forward' buttons on the browser works because the browser obviously know what page it loaded before, and 'page forward' will work only if you have used 'page back'.

The 'next page' or 'next thread' link is dynamic. It contains information that is dependant on the forum you are visiting (in this case, flyertalk.com) and what topic you are reading (hover over the next thread, 't='), etc. As you hover over 'next thread' and 'next page' in other threads, notice how they differ. Each topic has it's own identifier (in this case, 716849).

Now, if you can find a program that will search a page for the text, 'next thread' and "click" it, that may work, however I did not find anything viable.
sdsvtdriver is offline  
Old Jul 23, 2007, 9:07 am
  #3  
Original Poster
 
Join Date: Mar 2004
Location: NYC, CDG, NCE
Programs: DL DM
Posts: 2,633
Thanks for the reply.

Yes, I understand that it's a dynamic link.

Maybe that would have been better terminology to phrase the question with, but that was my point.

Is there any kind of code that could be written into the page that could be called/invoked by mapping a keystroke to it.

I guess the answer is no, or someone would have pointed it out, or implemented it by now.
remyontheroad is offline  
Old Jul 23, 2007, 5:55 pm
  #4  
jdn
 
Join Date: May 2003
Location: SJC/SFO and LGB/SNA/LAX
Programs: WN A-List, HHonors Gold (Ex AA PLT and HH Diamond)
Posts: 169
Yes, I think this can be done. And yes, while it would be nice to have it supported in the PHP code that runs vBulletin, I think you can set this up yourself, especially if you are the tinkering type.

First, you have to be willing to use 3 programs / extensions:
1. Firefox (web browser)
2. GreaseMonkey (extension for Firefox)
3. AutoHotKey (key macro / remapping program)

(Note, #3 may not be necessary for you... I forget how the IBM thinkpad back/forward buttons are mapped - you may be able to do this directly in your ibm software. However, you may find it useful for other uses.)

The quick rundown...
Use Firefox because it supports GreaseMonkey. I think I heard something about an IE-compatible something that did similar things, but I haven't looked into it myself.

GreaseMonkey lets you create/install a script that will re-write the code of webpages, usually to add extra information, change the layout, or provide added functionality.

What you may not have known is that there is HTML code that lets you assign "access keys" to links. Try it now... press ctrl-3 right now (maybe alt-3?). It should bring up the printable view of this thread. There are a number of these access keys programmed in to the vBulletin pages... alas, not for the next thread link, though.

You will want to use greasemonkey to rewrite the page to add in the code to assign an accesskey for the next thread. The HTML code looks like this:

<a href="linkhere.php?parameters" accesskey="r">
will change the link for linkhere.php to have an access key of ctrl-r.

Use greasemonkey to find the Next Thread link, add the access key code, and voila. Keyboard access to the next thread.

Then, either use AutoHotKey or your keyboard software to remap the key combination or button to the new accesskey you setup, and you now have your forward button for the next thread.
jdn is offline  
Old Jul 24, 2007, 12:38 am
  #5  
 
Join Date: Jun 2004
Location: www.percussionking.com
Programs: UA Alluminum =-D
Posts: 173
Place your forward button in a convenient location like at the top-left corner of the web page and make sure it travels when the page scrolls.

As for the key press, default-tab to this button when the page loads so the user can press "Enter" to cycle through pages.
percussionking is offline  
Old Jul 24, 2007, 6:31 am
  #6  
Original Poster
 
Join Date: Mar 2004
Location: NYC, CDG, NCE
Programs: DL DM
Posts: 2,633
Excellent!

Thanks guys. ^

Two interesting options to check out. I'll start tinkering and see what I can come up with.
remyontheroad is offline  
Old Jul 24, 2007, 11:26 am
  #7  
Original Poster
 
Join Date: Mar 2004
Location: NYC, CDG, NCE
Programs: DL DM
Posts: 2,633
Originally Posted by remyontheroad
Thanks guys. ^

Two interesting options to check out. I'll start tinkering and see what I can come up with.
Well, after downloading and installing greasemonkey and engaging in a bit of tinkering, poking and checking out sample scripts, I've come to the conclusion that it's over my head.

IF anyone feels like writing it, I bet it'd be a popular doo-dad, but for the moment, I'll just have to use the mouse.

remyontheroad is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.