only allow x number of events to be veiwed
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_calsnails
View previous topic :: View next topic  
Author Message
shent69
Apprentice
Apprentice


Joined: 27 Oct 2003
Posts: 6

PostPosted: Tue Oct 28, 2003 5:27 am    Post subject: only allow x number of events to be veiwed Reply with quote

Is there a way to only show a certain number of events in the Calendar of Events? It seems to show all of the events that are schedule. I would only like to see only the next 3 up coming events.

Any help would be greatly appreciated
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Oct 28, 2003 6:23 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

Nice question! ...I'll add this option as a block parameter for next release. Smile

Let's try it, ok?
Code:
#
# ---[ OPEN ]----------------------
#
mx_calendar_events.php

#
# ---[ FIND ]----------------------
#
$sql .= "ORDER BY stamp, subject";

#
# ---[ REPLACE WITH ]----------------------
#
$sql .= "ORDER BY stamp, subject LIMIT 3";

#
# ---[ SAVE ]----------------------
#

You can also play with Events block settings (Range for Events and Days before/after range).

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
shent69
Apprentice
Apprentice


Joined: 27 Oct 2003
Posts: 6

PostPosted: Wed Oct 29, 2003 2:36 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

i couldn't make that work.

no error message just acted like i changed nothing.

any other ideas?
 
Back to top
View user's profile Send private message
shent69
Apprentice
Apprentice


Joined: 27 Oct 2003
Posts: 6

PostPosted: Wed Oct 29, 2003 3:59 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

I figured it out. Don't know if it the right way but it works
Code:
#
# ---[ OPEN ]----------------------
#
mx_calendar_query.php

#
# ---[ FIND ]----------------------
#
$sql .= " ORDER BY " . $query_order;

#
# ---[ REPLACE WITH ]----------------------
#
$sql .= "ORDER BY stamp, subject LIMIT 3";

#
# ---[ SAVE ]----------------------
#


I guess it llimits me to only ordering by date stamp, which is okay by me.
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Oct 29, 2003 4:02 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

LIMIT clausule is supported by MySQL, afaik, but not for all DB managers.

Which DB are you using? Confused

Well, the can be accomplished this way:
Code:
#
# ---[ OPEN ]-------------------
#
mx_calendar_events.php

#
# ---[ FIND ]-------------------
#
$check++;

#
# ---[ AFTER ADD ]-------------------
#
if( $check >= 3 ) break;   // use 3 or your desired limit

#
# ---[ SAVE ]-------------------
#

Hope that works!

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Oct 29, 2003 4:08 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

shent69 wrote:
I figured it out. Don't know if it the right way but it works
Code:
#
# ---[ OPEN ]----------------------
#
mx_calendar_query.php

#
# ---[ FIND ]----------------------
#
$sql .= " ORDER BY " . $query_order;

#
# ---[ REPLACE WITH ]----------------------
#
$sql .= "ORDER BY stamp, subject LIMIT 3";

#
# ---[ SAVE ]----------------------
#


I guess it llimits me to only ordering by date stamp, which is okay by me.

LOL. I posted previous answer at the same time.

...but are you trying to do it with mx_calendar_query.php or mx_calendar_events.php ?

For mx_calendar_query.php, you can do it like this:
Code:
#
# ---[ OPEN ]----------------------
#
mx_calendar_query.php

#
# ---[ FIND ]----------------------
#
if( $query_order != '' )
{
   $sql .= " ORDER BY " . $query_order;
}

#
# ---[ AFTER ADD ]----------------------
#
$sql .= " LIMIT 3";

#
# ---[ SAVE ]----------------------
#

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
shent69
Apprentice
Apprentice


Joined: 27 Oct 2003
Posts: 6

PostPosted: Wed Oct 29, 2003 4:16 am    Post subject: Re: only allow x number of events to be veiwed Reply with quote

sorry i was all messed up i trying with the query

It works

thank you for the help
 
Back to top
View user's profile Send private message
SoN!C
Starter
Starter


Joined: 22 Dec 2003
Posts: 3
Location: United Kingdom

PostPosted: Mon Dec 22, 2003 9:06 pm    Post subject: Re: only allow x number of events to be veiwed Reply with quote

well i tried to edit mx_calendar_events.php and i couldnt find

$sql .= " ORDER BY " . $query_order; or $check++; so i couldnt replace them is there another way to do it besides the query way cause i dont seem to have a query file Sad
 
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Dec 22, 2003 9:34 pm    Post subject: Re: only allow x number of events to be veiwed Reply with quote

Hi!

These are some possibilities to control the number of events reported by the Events block. ...but, just to remind, you can also filter by date range easilly through block parameters.

Are you sure you have the latest version of mx_calsnails? For instance, this code: $check++; is around line 238 in file mx_calendar_events.php.


Merry xmas, btw. Smile

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
SoN!C
Starter
Starter


Joined: 22 Dec 2003
Posts: 3
Location: United Kingdom

PostPosted: Mon Dec 22, 2003 9:56 pm    Post subject: Re: only allow x number of events to be veiwed Reply with quote

ok can u plz post a link to the calendar u said so i am sure to get the latest one Smile 
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Dec 22, 2003 10:11 pm    Post subject: Re: only allow x number of events to be veiwed Reply with quote

Well, the links to release info, demos and download area are visible in the home page.

Ask Santa :new_xmas: for good glasses, my friend! Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
SoN!C
Starter
Starter


Joined: 22 Dec 2003
Posts: 3
Location: United Kingdom

PostPosted: Mon Dec 22, 2003 10:31 pm    Post subject: Re: only allow x number of events to be veiwed Reply with quote

lol yes sir then when he comes down the chimney :new_snipersmilie: KAPOOW!! right between the eyes 
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_calsnails All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum