Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 12:01:52 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155504 Posts in 21710 Topics by 7736 Members
Latest Member: deenangle
* Home Help Search Login Register
Pages: 1 2 3 [4] 5   Go Down
Print
Author Topic: New calendar module "concert calendar"  (Read 11319 times)
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #75 on: May 07, 2011, 09:26:01 AM »

hi, here is another droplet for concertcalendar.
it is an adaption from this thread:
http://www.websitebaker2.org/forum/index.php/topic,15895.msg111239.html#msg111239

the droplet is a english version, but everybody can set his own language/locale in the droplet at line 12.
also the path to the calendar-page must changed at lines 30 and 33.

update: the droplet shows a mini-calendar with links to each concert.

droplet-code:
Code:
global $wb, $database;

$days = array();
$day_name_length = 2;
$month_href = NULL;
$where = NULL;
$first_day = 1;
$pn = array();
$events = 0;

$oldlocale = setlocale(LC_TIME, NULL); #save current locale
setlocale(LC_TIME, 'en_EN');

if(!isset($year))  {$year  = date('Y', time()); };
if(!isset($month)) {$month = date('n', time()); };
if ( isset( $section ) ) { $where = "AND section_id='$section'"; }

$today = date('j',time());

// Get Events from "Concert Calendar"
$sql    = "SELECT concert_date, DAY(concert_date) AS day, concert_name AS descr FROM ".TABLE_PREFIX."mod_concert_dates WHERE YEAR(concert_date) = '$year' AND MONTH(concert_date) = '$month' $where";
$result = $database->query($sql);
if ( $result->numRows() > 0 ) {
    while( $row = $result->fetchRow() ) {
        $text = $row['day'];
        if ( ! empty( $row['descr'] ) ) {
            $text .= ' <span>'.$row['descr'].'</span>';
        }
        if ( ! empty( $row['url'] ) ) {
            $days[ $row['day'] ] = array(NULL,NULL,"<span style='font-weight: bold; border: 1px solid #f00;'>"."<a class='tooltip' href='http://yourdomain.com/pages/concert.php?date=".$row["concert_date"]."' title='".$row['descr']."'>".$row['day']."</a></span>" );
        }
        else {
            $days[ $row['day'] ] = array(NULL,NULL,"<span style='font-weight: bold; border: 1px solid #f00;'>"."<a class='tooltip' href='http://yourdomain.com/pages/concert.php?date=".$row["concert_date"]."' title='".$row['descr']."'>".$row['day']."</a></span>");
        }
        $events++;
    }
}

if ( ! isset( $days[$today] ) ) {
    $days[$today] = array( NULL, 'calendar-today' );
}

$first_of_month = gmmktime(0,0,0,$month,1,$year);
#remember that mktime will automatically correct if invalid dates are entered
# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
# this provides a built in "rounding" feature to generate_calendar()

$day_names = array(); #generate all the day names according to the current locale
for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday
   $day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name

list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
$weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day

$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year;  #note that some locales don't capitalize month and day names
// reset locale
setlocale(LC_TIME, $oldlocale);

#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
@list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.htmlspecialchars($pl).'">'.$p.'</a>' : $p).'</span>&nbsp;';
if($n) $n = '&nbsp;<span class="calendar-next">'.($nl ? '<a href="'.htmlspecialchars($nl).'">'.$n.'</a>' : $n).'</span>';
$calendar = '<table class="calendar">'."\n".
   '<caption class="calendar-month">'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";

if($day_name_length){ #if the day names should be shown ($day_name_length > 0)
   #if day_name_length is >3, the full name of the day will be printed
   foreach($day_names as $d)
      $calendar .= '<th abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';
   $calendar .= "</tr>\n<tr>";
}

if($weekday > 0) $calendar .= '<td colspan="'.$weekday.'">&nbsp;</td>'; #initial 'empty' days
for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
   if($weekday == 7){
      $weekday   = 0; #start a new week
      $calendar .= "</tr>\n<tr>";
   }
   if(isset($days[$day]) and is_array($days[$day])){
      @list($link, $classes, $content) = $days[$day];
      if(is_null($content))  $content  = $day;
      $calendar .= '<td'.($classes ? ' class="'.htmlspecialchars($classes).'">' : '>').
         ($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
   }
   else $calendar .= "<td>$day</td>";
}
if($weekday != 7) $calendar .= '<td colspan="'.(7-$weekday).'">&nbsp;</td>'; #remaining "empty" days
$calendar .= "</tr>\n</table><br />\n";

if ( $events == 0 ) {
    $calendar .= 'No concerts for this month.<br /><br />';
}
else {
    $calendar .= $events.' '.'Concert'
              .  ( $events > 1 ? 's' : '' )
              .  ' for this month.<br /><br />';
}

return $calendar;

tests and feedbacks are welcome.

dbs

« Last Edit: May 22, 2011, 10:26:26 AM by dbs » Logged

Argos
Moderator
**
Offline Offline

Posts: 2158


WWW
« Reply #76 on: May 10, 2011, 04:04:23 PM »

I like this moduel, but there doesn't seem to be any paging, or browsing through months or something. If you 1 or more events each day, then the output is 1 giant list. Not very useful.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #77 on: May 10, 2011, 04:38:50 PM »

you mean the upcoming list?
you're right.
maybe a fixed height with scrollbar is usefull in that case.(?)
Logged

Argos
Moderator
**
Offline Offline

Posts: 2158


WWW
« Reply #78 on: May 10, 2011, 04:44:29 PM »

you mean the upcoming list?
you're right.
maybe a fixed height with scrollbar is usefull in that case.(?)

Yes, I mean the upcoming list. This module could be used as a general calendar, but then it needs to show either a calendar, or some other way to show only events of that month, and the possibility to browse through the months. Just like most other calendars.

I like the way the event details are shown/hidden. Would even be better that only details for 1 event are shown when clicked on the title. When clicked another title, that event is shown, and the other one closed.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #79 on: May 14, 2011, 05:14:49 PM »

nice ideas argos.
maybe a coder have time for this. i can only copy&paste-"coding"...
Logged

dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #80 on: May 14, 2011, 08:25:53 PM »

Quote
Would even be better that only details for 1 event are shown when clicked on the title. When clicked another title, that event is shown, and the other one closed.

here is a try
from view.php line 117, replace with :
Code:
<script type="text/javascript">
<!--
var last;

function toggle_visibility(id) {
if (document.getElementById) {
if(last)last.style.display = "none";
e=document.getElementById(id)
if (e.style.display == "block")e.style.display = "none";
else e.style.display = "block";
last=e;
}

   
//-->
</script>
Logged

hausl78

Offline Offline

Posts: 22


« Reply #81 on: May 17, 2011, 02:51:57 PM »

Hello!

Great Module, thank you! Just one question:
http://cheapwineband.bplaced.net/pages/tour-ii.php

Should here not be the first "open" event the one from 04.09.2011 but the one 10.09.2011 is opend. Is this a Bug or do i made something wrong?

Thank you!
Juergen
« Last Edit: May 17, 2011, 02:56:34 PM by hausl78 » Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #82 on: May 17, 2011, 03:12:05 PM »

hi, which version you are using?
this is the latest (2.1.4):
http://www.websitebaker2.org/forum/index.php/topic,13792.msg142974.html#msg142974
Logged

hausl78

Offline Offline

Posts: 22


« Reply #83 on: May 17, 2011, 05:03:12 PM »

Hello!

I had 2.1 and now updated to 2.1.4 but nothing seems to be changed

http://cheapwineband.bplaced.net/pages/tour-ii.php

Quote
Name:
Concert Calendar

Art:
Seite
 
Autor:
Bennie Wijs, Matthias Gallas, Rob Smith, Marc Geldon, Ploc, Andre Rauer, mod by dbs

Version:
2.1.4

Entworfen für:
Website Baker 2.7.x
 
Beschreibung:
Mit diesem Modul können Sie einen einfachen Konzertkalender in ihre Seite integrieren.

I have CMS V. 2.8.1, is this the problem?
« Last Edit: May 18, 2011, 07:11:50 AM by hausl78 » Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #84 on: May 17, 2011, 06:18:31 PM »

i see the next concert  4.9.  wink

ok now?
« Last Edit: May 17, 2011, 06:22:41 PM by dbs » Logged

hausl78

Offline Offline

Posts: 22


« Reply #85 on: May 17, 2011, 06:42:32 PM »

Yes, thats crazy.

First, I updated the module with the normal install function in the back end, but that first not helped - as you can see my prev. post.

So for now i did in the view.php some debug output (vars and sql-cmd) but counlt not find quick anything. So i was to lazy to remove the debug output i copied manuell the view.php from the install-zip with the FTP in to the folder and now it seems to work.. crazy...

thanks !
Juergen
Logged
hausl78

Offline Offline

Posts: 22


« Reply #86 on: May 18, 2011, 08:58:03 AM »

Hi!

On my produtive Page it is the same than abov descirbed. If i make the update to 2.1.4 via Backend it still wont work. But if i then copy the view.php via FTP on the host it works. May be there is a Bug in the Update-Routine?

Allthougt it works now - thanks!

greets
Juergen
Logged
vixrealitum

Offline Offline

Posts: 9


« Reply #87 on: May 19, 2011, 02:54:52 PM »

Hi

I use this dropplet (list) and I have a small problem.

How to make a short link only in the droplet title?

I want to link only had 30 characters and then the rest will be shortened to ...


 E.g. -->  19/06/2011 Event tittle abcdef....

Logged
D72

Offline Offline

Posts: 253


« Reply #88 on: May 19, 2011, 03:07:50 PM »

Hi
I use this dropplet (list) and I have a small problem.
How to make a short link only in the drople title?

I want to link only had 30 characters and then the rest will be shortened to ...

 E.g. -->  19/06/2011 Event tittle abcdef....

Agree, i would like to know that too. I had some situations  that i had to solve the height of the headlines, but a truncated headline would be the best option.
Also a direct link of each concert. Right now the droplet only shows the headline of the concert and it would be nice if every headline is linked to each detail page.
Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #89 on: May 19, 2011, 03:22:48 PM »

hm, at the moment the droplet get_concerts_detail show the next concert(s) as link to each detail:
date
title

right?

you (both) want as link:
date title

right?

look in the droplet-code, line 13:
Code:
   $mod_list .= '<a href="'.WB_URL.'/pages/your-concertcalender.php?date='.$row["concert_date"].'"><span class="c_date">'.$row["Datum"].'</span><br />';
   $mod_list .= '<span class="c_name"><b>'.$row["concert_name"].'</b></span></a><br />';

remove the <br> at the end of line 13
« Last Edit: May 19, 2011, 03:27:52 PM by dbs » Logged

D72

Offline Offline

Posts: 253


« Reply #90 on: May 19, 2011, 03:26:36 PM »

 wink
I have a slight thought we misunderstand each other.
I'll check it tonight when i got home.
The droplet isn't updated lately, right? I also remember that we (you and i) worked on it together and we didn't could came up with a solution for it. The intention was to give the headlines a link to the concert. Just like the date is linked in the default concert module.
But i will test the latest droplet later today.
Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #91 on: May 21, 2011, 03:27:18 PM »

at the moment the droplets works so: DEMO
Logged

marmot

Offline Offline

Posts: 205


« Reply #92 on: May 22, 2011, 04:38:04 AM »

Hello,
maybe this helps someone out. It's a list of concerts, lines can be shortened and links lead to the days details.It's adapted from http://www.websitebaker2.org/forum/index.php/topic,13792.msg140434.html#msg140434. There might be some probs in Date handling and the link to "konzert.php" has to be patched to your installation of wb.
Code:
<?php
// Get_Concerts
global $database$wb;
// Show how many items, defaults to 10?
if ( !isset($max) ){    $max 10; };
if ( !isset(
$stringLimit) ){    $stringLimit 40; };
// Fetch the items
$mod_query $database->query("SELECT DATE_FORMAT(concert_date,'%d.%m.%Y') as Datum, concert_date, concert_name, concert_desc FROM ".TABLE_PREFIX."mod_concert_dates ".
WHERE  concert_date >= CURRENT_DATE  "
." ORDER BY concert_date ASC "." LIMIT ".$max
);
   
$mod_list "<ul>";
while ( 
$row $mod_query->fetchRow()){
   
$name $row["concert_name"];
   
$desc strip_tags($row["concert_desc"]);
   if (
strlen($name) > $stringLimit) {
     
$parts explode("\n"wordwrap($name$stringLimit"\n"));
     
$name $parts[0]."...";
     
$desc "";
   } else if (
strlen($name) + strlen($desc) > $stringLimit) {
     
$parts explode("\n"wordwrap($desc$stringLimit strlen($name) -1"\n"));
     
$desc $parts[0]."...";
   }
   
$mod_list .= '<li><a href="konzert.php?date='.$row['concert_date'].'"><span class="c_date">'.$row["Datum"].'</span> ';
   
$mod_list .= '<span class="c_name">'.$name.'</span> ';
   
$mod_list .= '<span class="c_desc">'.$desc.'</span></a></li>';
}
$mod_list .= "</ul>";
return 
$mod_list;
?>
regards
Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #93 on: May 22, 2011, 07:30:58 AM »

it works, marmot.

- if the name or description is formated, they will be not displayed.
  (only my problem. i use fck-editor in the backend for styling)

- line 22, maybe better with WB_URL?:
Code:
$mod_list .= '<li><a href="'.WB_URL.'/pages/your-calender.php?date='.$row['concert_date'].'"><span class="c_date">'.$row["Datum"].'</span> ';
« Last Edit: May 22, 2011, 10:28:10 AM by dbs » Logged

marmot

Offline Offline

Posts: 205


« Reply #94 on: May 22, 2011, 10:45:43 AM »

Hello,
hmm, do you mean the name or description isn't shown at all when it's formated or just the format ist lost? The format is lost because of the surrounding <span> tags. It's ment to set a different style for date, name and desc in your .css file but of course you can just leave the <span> tags. I use FCK also and it's always surrounding the desc by a <p> tag, which means the desc is in a second line. But I wanted just one line. That was the reason for me to delete the given format of desc with strip_tags. I'm afraid everyone wants a different style for his page  smiley and my main intention was to show how line shortening could be done.

regards
Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #95 on: May 22, 2011, 11:04:16 AM »

i mean the name and the desc is not shown (not unformated).
above your post is a DEMO-link. your droplet ist testet there.
some users want the concert_names with different colors, fonts, pics ... so they are  grin

in my droplet get_concerts_detail this ist not a problem.

you have done what D72 needed.
Logged

dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #96 on: May 22, 2011, 03:57:03 PM »

with:
Code:
$name = strip_tags($row["concert_name"]);
the problem is solved for me.  wink
(have fck for name and for desc)
Logged

D72

Offline Offline

Posts: 253


« Reply #97 on: May 31, 2011, 10:35:40 AM »

Marmot,
This is excelent work! You have no idea how happy i am with this droplet.
This one should definitely be on the AMASP website.
Thank you very much for you work on this!

Hello,
maybe this helps someone out. It's a list of concerts, lines can be shortened and links lead to the days details.It's adapted from http://www.websitebaker2.org/forum/index.php/topic,13792.msg140434.html#msg140434. There might be some probs in Date handling and the link to "konzert.php" has to be patched to your installation of wb.
Code:
<?php
// Get_Concerts
global $database$wb;
// Show how many items, defaults to 10?
if ( !isset($max) ){    $max 10; };
if ( !isset(
$stringLimit) ){    $stringLimit 40; };
// Fetch the items
$mod_query $database->query("SELECT DATE_FORMAT(concert_date,'%d.%m.%Y') as Datum, concert_date, concert_name, concert_desc FROM ".TABLE_PREFIX."mod_concert_dates ".
WHERE  concert_date >= CURRENT_DATE  "
." ORDER BY concert_date ASC "." LIMIT ".$max
);
   
$mod_list "<ul>";
while ( 
$row $mod_query->fetchRow()){
   
$name $row["concert_name"];
   
$desc strip_tags($row["concert_desc"]);
   if (
strlen($name) > $stringLimit) {
     
$parts explode("\n"wordwrap($name$stringLimit"\n"));
     
$name $parts[0]."...";
     
$desc "";
   } else if (
strlen($name) + strlen($desc) > $stringLimit) {
     
$parts explode("\n"wordwrap($desc$stringLimit strlen($name) -1"\n"));
     
$desc $parts[0]."...";
   }
   
$mod_list .= '<li><a href="konzert.php?date='.$row['concert_date'].'"><span class="c_date">'.$row["Datum"].'</span> ';
   
$mod_list .= '<span class="c_name">'.$name.'</span> ';
   
$mod_list .= '<span class="c_desc">'.$desc.'</span></a></li>';
}
$mod_list .= "</ul>";
return 
$mod_list;
?>
regards
Logged
D72

Offline Offline

Posts: 253


« Reply #98 on: August 30, 2011, 02:39:32 PM »

I installed a fresh WB and downloaden te latest version of the Concert calendar.
When i test the calendar and create a new concert, WB says it's succesfully saved, but the concert isn't saved at all.
I fill all input fields, except the wysiwyg editor.
When i type something in the wysiwyg editor, the concert is finally saved.
So, some how i need to fill something in the editor, otherwise the concert won't be saved.
I can't find this problem on the forum. Could this be a 'new' problem?
Logged
dbs
WebsiteBaker Org e.V.

Online Online

Posts: 3714


WWW
« Reply #99 on: August 30, 2011, 03:35:07 PM »

My concercalender has wysiwyg for title and for decsription.
there is  possible give only title and desc can be blank.
maybe a solution for you: http://www.websitebaker2.org/forum/index.php/topic,20075.msg135506.html#msg135506
Logged

Pages: 1 2 3 [4] 5   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!