Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued Products: Article Manager 1 Add-ons:
Today's Articles Link

 

 


Benjamin
Staff


Mar 30, 2003, 10:51 AM

Post #1 of 1 (1761 views)
Shortcut
Today's Articles Link Can't Post

Hi everyone,

Here's a little script that allows you to put a link to "Today's Articles". It's easily modifiable to retrieve a different day, but hopefully it'll get you guys started. :-)






Between your <head></head> tags of your page, put the following code:

<script language="javascript">
<!--

// the following calculates the current date
var today = new Date();
yr = today.getYear();
mon = today.getMonth();
dy = today.getDate();

// a little function to populate the values in the todays_articles form, and
// submit it.
function getTodaysArticles() {
document.todays_articles.mon.value = mon+1;
document.todays_articles.day.value = dy;
document.todays_articles.year.value = yr;
document.todays_articles.mon2.value = mon+1;
document.todays_articles.day2.value = dy;
document.todays_articles.year2.value = yr;
todays_articles.submit();
}

-->
</script>


Then, within your page, put the following:


<form method="get" name="todays_articles" action="http://www.yoursite.com/path/to/search.cgi">

<input type="hidden" name="search" value="1">
<input type="hidden" name="perpage" value="10">

<input type="hidden" name="mon" value="">
<input type="hidden" name="day" value="">
<input type="hidden" name="year" value="">
<input type="hidden" name="mon2" value="">
<input type="hidden" name="day2" value="">
<input type="hidden" name="year2" value="">

<a href="#" onclick="getTodaysArticles();">View Today's Articles</a>
</form>


Now, when you click on "View Today's Articles", it'll return only those articles for the current date.

Drawbacks / concerns: (or 'disclaimer', depending on how you look at it ;-)

- It's written in javascript. So it won't work for javascript-disabled browsers.
- It assumes that the visitor's computer has the correct time and date - it retrieves articles based on the client's computer's clock.
- It doesn't account for different time zones.

Besides that, it should work fine! I've attach a demo html file to this post.
Ben
interactivetools.com

(This post was edited by Benjamin on Apr 2, 2003, 9:26 AM)
Attachments: getTodaysArticles.html (1.33 KB)

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4