WordPress.org

Ready to get started?Download WordPress

Forums

[PLUGIN: Kino Events Calendar] (1 post)

  1. s0206
    Member
    Posted 3 years ago #

    Hi Guys

    I am using the Kino Events Calendar and would like to implememt some pagination on the page that displays the events.

    At the momemt all the events are displayed is one very long list.

    I'm not sure how to go about achieving this. Here is the code for the page:

    <?php
    global $table_prefix;

    // IF NO EVENT SELECTED SHOW MAIN
    if(!isset($_GET['evt']) || empty($_GET['evt']))
    {
    $today = date("Y-m-d");

    // GET FORTHCOMING EVENTS
    $query = "SELECT * FROM ".$table_prefix."ke_events WHERE event_start_date >= '".$today."' AND event_status = 1 ORDER BY event_start_date LIMIT 0, 3";

    $ke_events = db_get_rows($query);

    // NEED TO GET THE URL FOR THE EVENTS DESTINATION PAGE
    $query = "SELECT * FROM ".$table_prefix."ke_settings
    WHERE ".$table_prefix."ke_settings.setting_id = 1";
    $ke_settings = db_get_rows($query);

    if(count($ke_events))
    {
    ?>

    <?php
    foreach($ke_events as $x)
    {
    if(get_option("permalink_structure") != "")
    //if(strstr($_SERVER['REQUEST_URI'], "?"))
    {
    $event_url = get_permalink($ke_settings[0]['setting_wp_page'])."?evt=".$x['event_slug'];
    }
    else
    {
    $event_url = get_permalink($ke_settings[0]['setting_wp_page'])."&evt=".$x['event_slug'];
    }
    ?>
    <div class="search-result vevent">
    <h3>"><span class="summary"><?php print stripslashes($x['event_title']); ?></span></h3>
    <p>
    <?php
    // IF START DATE
    if(!empty($x['event_start_date']))
    {
    print "<span style=\"display:none;\" class=\"dtstart\">".$x['event_start_date']."</span>";
    ?><?php print date("jS F Y", strtotime($x['event_start_date']));
    // IF START TIME
    if($x['event_start_time'] && $x['event_start_time'] != "00:00:00" && $x['event_start_time'] != "NULL")
    {
    print ", ".date("G:i", strtotime($x['event_start_date']." ".$x['event_start_time']));
    // IF END TIME
    if($x['event_end_time'] && $x['event_end_time'] != "00:00:00" && $x['event_end_time'] != "NULL")
    {
    print " - ".date("G:i", strtotime($x['event_start_date']." ".$x['event_end_time']));
    }
    }
    ?>

    <?php
    }
    ?>
    <?php
    if(!empty($x['event_location']))
    {
    ?>

    Location: <span class="location"><?php print $x['event_location']; ?></span>
    <?php
    }
    ?>
    </p>

    <p><?php print stripslashes($x['event_detail']); ?></p>

    <?php

    ?>
    <p>">More details</p>
    </div>
    <?php
    }
    //print "<p style='border-bottom: 1px solid #e8e8e8;'/>";
    print "<br style='clear:both;' />";
    }
    else
    {
    $no_forthcoming_events = true;
    }// END IF

    if($no_forthcoming_events && $no_past_events)
    {
    ?>
    <p>There are no events to list.</p>
    <?php
    }

    }
    // IF EVENT SELECTED SHOW EVENT - INDIVIDUAL EVENTS PAGE
    else
    {
    $_GET['evt'] = urlencode(stripslashes($_GET['evt']));

    $query = "SELECT * FROM ".$table_prefix."ke_events WHERE event_slug = '".mysql_real_escape_string($_GET['evt'])."'";
    //print $query;
    $ke_event = db_get_rows($query);
    $x = $ke_event[0];
    ?>
    <div class="vevent">
    <h3><span class="summary"><?php print stripslashes($x['event_title']); ?></span></h3>
    <p>
    <?php
    // IF START DATE
    if(!empty($x['event_start_date']))
    {
    print "<span style=\"display:none;\" class=\"dtstart\">".$x['event_start_date']."</span>";
    ?><?php print date("jS F Y", strtotime($x['event_start_date']));
    // IF START TIME
    if($x['event_start_time'] && $x['event_start_time'] != "00:00:00" && $x['event_start_time'] != "NULL")
    {
    print ", ".date("G:i", strtotime($x['event_start_date']." ".$x['event_start_time']));
    // IF END TIME
    if($x['event_end_time'] && $x['event_end_time'] != "00:00:00" && $x['event_end_time'] != "NULL")
    {
    print " - ".date("G:i", strtotime($x['event_start_date']." ".$x['event_end_time']));
    }
    }
    ?>

    <?php
    }
    ?>
    <?php
    if(!empty($x['event_location']))
    {
    ?>

    Location: <span class="location"><?php print $x['event_location']; ?></span>
    <?php
    }
    ?>
    </p>

    <p><?php print nl2br(stripslashes($x['event_detail'])); ?></p>

    <?php

    // NEED TO GET THE URL FOR THE EVENTS DESTINATION PAGE
    $query = "SELECT * FROM ".$table_prefix."ke_settings
    WHERE ".$table_prefix."ke_settings.setting_id = 1";

    $ke_settings = db_get_rows($query);

    ?>

    <p>
    <?php
    if(!empty($x['event_website']))
    {
    ?>
    ">For further details view: <?php print stripslashes($x['event_website']); ?>
    <?php
    }
    ?>
    </p>
    <p>
    <?php
    if(!empty($x['event_link']))
    {
    ?>
    ">Further information about this event
    <?php
    }
    ?>
    </p>

    <p>">All events</p>
    </div>
    <?php

    }
    ?>

    (I'm not sure if I am allowed to paste such large amounts of code into here, if not please can a mod remove it)

    If anyone could point me in the right direction, I would be very grateful, thanks!

    PS. I have tried a couple of php scripts for pagination but they didn't seem to work, not sure what I am doing wrong.

Topic Closed

This topic has been closed to new replies.

About this Topic