26

Re: Calendar Mod

you know i dont realy know, all it does it use the unix time stamp but it dont convert the number to the date, i think it might take the server time, but i dont realy know.

27

Re: Calendar Mod

Make a first release with small features

If your people come crazy, you will not need to your mind any more.

28 (edited by cuteseal 2004-09-20 04:27)

Re: Calendar Mod

I think there's a function in functions.php which does this (format_time) or something like that.

Ok found it.  Here's what it's doing

if (!isset($cur_user) || $pun_config['o_server_timezone'] == $cur_user['timezone'])
    $diff = 0;
else
    $diff = ($cur_user['timezone'] - $pun_config['o_server_timezone'])*3600;

$timestamp += $diff;
Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

29

Re: Calendar Mod

What i did for a calander is do a base query and put the data into an array with the date being the position in the array, so...

$aData[12]

...would have the details of the events on the 12 day of the month displayed.  You could then expand that to be a little more verbose with a 2D array as needed.

*didnt read the previous messages*

30

Re: Calendar Mod

can i see that code, cuz im still suck on how to do this, i know what i need to do but idont realy know how. told you i was bad at php

31

Re: Calendar Mod

like this

http://sourceforge.net/mailarchive/foru … nth=200301

If your people come crazy, you will not need to your mind any more.

Re: Calendar Mod

Gizzmo wrote:

can i see that code, cuz im still suck on how to do this, i know what i need to do but idont realy know how. told you i was bad at php

have a look at the cache fuctions on punbb1.2 dev release you might be able to use them to store the number of posts etc on previous days as its not going to change for days that have already passed

33

Re: Calendar Mod

$dbGET_data = mysql_query("SELECT day, data FROM dates WHERE month = "2" AND year = "2005"");
while($dbGET_DATA = mysql_fetch_object($dbGET_data)){
 $aData[$dbGET_DATA->day] = $dbGET_DATA->data;
}

That code assumes that their will be only 1 row a day.  you can be much more detailed with 2D arrays and such with some verifing.  Be creative smile

34

Re: Calendar Mod

yay i got it to work, WOOO WHOOO, im so happy for my self

Re: Calendar Mod

awesome!  Post some code up so I can try it out too... I'm running it on my site at the moment smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

36

Re: Calendar Mod

new version out 0.6 just a little big changed...i should make a todo list hehe.

wish i could change the title of this topic to just calendar mod and not have the version number in it. but anyways the new mods out.

and im glad you like it cuteseal

Re: Calendar Mod

Did you include the timezone fix as well?

I managed to do it on the 0.5 code:

Up top:

if (!isset($cur_user) || $pun_config['o_server_timezone'] == $cur_user['timezone'])
    $diff = 0;
else
    $diff = ($cur_user['timezone'] - $pun_config['o_server_timezone'])*3600;
$adjdate = time() + $diff;

if (!isset($day)){$day = date(j, $adjdate);}
if (!isset($monthno)) {$monthno=date(n, $adjdate);}
if (!isset($year)) {$year = date(Y, $adjdate);}

Also in the function view()

global $db, $lang_calendar, $date, $dayfull, $monthtext, $day, $monthno, $year, $next_day, $last_day, $next_month, $last_month, $next_year, $last_year, $diff;
...
...
$datestart = mktime(0,0,0,$monthno,$day,$year) - $diff;
$dateend = mktime(24,0,0,$monthno,$day,$year) - $diff;
Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

38

Re: Calendar Mod

nope but ill get that in the next version along with the "posts made" count on the calendar and the view section.

Re: Calendar Mod

looks nice big_smile

40

Re: Calendar Mod

Okay, wellcome to PunBB MODs
i will use it in my sites

If your people come crazy, you will not need to your mind any more.

41

Re: Calendar Mod

So ...

// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
    global $pun_config, $lang_common, $cookie, $cur_user;

    // Home and Userlist should always be displayed
    $links[] = '<a href="index.php">'.$lang_common['Home'].'</a> | <a href="userlist.php">'.$lang_common['User list'].'</a>';

    $links[] = '<a href="calendar.php">Calendrier</a>';

    if ($pun_config['o_rules'] == '1')
        $links[] = '<a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';

I have added the link into functions.php ... no link appears ... (great)

and if I want to go to
http://www.sortons.net/forum/calendar.php ... white page ..

I have tested 0.6 Calendar version ... what's wrong ?

Re: Calendar Mod

turn on debug mode (theres a post about it somewhere) to see the error?

43

Re: Calendar Mod

I don't see how (and where) turn on debug mode sad

Your add on is the easiest addon I've ever seen to install, but nothing happens sad

Re: Calendar Mod

http://punbb.org/forums/viewtopic.php?id=2658

45 (edited by Gizzmo 2004-09-22 22:36)

Re: Calendar Mod

Rod wrote:

I have added the link into functions.php ... no link appears ... (great)

i dont know whats wrong, you shows the same as what i have in my function file, and i dont know why the calendar script dont print anything.

i cant seem to replicate it, try uploading the files again. but other than that i have no idea why your havein probems. sorry cant help

46

Re: Calendar Mod

Wouldn't this be better

// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
    global $pun_config, $lang_common, $cookie, $cur_user;

    // Home and Userlist should always be displayed
    $links[] = '<a href="index.php">'.$lang_common['Home'].'</a> | <a href="userlist.php">'.$lang_common['User list'].'</a> | <a href="calendar.php">Calendar</a>';

47

Re: Calendar Mod

that would be better but i just felt like makin a new line make it easery to edit the file insted of making the hard work of addin more text to an excisting line

48

Re: Calendar Mod

Just tested it. Everything works perfectly here.

49

Re: Calendar Mod

did you try with my way, cuz im not havein a probem my way

50

Re: Calendar Mod

Gizzmo wrote:

did you try with my way, cuz im not havein a probem my way

Yes. I tried exactly as per your instructions. Looking at it there is no reason I can think of for it not to work.