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.

add navigation to event page.

Discussion in 'Customizations (Themes / Templates)' started by chris_nl, May 17, 2006.

Thread Status:
Not open for further replies.
  1. Hello,
    On my website:
    http://www.le-ri-crystal.nl/spiritueel/html/agenda.php

    I want to ad two navigation buttons to go to the next month.
    Just like when i use the admin, you see in the middle an field with
    [today] [month] [year] [go] [<--] [-->]

    these have a drop down function, can i ad this to my curent page?
  2. Brian

    Brian EPC Developer Staff Member

    If you're using the List Mode alone, you can create your own navigation.

    <?php
    $yb=$yr;
    $yf=$yr;
    $mb=$mo-1;
    if ($mb<1) {$mb=12; $yb=$yr-1;}
    $mf=$mo+1;
    if ($mf>12) {$mf=1; $yf=$yr+1;}

    $cmo = gmdate("m",time()+($gmt*3600)+($dayLight*3600));
    $cyr = gmdate("Y",time()+($gmt*3600)+($dayLight*3600));
    ?>

    Then create your links for back, current and next and add:

    backLink.php?mo=$mb&yr=$yb
    nowLink.php?mo=$cmo&yr=$cyr
    backLink.php?mo=$mf&yr=$yf
  3. Hello Brian, I am glad that it is possible,
    But i do not get it working with the php code.

    The total code i used is:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Spirituele agenda</title>
    <link rel="stylesheet" href="http://www.webdesign-cs.com/lericrystal/include/paranormaal.css" type="text/css">
    <?php $CSS=1; require("/home/lericr/domains/le-ri-crystal.nl/public_html/calendar/calendar.php"); ?>
    </head>
    <body>
    <p class="style5">spirituele activiteiten van deze maand: <br />
    </p>
    <table width="308" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="144">&nbsp;</td>
    <td width="56"></td>
    </tr>
    </table>
    <?php
    $LIST=1;
    $showCat=3;
    $DF = "M jS, Y (D)";
    $template="modern.php";
    require("/home/lericr/domains/le-ri-crystal.nl/public_html/calendar/calendar.php");?>
    <?php $OL=1; require("/home/lericr/domains/le-ri-crystal.nl/public_html/calendar/calendar.php"); ?>
    <?php
    $yb=$yr;
    $yf=$yr;
    $mb=$mo-1;
    if ($mb<1) {$mb=12; $yb=$yr-1;}
    $mf=$mo+1;
    if ($mf>12) {$mf=1; $yf=$yr+1;}
    $cmo = gmdate("m",time()+($gmt*3600)+($dayLight*3600));
    $cyr = gmdate("Y",time()+($gmt*3600)+($dayLight*3600));
    ?>
    </body>
    </html>
  4. Brian

    Brian EPC Developer Staff Member

  5. navigation

    I got the drop down date working :)

    But i still do not know how to create the navigation arrows <-- and -->

    I tried your code, but it does not work.

    http://www.le-ri-crystal.nl/calendar/demo2.php

    <?php
    $yb=$yr;
    $yf=$yr;
    $mb=$mo-1;
    if ($mb<1) {$mb=12; $yb=$yr-1;}
    $mf=$mo+1;
    if ($mf>12) {$mf=1; $yf=$yr+1;}
    $cmo = gmdate("m",time()+($gmt*3600)+($dayLight*3600));
    $cyr = gmdate("Y",time()+($gmt*3600)+($dayLight*3600));
    backLink.php?mo=$mb&yr=$yb
    nowLink.php?mo=$cmo&yr=$cyr
    backLink.php?mo=$mf&yr=$yf
    ?>

    Also i wanted to make a drop down for the categories, but when i
    looked it up in the section knowledge it said:
    "Please see the instructions for using the included Filter plugin."
    But i cannot find this instruction?

    Does anyone know how to do this? :1book:


  6. Brian

    Brian EPC Developer Staff Member

    This code should be out of the PHP section (afer the ?>)

    backLink.php?mo=$mb&yr=$yb
    nowLink.php?mo=$cmo&yr=$cyr
    backLink.php?mo=$mf&yr=$yf

    Each one should be a standard HTML link such as:

    <a href='demo2.php?mo=<?php echo $mb ?>&yr=<?php echo $yb ?'>Back</a>
  7. Hello Brian,
    The code for the link, does not work. :ugh:

    <a href='demo2.php?mo=<?php echo $mb ?>&yr=<?php echo $yb ?'>Back</a>

    Isn't there a sample page where on the left side you can see the kind of
    options to ad on a calender page. And on the right side to see the php source?
  8. Brian

    Brian EPC Developer Staff Member

    You appear to have moved all of the PHP code out of the PHP tags. Only the cide in post 6 should be out of the <?php ?> tags. Put the PHP tags back around:

    <?php
    $yb=$yr;
    $yf=$yr;
    $mb=$mo-1;
    if ($mb<1) {$mb=12; $yb=$yr-1;}
    $mf=$mo+1;
    if ($mf>12) {$mf=1; $yf=$yr+1;}
    $cmo = gmdate("m",time()+($gmt*3600)+($dayLight*3600));
    $cyr = gmdate("Y",time()+($gmt*3600)+($dayLight*3600));
    ?>
  9. That was correct, but that was because i was testing
    other options to make it work. I have put it back now to it was, but then it did not work either. Am i really the only one that want's to ad for the first time navigation to a calendar page?

    http://www.le-ri-crystal.nl/calendar/demo2.php
  10. Brian

    Brian EPC Developer Staff Member

    AFAIK on the List Mode calendar alone, yes.


    Your link looks incorrect:
    <a href='demo2.php?mo=4&yr=2006Back</a>

    Try this:

    <a href='demo2.php?mo=4&yr=2006'>Back</a>
  11. i missed a quote ' ..well it works, but do i need to fill in 2006?
    I mean, can it not reconize with year is selected and then navigate in it?

    Because this would mean that next year in 2007 i would have to replace the links to 2007.

    So i am really the first one who uses this kind of navigation :clap:
  12. Hey wait a minute, the first link you gave to me was:

    <a href='demo2.php?mo=<?php echo $mb ?>&yr=<?php echo $yb ?'>Back</a>

    That would be the one i guess, but this link did not work.

    And you replaced it by:

    <a href='demo2.php?mo=4&yr=2006'>Back</a>

    but that is totally different? And the above link does not seem to work..
  13. ve9gra

    ve9gra Support Team

    I can set it up for you for a [small] fee. Contact me using the link in my signature.
  14. thank, ve9gra, i could get some help with this.
    I will contact you. Maybe you can help me out for a small fee :)
Thread Status:
Not open for further replies.

Share This Page