Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f4dfafe8
Commit
f4dfafe8
authored
Dec 28, 2004
by
Dries Buytaert
Browse files
- Patch
#14852
by Goba: show the number of posts at each day.
parent
0fb0a939
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/archive.module
View file @
f4dfafe8
...
...
@@ -76,9 +76,14 @@ function archive_calendar($original = 0) {
$days_with_posts
=
array
();
while
(
$day_with_post
=
db_fetch_object
(
$result
))
{
$days_with_posts
[]
=
date
(
'j'
,
$day_with_post
->
created
+
$user
->
timezone
);
$daynum
=
date
(
'j'
,
$day_with_post
->
created
+
$user
->
timezone
);
if
(
isset
(
$days_with_posts
[
$daynum
]))
{
$days_with_posts
[
$daynum
]
++
;
}
else
{
$days_with_posts
[
$daynum
]
=
1
;
}
}
$days_with_posts
=
array_unique
(
$days_with_posts
);
// Generate calendar header:
$output
.
=
"
\n
<!-- calendar -->
\n
"
;
...
...
@@ -125,8 +130,8 @@ function archive_calendar($original = 0) {
// Print one cell:
$date
=
mktime
(
0
,
0
,
0
,
$month
,
$nday
,
$year
)
+
$user
->
timezone
;
if
(
i
n_array
(
$nday
,
$days_with_posts
))
{
$daytext
=
l
(
$nday
,
"archive/
$year
/
$month
/
$nday
"
);
if
(
i
sset
(
$days_with_posts
[
$nday
]
))
{
$daytext
=
l
(
$nday
,
"archive/
$year
/
$month
/
$nday
"
,
array
(
"title"
=>
format_plural
(
$days_with_posts
[
$nday
],
"1 post"
,
"%count posts"
))
);
$dayclass
=
'day-link'
;
}
else
{
...
...
modules/archive/archive.module
View file @
f4dfafe8
...
...
@@ -76,9 +76,14 @@ function archive_calendar($original = 0) {
$days_with_posts
=
array
();
while
(
$day_with_post
=
db_fetch_object
(
$result
))
{
$days_with_posts
[]
=
date
(
'j'
,
$day_with_post
->
created
+
$user
->
timezone
);
$daynum
=
date
(
'j'
,
$day_with_post
->
created
+
$user
->
timezone
);
if
(
isset
(
$days_with_posts
[
$daynum
]))
{
$days_with_posts
[
$daynum
]
++
;
}
else
{
$days_with_posts
[
$daynum
]
=
1
;
}
}
$days_with_posts
=
array_unique
(
$days_with_posts
);
// Generate calendar header:
$output
.
=
"
\n
<!-- calendar -->
\n
"
;
...
...
@@ -125,8 +130,8 @@ function archive_calendar($original = 0) {
// Print one cell:
$date
=
mktime
(
0
,
0
,
0
,
$month
,
$nday
,
$year
)
+
$user
->
timezone
;
if
(
i
n_array
(
$nday
,
$days_with_posts
))
{
$daytext
=
l
(
$nday
,
"archive/
$year
/
$month
/
$nday
"
);
if
(
i
sset
(
$days_with_posts
[
$nday
]
))
{
$daytext
=
l
(
$nday
,
"archive/
$year
/
$month
/
$nday
"
,
array
(
"title"
=>
format_plural
(
$days_with_posts
[
$nday
],
"1 post"
,
"%count posts"
))
);
$dayclass
=
'day-link'
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment