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.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → 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.
Make a first release with small features
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;
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*
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
like this
http://sourceforge.net/mailarchive/foru … nth=200301
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
$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
yay i got it to work, WOOO WHOOO, im so happy for my self
awesome! Post some code up so I can try it out too... I'm running it on my site at the moment
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
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;
nope but ill get that in the next version along with the "posts made" count on the calendar and the view section.
Okay, wellcome to PunBB MODs
i will use it in my sites
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 ?
turn on debug mode (theres a post about it somewhere) to see the error?
I don't see how (and where) turn on debug mode
Your add on is the easiest addon I've ever seen to install, but nothing happens
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
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>';
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
Just tested it. Everything works perfectly here.
did you try with my way, cuz im not havein a probem my way
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.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Calendar Mod
Powered by PunBB, supported by Informer Technologies, Inc.