Module: CalendarView
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
I've created yet another gallery 3 module. This one will display a calendar with a link leading to any photos that were taken on each day. It allows visitors to see which days in a year photos were taken on, and allows them to quickly pull up everything taken on a specific day or month. It can be downloaded from this post, or from my github account. [img]http://codex.gallery2.org/images/2/24/Calendarview.jpg[/img] ---
|
||||
Noob86
Joined: 2006-12-31
Posts: 34 |
![]() |
|||
Hi, how do I change the colors for a darker theme? http://www.bikesnstuff.net/gallery3/index.php/calendarview/calendar |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Noob86 wrote:
Hi, how do I change the colors for a darker theme? You'd have to modify the CSS code. Although looking at the link, you seem to have already figured that out |
||||
Noob86
Joined: 2006-12-31
Posts: 34 |
![]() |
|||
No I'm stumped actually. If I switch to the standard theme the No of Pictures (under the date) is blue. Switch to any dark theme and it becomes white, which is a bit hard to follow. I've only really found 2 colors, the background, and the hover, nothing else seems to make any difference. Oh, but do heed my username. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Noob86 wrote:
No I'm stumped actually. If I switch to the standard theme the No of Pictures (under the date) is blue. Switch to any dark theme and it becomes white, which is a bit hard to follow. It's using the "default" link colors specified by whatever the current theme is. I'm not sure how to change it without editing the theme (and changing it for every link). |
||||
Noob86
Joined: 2006-12-31
Posts: 34 |
![]() |
|||
thats good to know, perhaps we just need to add its "own" css, so that it can be portable between themes then? |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
rWatcher, 2. Can clicking the month show the items for the month clicked? 3. I am no UI expert but a more visual highlight of the day with items via CSS and the total number, say onMousover show the quantity, would make a bit more sense to me. For example: don't change the color of days that have no items even on mouseOver. Make the days with items, a different class, and have the mouseover tooltip display the quantity of items. 4. I think the 'go' button should be moved to the right of the drop-downs, or better yet, change the view when the user changes the drop-down(s). One less click. 5. The view of the items, after clicking on the date, should have a breadcrumb to the calendar ( back button ) I really like this module and have tried to implement something similar with: Great stuff! Thanks _____________________________________________ |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
I installed the calender, and it shows fine. If you name the frames and hover etc. the same classes that are used in the main css, it's all controlled in one place. I guess everyone will want consistency within their site anyways. Issues: Is it possible to load the menu on the right side? all the best |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Basic stuff: You start the calender week on sunday. Is that standard where you are from? Here a week starts on monday. Adding week number to the calender, is that possible (Monday to Sunday)? Thanks for the module - looks promising all the best |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
rWatcher - general feedback Very nice work you are doing - The translation function for G3 is priceless, but it does not work for your modules Calender Did you give this any thought? all the best |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
Quote:
You start the calender week on sunday. Is that standard where you are from? Here a week starts on monday. edit libraries/Calendar.php Quote:
looks promising Sounds to me like a theme issue. Work in wind theme right? Dave |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Yes it works in Wind theme... I posted the issue under the theme thread. For personal reasons, Joe is not up to it for the time beeing. I will wait around. I will check out the calender start code, thanks all the best |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
The Code you refer to is not inthere.... all the best |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
Quote:
The Code you refer to is not inthere.... gallery3/modules/calendarview/libraries/Calendar.php Dave |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Perfect - found it and it works - mega thanks all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
floridave wrote:
rWatcher, Yes. (Done and uploaded to my github). floridave wrote:
2. Can clicking the month show the items for the month clicked? Yes. (Done and uploaded to my github). Although as the code is currently written, every month is click-able (even if the month doesn't have any photos associated with it). floridave wrote:
3. I am no UI expert but a more visual highlight of the day with items via CSS and the total number, say onMousover show the quantity, would make a bit more sense to me. For example: don't change the color of days that have no items even on mouseOver. Make the days with items, a different class, and have the mouseover tooltip display the quantity of items. Personally, I like having all of the quantities visible at once, without needing to mouse-over. That way you can quickly look over the calendar and easily distinguish between "major events" (were lots of photos were taken) and the more minor days were only a few photos were taken. floridave wrote:
4. I think the 'go' button should be moved to the right of the drop-downs, or better yet, change the view when the user changes the drop-down(s). One less click. To be honest, I'm really not sure why the Go button is on the left side to begin with. On the HTML and PHP level, its declared after everything else, so I would expect it to display after everything else :/ For now I've added some CSS to right-align the button, but I don't really like how that looks either. I'll probably end up looking into your suggestion to get rid of it once I get everything else working. floridave wrote:
5. The view of the items, after clicking on the date, should have a breadcrumb to the calendar ( back button ) The only way I could think of to add in breadcrumbs (while working within the dynamic.html page template) was to use the same system albums and photos use to link back to their parent album(s). Unfortunately Gallery seems to have been designed to only allow those breadcrumbs to point to albums... I think I've created a successful work-around to this (the code is currently on my github), but I want to do some more testing before I post it to the forum. floridave wrote:
I really like this module and have tried to implement something similar with: Wow, that definitely looks a lot more complex then mine. I can see users quickly getting confused trying to navigate threw a few years of photos on that |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Issues: I am aware of the image load issue between 3nids and a few of my modules, although at this time I have no idea what's causing it. hebhansen wrote:
Is it possible to load the menu on the right side? The user/year selection menu? Not really, the right side (on the default theme anyway, I don't know about 3nids) is filled with all the Gallery sidebar links. If the 3nids theme is different then you could probably create a custom view by copying the modules/calendarview/views/calendarview_year.html.php into the themes/3nids/views/ folder and changing the layout to fit better. hebhansen wrote:
rWatcher - general feedback I can look into it. Could you provide some specific examples of where the text is not translate-able? |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Quote:
I am aware of the image load issue between 3nids and a few of my modules, although at this time I have no idea what's causing it. I am pretty sure this is a 3nids issue for now. I have brought it to their attention and we will see from there Quote:
I can look into it. Could you provide some specific examples of where the text is not translate-able I don't know if you are familiar with the translation module. Maybe some core familiar people can help out to give rWatcher the API info for this. 1) You can activate translation in admin. At the bottom of screen it gives you the transmodule (this bottom translation ui dissapears when entering your pages) 2) Left column I can see whats tranlated and whats not 3) I pick nonetranslated and add a trans and submit. My site updates immediately and my input gets collected at the Gallery server for others to download. By now I have more or less evrything translated to Danish. (The French,Germans and Spanish seem to be fast asleep) An example of things to translate: everything in there using forward and backward dropdown text around, what's in the go button Again, I am not sure if these items are defined by classes or other. Could someone point rWatcher in the translation direction The module works really well and consistency is necessary for this to be valid at sites. Half a site translated seems a bit; made in Hong Kong in a hurry. all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
@hebhansen: |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Works fine thanks ... I still have the issue in the 3nids theme and not able to load the image pages... But thanks all the best |
||||
markmac
Joined: 2009-10-14
Posts: 89 |
![]() |
|||
I installed this mod, and works perfect for me! Only one weird problem. On the album pages, the image for the calendar link shows up with an icon that is not very meaningful... It is hard to describe, but it does not look like a calendar at all. For the life of me, I can not figure out where to change the icon to one a bit more meaningful. The icon in /gallery/modules/calendarview/images/ico-view-calendarview.png seems like a good icon to use, however that is not the one that is being displayed... Any ideas? |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
markmac wrote:
I installed this mod, and works perfect for me! Only one weird problem. On the album pages, the image for the calendar link shows up with an icon that is not very meaningful... It is hard to describe, but it does not look like a calendar at all. Does it look like the icon I circled in red? Alternately, you can manually insert the necessary CSS code by copying the contents of the file "modules\calendarview\css\calendarview_menu.css" and pasting it into the end of the "themes\THEMENAME\css\screen.css" file. If you do this you may also need to move the ico-view-calendarview.png file out of the calendarview\images folder and into the themes\THEMENAME\images folder. |
||||
markmac
Joined: 2009-10-14
Posts: 89 |
![]() |
|||
You are absolutely right! I was using an older git version... I updated to the latest, and it shows up fine! Thaniks for the help! Appreciate it |
||||
markmac
Joined: 2009-10-14
Posts: 89 |
![]() |
|||
Ok, I have determined that I have to revert back to the version I had before, because the latest version of gallery breaks the shopping basket mod... So until that gets updated, I have to revert back to my previous version.. I have tried moving the contents of the css file from modules\calendarview\css\calendarview_menu.css to the bottom of the screen.css file and moving the ico-view-calendarview.png file to the images folder of the theme, however it does not change the icon on the gallery.. Am I missing something? |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
markmac wrote:
Ok, I have determined that I have to revert back to the version I had before, because the latest version of gallery breaks the shopping basket mod... So until that gets updated, I have to revert back to my previous version.. Well, without actually knowing the exact revision of Gallery that you're using, my best guess is that it's a version from before the recent CSS changes. If that's the case, then you probably need to change the CSS code you copied into the screen.css file and replace the text "#g-view-menu" with "#gViewMenu", so that it looks like this: #gViewMenu #g-calendarview-link {
background-image: url('../images/ico-view-calendarview.png');
} |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
I agree to the idea of using existing CSS within existing Core. Is that possible for the module rWatcher Bharat made serious changes to the 3nids theme, so that it complies to G3 API and evertyhing is joined in a theme folder and no module folders as before. My site still don't lode Calender images. The same for latestupdates. Does anyone have the solution to this? all the best |
||||
markmac
Joined: 2009-10-14
Posts: 89 |
![]() |
|||
Thanks rWatcher! That is it... I am using 3.0 git (pre-RC1) ... I tried to upgrade, but like I said, it broke the shopping basket module, so until that gets updated, this version works fine! Thanks again! |
||||
mamouneyya
Joined: 2009-11-02
Posts: 337 |
![]() |
|||
Under the Arabic locale, I noticed that Arabic months' names are encoded with Arabic (ISO-8859-6) while Gallery's original texts are encoded with UTF-8. Therefore, if you were using Arabic locale, you can see one of these correctly-encoded at a time.. either months' names (by using ISO-8859-6): Update: I've upgraded the module and found that the months' names are translatable through the translation interface now, so that issue doesn't exist anymore. Thanks for this nice module |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
I've updated this module to work with Gallery 3.0, RC-1. The updated version is attached to this post, and up on my github account. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Thanks rwatcher. Css is really poor on dark backgrounds. http://www.skunk.agentura.dk/index.php/calendarview/calendar Is it possible to allow for color theming from the module, or even better, simply use css within the active theme, so that the module change with a given div such as padding under albums. Same for font size and color Same for borders and hlines all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Thanks rwatcher. Css is really poor on dark backgrounds. http://www.skunk.agentura.dk/index.php/calendarview/calendar CSS for the module is controlled in modules\calendarview\css\calendarview_calendar.css . You should be able to copy this file into the css folder for your theme and make whatever changes you want to allow it to blend in better with the darker colors. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
When I go to calender - latest updates block in sidebar menu dissapears...??? Why? all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
When I go to calender - latest updates block in sidebar menu dissapears...??? The latest updates block is only displayed on album, photo and video pages. It is not displayed dynamic pages like calendar, tags, etc. because there won't be anything to point the "This Album" link to. Although now that I think about it, it would probably be better to just hide the "This Album" link... I'll have that changed in a few minutes. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
I fully agrree to your comment. Latest updates should always be there. all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Speedy could you or someone explain the basics in module creation, what to look for, structure etc. Doc is very limited - and it's really frustrating not to be able to contrib. all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Speedy could you or someone explain the basics in module creation, what to look for, structure etc. Doc is very limited - and it's really frustrating not to be able to contrib. Personally, I started out by looking at what the existing modules did (feature wise) and then looking at their code to see how that did it. There is a developer module, that can do some stuff like create a "skeleton" of a module automatically, and can help with debugging and whatnot as well. It's at: |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
I found the help develop module yesterday and installed. I will try it out later.. i HAVE been messing around in mods only to get even more confused all the best |
||||
mamouneyya
Joined: 2009-11-02
Posts: 337 |
![]() |
|||
Some issues: Thanks. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
@rWatcher: I am trying incorporate calendar and I have a few problems if it is outside of wind theme.
This last item is showbreaker. Do you know if there is a way to reuse theme's page.html.php and only inject inside block? |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Serge D wrote:
but a problem is that search result screen is hardwired to simulate wind theme and as a result breaks theme layout.[/list] I'm not aware of any way (which is why I coded it the way I did), as far as I can tell the breadcrumbs that are normally used when navigating albums are hard-wired to only work for albums. But it's pretty easy to fix. <? if (!empty($parents)): ?> <ul class="g-breadcrumbs"> <? $i = 0 ?> <? foreach ($parents as $parent): ?> <li <? if ($i == 0) print " class=\"g-first\"" ?>> <a href="<?= $parent->url($parent == $theme->item()->parent() ? "show={$theme->item()->id}" : null) ?>"> <?= html::purify($parent->title) ?> </a> </li> <? $i++ ?> <? endforeach ?> <li class="g-active <? if ($i == 0) print " g-first" ?>"><?= html::purify($theme->item()->title) ?></li> </ul> <? endif ?> And replace it with this: <? if (!empty($breadcrumbs)): ?> <ul class="g-breadcrumbs"> <? $i = 0 ?> <? foreach ($breadcrumbs as $breadcrumb): ?> <li<? if ($i == 0) print " class=\"g-first\"" ?>> <? if ($breadcrumb->url) : ?> <a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a> <? else : ?> <?= html::purify($breadcrumb->title) ?> <? endif ?> </li> <? $i++ ?> <? endforeach ?> </ul> <? endif ?> That should fix it. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
mamouneyya wrote:
Some issues: #1 is definitely an issue. I had to abandon the original calendar generation code due to compatibility issues with RC1. This update should fix this. I am unable to reproduce issues 2 and 3, are you using Gallery 3 RC1 or a different version? |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
@rWatcher: yes, I figured as much, but this is exactly what I am trying to avoid. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Serge D wrote:
@rWatcher: yes, I figured as much, but this is exactly what I am trying to avoid. Search and search by tag are mostly done the same way as calendarview. The only difference (which is the difference that's causing problems) is that calendarview inserts navigation breadcrumbs into the top of the page for Month/Day/Year while the other modules don't do anything like that. There isn't really any way to do this with the current API without writing a custom view, which unfortunately then requires making themed versions of that view in order for it to display properly outside of wind. |
||||
mamouneyya
Joined: 2009-11-02
Posts: 337 |
![]() |
|||
rWatcher wrote:
I am unable to reproduce issues 2 and 3, are you using Gallery 3 RC1 or a different version? RC1. I have just produced the both issues on 3 different fresh installation :S |
||||
mamouneyya
Joined: 2009-11-02
Posts: 337 |
![]() |
|||
OK, I am sorry! I know why that was happening. EXIF module was not active, so there was no known date for photos. I activated EXIF data module & build its database, and CalendarView works properly now. -------- That is what the month names look like: Can you please help me fixing this in my working version? |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Concerning CSS rWatcher - you mentioned that I can bring calender css to my theme css. If I do so and then upgrade calender view later on, the default css is back in my folder structure. Wich file is read first and wich one later. Just concerned with double code and overwriting everytime I upgrade all the best |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
It seems that calender is structured in a table and months are structured in tables inside the total table. Is it possible to keep months in seperate tables that has shared div and remove the global table. This way the calenders (tables) can be structured from css and display as a grid using floats, width etc. Otherwise the view is not easily themed to cool themes What I am aiming at is 4,5 or 6 months inline horizontal and then decrease the height of the page and then avoid scrolling to bottom etc all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Concerning CSS My understanding is that files in the themes folder will override files in the corresponding modules folder. So if you have a calendarview/css/calendarview_calendar.css file and a THEMENAME/css/calendarview_calendar.css the file in the THEMENAME folder will be used instead. hebhansen wrote:
It seems that calender is structured in a table and months are structured in tables inside the total table. If you could post an example html/css file that shows what you'd like the modules outputted html code to look like, I can try and re-work the calendar generation library to do so. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
mamouneyya wrote:
OK, I am sorry! I know why that was happening. EXIF module was not active, so there was no known date for photos. I activated EXIF data module & build its database, and CalendarView works properly now. Ah, thanks I didn't even think of that. I've just pushed out an update to my github account that'll cause calendarview to display a warning if EXIF isn't active. mamouneyya wrote:
Again, about the translatable issue, I could successfully translate everything in a fresh installation, but I cannot figure to make that working on my working version that this issue happened with, the first time. In the fresh installation, I see clean English day and month names and can translate them all, while in my working version I see a garbage strings that displayed as month names when translated, but there are no ones for day names (Actually, there is just a one appears in all day fields, as you can see from the picture above.) Are the fresh install and the "broken" install both on the same server? I just want to make sure this isn't a compatibility issue with different server setups. I know very little about how Gallery's translation system works. That said, assuming they are both on the same server, my best guess would be that the "bad" translations are still in Gallery's database (probably the "incoming_translations" table). Removing the relevant records and then re-translating the page might fix it. |
||||
mamouneyya
Joined: 2009-11-02
Posts: 337 |
![]() |
|||
rWatcher wrote:
Are the fresh install and the "broken" install both on the same server? I just want to make sure this isn't a compatibility issue with different server setups. Actually, the fresh installation I was talking about was on a different server (my local server). I've just tried to install a one on that same hosted server, and the same problem exists there! what could that means? |
||||