1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

show event month on page

Discussion in 'General' started by kim, Jul 18, 2005.

Thread Status:
Not open for further replies.
  1. kim

    kim New Member

    Hi
    Is it possible to show text on the page which will pick up the event month

    I have an event list and would like to show something like
    "Here are events for [monthname]"

    Eg page would show Here are events for July etc

    Kim
     
  2. ve9gra

    ve9gra Support Team

    You could use the $mo and $mth variables for that purpose... Basically, if $mo hasn't been defined, then it's this month. If it is defined, then get the month name for that month's number from $mth.

    If you paste this code somewhere after
    PHP:
    <?php $OL=1; require("calendar.php"); ?>
    but before the last
    PHP:
    <?php require("calendar.php"); ?>
    it should give you exactly what you're looking for.
    PHP:
    if (!defined($_REQUEST["mo"])){
        
    $mo date("n"); // yes this is "n" not "m"
    } else {
        
    $mo $_REQUEST["mo"];
    }

    echo 
    "Here are events for ".$mth[$mo]."<br>";
     
Thread Status:
Not open for further replies.

Share This Page