If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports
web standards, although its content is accessible to any browser or Internet device.
Posted: 3/26/03 1:39 pm ez URL- Determine the Board's ID, ForumID, etc. With CodeUPDATED ezURL - this updated version works with the new naming structure which will come into place after the co-location move. All servers will be use the subdomain of pXX instead of bXX or pubXX. This update has NOT been made yet on individual *****s that include the ezURL, only on this master thread so far.
(updated version - should now handle all possible (modern) ezBoard URLs. has not been extensively tested, but works in IE 6 sp1 and NS 7)
Summary: Determine the board's URL with code instead of editing variables in the script. Store the other page information in variables instead of using document.location.indexOf throughout your scripts.
Details:
A lot of scripts have variables you have to change to put in your board's name or some other value which is in the URL of each board page.
A lot of scripts look at document.location.href to determine whether to do something.
For example, if you want something only on the main board page, or only on a specific forum, or only on topic pages, etc.
Most of these scripts use the method "indexOf" to determine if a particular string is contained within the current page's URL. This can be imprecise. For example, when you want to put a specific banner or other item on your "frm1" and a different specific item on your "frm11" you will run into trouble....
The solution is to use this code to deconstruct the ezboard page's URL into it's component parts:
ezPub -- what pub server are we on
ezFullPub -- full hostname of pub, i.e. pub99, beta, inbox, etc.
ezIsBoard -- am I on the main board page or a sub-page?
ezBoardID -- what is the "id" of the board?
ezForum -- what forum am I in (in the form of "frmXX")
ezPage -- what page am I on? "showMessage"? "addReply"?
ezQuery -- what variables were passed to this page? "topicID=XX.topic"?
Thus, code such as this:
if ( document.location.href.indexOf("http://pub11.ezboard.com/fcooltipsntricksfrm4") != -1 ) {
...
}
can be replaced with:
if ( ezForum == "frm4" ) {
...
}
For this page, http://beta.ezboard.com/fcooltipsntricksfrm4.showMessage?topicID=973.topic, it would do this:
ezPub would be "beta"
ezIsBoard would be false
ezBoardID would be "cooltipsntricks"
ezForum would be "frm4"
ezPage would be "showMessage"
ezQuery would be "topicID=973.topic"
This script is used in many of the other scripts offered here. Only one copy should be installed.
History:
4/28/2004 - updated for new servers (p)
8/21/2003 - regular expression rewritten to be more efficient
7/27/2003 - fixed bug with multi-page forums
4/1/2003 - fixed bugs with .boardStats pages, etc.
3/31/2003 - completely re-written by phalen180.
8/7/2007 - fixed to work with SEO urls
Credits:
phalen180
Note:
This version also should fix the error in which URLs of the format:
Posted: 4/26/04 3:57 pm Re: Determine the Board's ID, ForumID, etc. With Code
After the move to the new co-location you'll need to change your ezURL script again. You can change it prior to the move to prevent your scripts from failing to work - as long as I've edited this correctly...
ezboard moderator aka LvsRattlrs
ezSupporter
Posts: 34
Posted: 8/7/07 4:29 pm Re: Determine the Board's ID, ForumID, etc. With Code
http://p103.ezboard.com/fezscriptsfrm4.showMessage?topicID=106.topic
For better search engine optimization, ezboard has changed some of the urls on your boards to include thread or forum titles. While this will help get your boards noticed by search engines, it has broken the ezURL script which many scripts rely on to work properly. The script below is a fixed version which will work with your new urls. Simply replace the version on your board with the one in this post.