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
a5b0525a
Commit
a5b0525a
authored
Jan 21, 2004
by
Dries Buytaert
Browse files
- Forum module improvements.
parent
9c044fff
Changes
3
Hide whitespace changes
Inline
Side-by-side
modules/forum.module
View file @
a5b0525a
...
...
@@ -232,7 +232,7 @@ function _forum_last_reply($nid) {
function
_forum_format
(
$topic
)
{
if
(
$topic
)
{
return
t
(
"%
date
<br />by %author"
,
array
(
"%
dat
e"
=>
format_
date
(
$topic
->
timestamp
,
"small"
),
"%author"
=>
format_name
(
$topic
)));
return
t
(
"%
time ago
<br />by %author"
,
array
(
"%
tim
e"
=>
format_
interval
(
time
()
-
$topic
->
timestamp
),
"%author"
=>
format_name
(
$topic
)));
}
else
{
return
message_na
();
...
...
@@ -517,47 +517,51 @@ function theme_forum_list($forums, $parents, $tid) {
foreach
(
$forums
as
$forum
)
{
if
(
$forum
->
container
)
{
$forum
->
num_topics
=
""
;
$forum
->
num_posts
=
""
;
$forum
->
last_post
=
""
;
$new_topics
=
0
;
$links
=
array
();
$description
=
"<div style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"container"
,
"colspan"
=>
4
));
}
else
{
if
(
$user
->
uid
)
{
$new_topics
=
$forum
->
num_topics
-
$forum
->
old_topics
;
}
else
{
$new_topics
=
0
;
}
$links
=
array
();
if
(
$forum
->
last_post
)
{
$links
[]
=
l
(
t
(
"the most recent topic"
),
"node/view/"
.
$forum
->
last_post
->
nid
);
}
if
(
$new_topics
)
{
$links
[]
=
l
(
t
(
"
the first
new topic"
),
"forum/
$forum->tid
/new"
);
$links
[]
=
l
(
t
(
"new
est
topic"
),
"forum/
$forum->tid
/new"
);
}
}
$description
=
"<div class=
\"
forum
\"
style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
if
(
$links
)
{
$description
.
=
" <div class=
\"
navigation
\"
>"
.
t
(
"Jump to: %links"
,
array
(
"%links"
=>
implode
(
", "
,
$links
)))
.
".</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
if
(
$forum
->
last_post
)
{
$links
[]
=
l
(
t
(
"active topic"
),
"node/view/"
.
$forum
->
last_post
->
nid
);
}
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"description"
),
array
(
"data"
=>
$forum
->
num_topics
.
(
$new_topics
?
"<br />("
.
t
(
"%a new"
,
array
(
"%a"
=>
$new_topics
))
.
")"
:
""
),
"class"
=>
"topics"
),
array
(
"data"
=>
$forum
->
num_posts
,
"class"
=>
"posts"
),
array
(
"data"
=>
(
$forum
->
container
?
""
:
_forum_format
(
$forum
->
last_post
)),
"class"
=>
"last-reply"
)
$description
=
"<div style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
);
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
if
(
$links
)
{
$description
.
=
" <div class=
\"
links
\"
>"
.
t
(
"Jump to: %links"
,
array
(
"%links"
=>
implode
(
", "
,
$links
)))
.
".</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"forum"
),
array
(
"data"
=>
$forum
->
num_topics
.
(
$new_topics
?
"<br />("
.
t
(
"%a new"
,
array
(
"%a"
=>
$new_topics
))
.
")"
:
""
),
"class"
=>
"topics"
),
array
(
"data"
=>
$forum
->
num_posts
,
"class"
=>
"posts"
),
array
(
"data"
=>
_forum_format
(
$forum
->
last_post
),
"class"
=>
"last-reply"
));
}
}
}
...
...
modules/forum/forum.module
View file @
a5b0525a
...
...
@@ -232,7 +232,7 @@ function _forum_last_reply($nid) {
function
_forum_format
(
$topic
)
{
if
(
$topic
)
{
return
t
(
"%
date
<br />by %author"
,
array
(
"%
dat
e"
=>
format_
date
(
$topic
->
timestamp
,
"small"
),
"%author"
=>
format_name
(
$topic
)));
return
t
(
"%
time ago
<br />by %author"
,
array
(
"%
tim
e"
=>
format_
interval
(
time
()
-
$topic
->
timestamp
),
"%author"
=>
format_name
(
$topic
)));
}
else
{
return
message_na
();
...
...
@@ -517,47 +517,51 @@ function theme_forum_list($forums, $parents, $tid) {
foreach
(
$forums
as
$forum
)
{
if
(
$forum
->
container
)
{
$forum
->
num_topics
=
""
;
$forum
->
num_posts
=
""
;
$forum
->
last_post
=
""
;
$new_topics
=
0
;
$links
=
array
();
$description
=
"<div style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"container"
,
"colspan"
=>
4
));
}
else
{
if
(
$user
->
uid
)
{
$new_topics
=
$forum
->
num_topics
-
$forum
->
old_topics
;
}
else
{
$new_topics
=
0
;
}
$links
=
array
();
if
(
$forum
->
last_post
)
{
$links
[]
=
l
(
t
(
"the most recent topic"
),
"node/view/"
.
$forum
->
last_post
->
nid
);
}
if
(
$new_topics
)
{
$links
[]
=
l
(
t
(
"
the first
new topic"
),
"forum/
$forum->tid
/new"
);
$links
[]
=
l
(
t
(
"new
est
topic"
),
"forum/
$forum->tid
/new"
);
}
}
$description
=
"<div class=
\"
forum
\"
style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
if
(
$links
)
{
$description
.
=
" <div class=
\"
navigation
\"
>"
.
t
(
"Jump to: %links"
,
array
(
"%links"
=>
implode
(
", "
,
$links
)))
.
".</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
if
(
$forum
->
last_post
)
{
$links
[]
=
l
(
t
(
"active topic"
),
"node/view/"
.
$forum
->
last_post
->
nid
);
}
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"description"
),
array
(
"data"
=>
$forum
->
num_topics
.
(
$new_topics
?
"<br />("
.
t
(
"%a new"
,
array
(
"%a"
=>
$new_topics
))
.
")"
:
""
),
"class"
=>
"topics"
),
array
(
"data"
=>
$forum
->
num_posts
,
"class"
=>
"posts"
),
array
(
"data"
=>
(
$forum
->
container
?
""
:
_forum_format
(
$forum
->
last_post
)),
"class"
=>
"last-reply"
)
$description
=
"<div style=
\"
margin-left: "
.
(
$forum
->
depth
*
30
)
.
"px;
\"
>
\n
"
;
$description
.
=
" <div class=
\"
name
\"
>"
.
l
(
$forum
->
name
,
"forum/
$forum->tid
"
)
.
"</div>
\n
"
;
);
if
(
$forum
->
description
)
{
$description
.
=
" <div class=
\"
description
\"
>
$forum->description
</div>
\n
"
;
}
if
(
$links
)
{
$description
.
=
" <div class=
\"
links
\"
>"
.
t
(
"Jump to: %links"
,
array
(
"%links"
=>
implode
(
", "
,
$links
)))
.
".</div>
\n
"
;
}
$description
.
=
"</div>
\n
"
;
$rows
[]
=
array
(
array
(
"data"
=>
$description
,
"class"
=>
"forum"
),
array
(
"data"
=>
$forum
->
num_topics
.
(
$new_topics
?
"<br />("
.
t
(
"%a new"
,
array
(
"%a"
=>
$new_topics
))
.
")"
:
""
),
"class"
=>
"topics"
),
array
(
"data"
=>
$forum
->
num_posts
,
"class"
=>
"posts"
),
array
(
"data"
=>
_forum_format
(
$forum
->
last_post
),
"class"
=>
"last-reply"
));
}
}
}
...
...
themes/xtemplate/xtemplate.css
View file @
a5b0525a
...
...
@@ -60,7 +60,7 @@ pre {
}
table
{
/* make <td> sizes relative to body size! */
font-size
:
1em
;
/*
font-size: 1em;
*/
}
.form-item
{
margin-top
:
1em
;
...
...
@@ -269,15 +269,31 @@ table {
#tracker
td
{
vertical-align
:
top
;
padding
:
1em
1em
1em
0
;
border-bottom
:
1px
solid
#
ddd
;
border-bottom
:
1px
solid
#
bbb
;
}
#forum
td
{
padding
:
0.5em
0.5em
0.5em
0.5em
;
}
#forum
td
.container
{
background-color
:
#ccc
;
}
#forum
td
.container
a
{
color
:
#555
;
}
#forum
td
.statistics
,
#forum
td
.settings
,
#forum
td
.pager
{
height
:
1.5em
;
border
:
1px
solid
#bbb
;
}
#forum
td
.name
{
color
:
#96c
;
}
#forum
td
.links
{
padding-top
:
0.7em
;
font-size
:
0.9em
;
}
#forum
td
.links
a
{
color
:
#77a
;
}
.block-forum
h3
{
margin-bottom
:
.5em
;
}
...
...
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