• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: [opgelost] Birthday listing
PostPosted: Mon Apr 23, 2012 9:09 am 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
Hallo,
De module birthday listing geinstalleerd. Werkt goed en simpel.

Ik heb een tweedeling gemaakt:
- wie is er vadaag jarig?
- wie zijn er de komende 30 dagen jarig?

Best de mogelijkheid om in het laatste (30 dagen) overzichtje de verjaardagen van de huidige dag niet te tonen?

Zo ja, op welke wijze pak ik dat aan?


Last edited by peterbus on Tue Apr 24, 2012 8:24 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Mon Apr 23, 2012 1:06 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Persoonlijk vind ik je wens niet echt logisch, maar voor deze vraag kun je het best direct contact zoeken met Duketown, denk ik.

Conform de forumreglementen mogen er hier namelijk geen aanpassingen op code van core/modules/plugins geplaatst worden.

[edit]
Misschien is er geen aanpassing van de code nodig als je zelf templates kunt definiëren? Ik ken de module zelf niet, maar als dat het geval is dan zal er waarschijnlijk wel een foreach lus in zitten.
Daarbinnen kun je met een {if} statement checken of het de datum van vandaag betreft en in dat geval die regel niet weergeven.

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Mon Apr 23, 2012 2:59 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
Het betreft hier zeker geen aanpassing modules maar een aanvulling op de template.
Of iets in de geest van van een UDT.

Ik wil het onderscheid duidelijk maken tussen Vandaag zijn jarig en De komende tijd zijn jarig. Nu staat alles in één lijstje.

Vandaar.


Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Mon Apr 23, 2012 3:02 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Oke, kun je de template van jouw "30 dagen" lijstje hier misschien posten?

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Mon Apr 23, 2012 5:16 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
bij dezen:

Content pagina Wie zijn er vandaag jarig?

{cms_module module=birthdaylisting showage=1 summarytemplate="pp-almelo" }

Template:
{if $itemcount > 0}
{foreach from=$items item=entry}
<p><b>- &nbsp; {$entry->name}</b> wordt vandaag {$entry->age} jaar</p>
{/foreach}
{else}
{$nobirthdays}
{/if}


content pagina
Wie zijn er de komende tijd jarig?

{cms_module module=birthdaylisting showage=1 withindays=30}

Template:
{if $itemcount > 0}
{foreach from=$items item=entry}
<p><b>- &nbsp; {$entry->name}</b> wordt op {$entry->birthday|date_format:"%e %B"} {$entry->age} jaar</p>
{/foreach}
{else}
{$nobirthdays}
{/if}


Resultaat front end:

Wie zijn er vandaag jarig?
- Peter wordt vandaag 19 jaar

Wie zijn er de komende tijd jarig?
- Peter wordt op 23 april 19 jaar
- Rita Coolidge wordt op 1 mei 66 jaar
- Minami Takayama wordt op 5 mei 47 jaar


Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Mon Apr 23, 2012 6:55 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Oke, dan wordt het waarschijnlijk zoiets:

Code:
{if $itemcount > 0}
{foreach from=$items item=entry}
{if $entry->birthday|date_format:'%m-%d' != $smarty.now|date_format:'%m-%d'}
<p><b>- &nbsp; {$entry->name}</b> wordt op {$entry->birthday|date_format:"%e %B"} {$entry->age} jaar</p>
{/if}
{/foreach}
{else}
{$nobirthdays}
{/if}

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: Birthday listing
PostPosted: Tue Apr 24, 2012 8:24 am 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
YES!!

Het werkt. Dank je Jos.


Top
 Profile  
 
 Post subject: Re: [opgelost] Birthday listing
PostPosted: Tue Apr 24, 2012 10:07 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 5144
Location: The Netherlands
Om ze in een lijst te zetten doe je:
Code:
{if $itemcount > 0}
<ul>
{foreach from=$items item=entry}
{if $entry->birthday|date_format:'%m-%d' != $smarty.now|date_format:'%m-%d'}
<li>{$entry->name}</b> wordt op {$entry->birthday|date_format:"%e %B"} {$entry->age} jaar</li>
{/if}
{/foreach}
</ul>
{else}
{$nobirthdays}
{/if}

grt. Rolf

_________________
Dutch CMSMS community website cmsms.nl and Wiki wiki.cmsms.nl
--------------------------
My CMSMS Tips and Tricks Weblog and website about Pneumatic Tube Systems / Rohrpost
My other (Dutch) website: Smakelijk eten zonder zout (Design: Compufairy)


Top
 Profile  
 
 Post subject: Re: [opgelost] Birthday listing
PostPosted: Tue Apr 24, 2012 12:54 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
Ha Rolf,

Die ga ik ook nog even uitproberen. Dank je.

Jammer dat er geen koppeling bestaat met de feu module. Scheelt weer een hoop werk.


Top
 Profile  
 
 Post subject: Re: [opgelost] Birthday listing
PostPosted: Tue Apr 24, 2012 2:40 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Volgens mij is deze module uit de allereerste Nederlandse CMS Made Simple workshop voortgekomen en bedoeld als voorbeeld hoe je "simpel" zelf een module kunt maken... daar was ik net niet bij dus kan zijn dat ik het mis heb.

Maar een "koppeling" met FEU heb je in principe niet nodig. Volgens mij zou je voldoende hebben aan een extra attribuut in FEU met de geboortedatum.

Ik kan me heugen dat ik bij de tips en truuks al een keer gepost hebt hoe je vanuit een datum een leeftijd uitrekent... Zou echter kunnen dat dat voor deze toepassing niet precies genoeg is en enige aanpassing vereist.

Het is dan alleen nog even puzzelen om daar een lijstje van te maken. De kneep zal hem vooral zitten in het sorteren ervan.

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: [opgelost] Birthday listing
PostPosted: Tue Apr 24, 2012 5:44 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 07, 2006 9:19 am
Posts: 244
Location: Aldtsjerk, Netherlands
[size=85]Onderstaand heeft een vriend van me gemaakt (ik mis daartoe de vaardigheden). Opdrachtgever wilde daar echter ook een overzichtje "Wie is er de komende tijd jarig" bij. Tja, en dan ben je eigenlijk al weer bij de birthdaylist module.
D'r schijnt iets te zijn in cmsms waardoor het berekenen van een verjaardag van mensen die zijn geboren voor 1971 wat extra werk behoeft. Heb ik dat goed begrepen?



globak content block:

{
Code:
if !isset($birthdays)}
{birthdays}
{/if}


{foreach from=$birthdays item=bday}
<a href="/index.php?mact=FrontEndUserListing,cntnt01,viewdetails,0&cntnt01uid={$bday.userid}&cntnt01returnid=276">{$bday.naam}</a> wordt {$bday.age}</br>
{foreachelse}
Er is niemand jarig vandaag.
{/foreach}

udt:

Code:
$gCms = cmsms();
$db = $gCms->GetDb();

if (!function_exists('fetch')) {
function fetch($db,$q) {
  $dbresult = $db->Execute( $q );
  if( !$dbresult )
  {
    echo 'DB error: '. $db->ErrorMsg()."<br/>";
  }
  $results = array();
  while ($dbresult && $row = $dbresult->FetchRow()) {
    $results[] = $row;
  }
  return $results;
}
}

$sql = '
select p1.userid,  if(isnull(p3.data), concat(p4.data, " " ,  p2.data) , concat(p4.data, " " ,p3.data," ",  p2.data) ) as naam, timestampdiff(YEAR, DATE_ADD(FROM_UNIXTIME(0), INTERVAL p1.data SECOND), curdate()) as age
from cms_module_feusers_properties p1
left join cms_module_feusers_properties p2 on (p2.userid=p1.userid and p2.title="achternaam")
left join cms_module_feusers_properties p3 on (p3.userid=p1.userid and p3.title="tussenvoegsel")
left join cms_module_feusers_properties p4 on (p4.userid=p1.userid and p4.title="voornaam")
where p1.title = "geboortedatum"
and month(DATE_ADD(FROM_UNIXTIME(0), INTERVAL p1.data SECOND)) = month(curdate())
and day(DATE_ADD(FROM_UNIXTIME(0), INTERVAL p1.data SECOND)) = day(curdate());';

$b = fetch($db, $sql);
$smarty->assign('birthdays',$b);[/size]


Last edited by peterbus on Tue Apr 24, 2012 6:28 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: [opgelost] Birthday listing
PostPosted: Tue Apr 24, 2012 6:23 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Ziet er ingewikkeld genoeg uit om te kunnen werken ;)

peterbus wrote:
D'r schijnt iets te zijn in cmsms waardoor het berekenen van een verjaardag van mensen die zijn geboren voor 1971 wat extra werk behoeft. Heb ik dat goed begrepen?

Dat ligt niet aan CMSms maar eerder aan de specifiek gebruikte php en/of mysql functies.

Mijn aanpak was als volgt:
viewtopic.php?f=52&t=57119

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
A2 Hosting