Skip to content

Commit

Permalink
edit sticky pic and some text, fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tongyifan committed May 20, 2019
1 parent 999d423 commit ba497ee
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 11 deletions.
4 changes: 2 additions & 2 deletions comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ function check_comment_type($type)

$sticky = 0 + $_GET['sticky'];
int_check($sticky, true);
if ($isTop != $is_sticky){
if ($isTop != $sticky){
$res = mysql_query("UPDATE comments SET is_sticky=" . $sticky . " WHERE id = " . $commentid) or sqlerr(__FILE__, __LINE__);

$actSticky = $sticky == 0 ? "取消置顶" : "置顶";

write_log(($isOwner ? "发布者 " : "管理员 ") ."$CURUSER[username] 编辑了评论 $commentid $actSticky");
write_log(($isOwner ? "发布者 " : "管理员 ") ."$CURUSER[username] 编辑了种子 {$arr['name']} 评论 $commentid $actSticky");
}

$returnto = $_GET ["returnto"] ? $_GET ["returnto"] : htmlspecialchars($_SERVER ["HTTP_REFERER"]);
Expand Down
11 changes: 5 additions & 6 deletions include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3397,9 +3397,9 @@ function commenttable($rows, $type, $parent_id, $review = false)
$topActionBar = '';
if ($topAble){
if ($row['is_sticky'] == 0){
$topActionBar = '<a href="comment.php?action=sticky&amp;sticky=1&amp;cid=' . $row ['id'] . "&amp;type=" . $type . "\">" . $stickyicon . '</a>&nbsp;&nbsp;';
$topActionBar = '<a href="comment.php?action=sticky&amp;sticky=1&amp;cid=' . $row ['id'] . "&amp;type=" . $type . "\">" . $lang_functions['text_set_sticky'] . '</a>&nbsp;&nbsp;';
}else{
$topActionBar = '<a href="comment.php?action=sticky&amp;sticky=0&amp;cid=' . $row ['id'] . "&amp;type=" . $type . "\">" . $stickyicon . '</a>&nbsp;&nbsp;';
$topActionBar = '<a href="comment.php?action=sticky&amp;sticky=0&amp;cid=' . $row ['id'] . "&amp;type=" . $type . "\">" . $lang_functions['text_unset_sticky'] . '</a>&nbsp;&nbsp;';
}

}
Expand Down Expand Up @@ -3803,16 +3803,15 @@ function torrenttable($res, $variant = "torrent") {
$dispname = mb_substr($dispname, 0, $max_length_of_torrent_name - 2, "UTF-8") . "..";

if ($row ['pos_state_until'] != "0000-00-00 00:00:00" && $CURUSER ['appendsticky'] == 'yes') {
$stickyicon = "<img class=\"sticky\" src=\"pic/trans.gif\" alt=\"Sticky\" title=\"" . $lang_functions ['title_sticky'] . "" . $row ['pos_state_until'] . "\" />";
switch ($row ['pos_state']) {
case 'sticky':
$stickyicon = $stickyicon . "&nbsp;";
$stickyicon = "<img class=\"sticky_1\" src=\"pic/trans.gif\" alt=\"Sticky\" title=\"" . $lang_functions ['title_sticky'] . "" . $row ['pos_state_until'] . "\" />";
break;
case 'double_sticky':
$stickyicon = $stickyicon . $stickyicon . "&nbsp;";
$stickyicon = "<img class=\"sticky_2\" src=\"pic/trans.gif\" alt=\"Sticky\" title=\"" . $lang_functions ['title_sticky'] . "" . $row ['pos_state_until'] . "\" />";
break;
case 'triple_sticky':
$stickyicon = $stickyicon . $stickyicon . $stickyicon . "&nbsp;";
$stickyicon = "<img class=\"sticky_3\" src=\"pic/trans.gif\" alt=\"Sticky\" title=\"" . $lang_functions ['title_sticky'] . "" . $row ['pos_state_until'] . "\" />";
break;
default:
$stickyicon = "";
Expand Down
4 changes: 3 additions & 1 deletion lang/chs/lang_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,7 @@
'text_tjuptrip' => "官方",
'text_keepseed' => "保种",
'text_pub4_notice' => "校园网环境下请及时关闭“离校模式”,避免校园网流量损失",
'text_school' => ""
'text_school' => "",
'text_set_sticky' => "设为置顶",
'text_unset_sticky' => "取消置顶"
);
Binary file added pic/sticky_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pic/sticky_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pic/sticky_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pickup.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function bark($msg)
$returl = $_POST ["returnto"];

if ((0 + $_POST ["sel_posstate"]) > 1 && $row ["pos_state"] == 'normal') {
$pre_to_shoutbox ['text'] = "[b][color=red]" . $row ['name'] . "[/color][/b]被置顶啦:[url=details.php?id=" . mysql_real_escape_string($id) . "&hit=1]大家这里使劲戳[/url]";
$pre_to_shoutbox ['text'] = "[b][color=red]" . $row ['name'] . "[/color][/b]被置顶啦:[url=details.php?id=" . mysql_real_escape_string($id) . "&hit=1]大家使劲戳戳戳[/url]";
$pre_to_shoutbox ['type'] = "sb";
$pre_to_shoutbox ['ip'] = "北洋媛隐身啦~啦啦啦~";
sql_query("INSERT INTO shoutbox (userid, date, text, type, ip) VALUES (0, " . sqlesc(time()) . ", " . sqlesc($pre_to_shoutbox ['text']) . ", " . sqlesc($pre_to_shoutbox ['type']) . ", '$pre_to_shoutbox[ip]' )") or sqlerr(__FILE__, __LINE__);
Expand Down
18 changes: 18 additions & 0 deletions styles/sprites.css
Original file line number Diff line number Diff line change
Expand Up @@ -753,4 +753,22 @@ img.tqq {
display: inline-block;
height: 14px;
padding-right: 5px
}

img.sticky_1 {
width: 14px;
height: 14px;
background: url(../pic/sticky_1.png);
}

img.sticky_2 {
width: 14px;
height: 14px;
background: url(../pic/sticky_2.png);
}

img.sticky_3 {
width: 14px;
height: 14px;
background: url(../pic/sticky_3.png);
}
2 changes: 1 addition & 1 deletion viewpeerlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function dltable($name, $arr, $torrent)
/* ($enablelocation_tweak == 'yes' || get_user_class() >= $userprofile_class ? "<td class=colhead align=center width=1%>".$lang_viewpeerlist['col_location']."</td>" : "<td class=colhead align=center width=1%>".$lang_viewpeerlist['ip_type']."</td>").*/
($enablelocation_tweak == 'yes' || get_user_class() >= $userprofile_class ? "<td class=colhead align=center width=1%>" . $lang_viewpeerlist['col_location'] . "</td>" : "") .

"<td class=colhead align=center width=1%>" . $lang_viewpeerlist['col_connectable'] . "</td>".
"<td class=colhead align=center width=1%>" . $lang_viewpeerlist['ip_type'] . "</td>".

"<td class=colhead align=center width=1%>" . $lang_viewpeerlist['col_uploaded'] . "</td>" .

Expand Down

0 comments on commit ba497ee

Please sign in to comment.