future date articles must be visible too

Need some help with the script?

future date articles must be visible too

Postby D72 » Fri Mar 23, 2007 9:59 pm

I'm trying to setup a sort of gig listing.

And i was wondering if it's possible to have articles with future dates visible too.

For instance, i have a performance on 12th april 2007. When i add this article, it won't show up in the story listing on the page. Only articles with dates of today and past dates are visible. Is there a way to do this? It would be outstanding if there was a hack to set a 'Start Publishing' date and a 'Finish Publishing' date.
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby Ramon » Sat Mar 24, 2007 11:44 pm

Code: Select all
$where[] = 'date < '.(time() + $config_date_adjust * 60);




to this:

Code: Select all
      if($schedule){

         $where[] = 'date > '.(time() + $config_date_adjust * 60);

      }

      else{

         $where[] = 'date < '.(time() + $config_date_adjust * 60);

      }

      $schedule = false;




Add $schedule = true; to your include code.



---



All credits to FI-DD
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby D72 » Sun Mar 25, 2007 12:28 am

i'd tried to find out where i have to replace the code. But unfortunately i couldnt.



:roll:



// edit

I found the file: show.news.php in directory inc.

And it works! :D That's awesome! But the order is just the opposite.

Now the date of tomorrow is listed as the last. And dates for example of the month april are listed first.

Can i change the order easily?
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

You're an Angel

Postby D72 » Sun Mar 25, 2007 1:21 am

OMG Ramon you're an angel.

I've got it work now. I replaced the lines above in the show.news.php

Added
Code: Select all
$schedule = true;
in my include codes and while i was searching here i found this topic.

There i found this code
Code: Select all
$sort = array('title', 'ASC');


As i was playing with it, i finally changed title in date and placed that code on top of the html line in my 'Agenda' template like this.

Code: Select all
$sort = array('date', 'ASC');

$template_active = <<<HTML


I cleared the cache (very important to do) and *boom all dates had it's right order listing. :lol: I can't say enough how delited i am at the moment. Thanks Ramon!



Is this all "basic" php? Because most of de codes, snippets and hacks... it really doesnt make any sence to me haha

But we're learning everyday.



/ Piece of Dutch talk:

Dank je wel! Ben echt blij! Nu dat kut ding van een Spaw nog weten op te lossen. *Rotding...



I'm heading off to bed... with a satisfied feeling. Yahoo!!!
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby Ramon » Sun Mar 25, 2007 1:49 pm

No need to thank me, thank FI-DD. He made this hack ;)
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby D72 » Sun Mar 25, 2007 8:28 pm

Thank you FI-DD :)
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby D72 » Sat Apr 07, 2007 3:30 pm

Another question about this one.

As some of you knows i used above codes for a gig listing.

But i've noticed that gigs, will be givin on this day, with the date of today, automaticly removes to the archive.

For instance, a gig with the date of 7th april 2007, won't stay in the recent gig list, but removed to the archive.

Is there a way to keep certain dates active on the day it self and and moves to archive just the next day? (day after)
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby Ramon » Sat Apr 07, 2007 4:14 pm

Try this, if it doesn't work -> I don't know :P



Code: Select all
         if($schedule){

         $where[] = 'date > '.(time() + $config_date_adjust * 60);

      }

      elseif($schedule){

         $where[] = 'date = '.(time() + $config_date_adjust * 60);

      }

      else{

         $where[] = 'date < '.(time() + $config_date_adjust * 60);

      }

      $schedule = false;
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby D72 » Sat Apr 07, 2007 4:37 pm

I'll get on this after i finished the dishes :(

Don't no why, but i have a good feeling on this one :)

Thanks... i will reply after i tried it.
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby D72 » Sat Apr 07, 2007 11:36 pm

Sorry Ramon, i placed the code in show.news.php but it doesnt have any effect.

All gigs having the date of today are still in the archive and not visible in the normal listing.

Thanks anyway, guess they should get used to it to view also the archive for recent dates. :lol:
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby Ramon » Sun Apr 08, 2007 3:59 am

Try this, else => I really don't know Image

Code: Select all
             if($schedule){

         $where[] = 'date > '.(time() + $config_date_adjust * 60);

      }

      elseif($schedule){

         $where[] = 'date == '.(time() + $config_date_adjust * 60);

      }

      else{

         $where[] = 'date < '.(time() + $config_date_adjust * 60);

      }

      $schedule = false;
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby D72 » Sun Apr 08, 2007 11:00 am

-> Ramon



Is dit onze tijd?: Sun Apr 08, 2007 3:59 am (de tijd van jouw reply)

Slaap jij wel? :D



I'll try this one.

Thanks.



* offtopic:

Ben erg nieuwsgierig naar jouw site... kijk er regelmatig even.

Is al meer te zien nu... maar je maakt het wel spannender ;)
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby D72 » Sun Apr 08, 2007 11:09 am

Nope, this also didn't work.

It's a pain in the right? :)

I appreciate you help for real. Unfortunately it has no result that gives you a satisfied feeling too.

Sorry Ramon.
User avatar
D72
 
Posts: 336
Joined: Thu Feb 22, 2007 12:05 am
Location: NL

Postby Ramon » Sun Apr 08, 2007 11:45 am

Voeg me anders maar toe op MSN -> ramon[apestaartje]fminside[punt]net



Vanacht heb ik inderdaad doorgehaald, s'nachts werk ik het makkelijkst. Wordt ik niet gestoord en is het compleet stil om me heen. Maarja, als ik zaterdags uitga lig ik net zo laat in bed. 5 uur lag ik erin, 9 uur was ik eruit voor de F1 :p haha :)



En over de code, ik weet het ook niet, heb maar wat geprobeert :P Waarschijnlijk moet je even wachten tot FI-DD langskomt..
Image
Ramon
 
Posts: 599
Joined: Wed Oct 12, 2005 8:51 pm
Location: Hoogeveen, NL

Postby FI-DD » Tue Apr 10, 2007 7:01 pm

User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Next

Return to Help



Who is online

Users browsing this forum: No registered users and 4 guests