Menu

[r13]: / topics / viewtopic.php  Maximize  Restore  History

Download this file

150 lines (120 with data), 6.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
#Application name: PhpCollab
#Status page: 0
#Path by root: ../topics/viewtopic.php
$checkSession = "true";
include_once('../includes/library.php');
if ($_GET['action'] == "closeTopic") {
$tmpquery1 = "UPDATE ".$tableCollab["topics"]." SET status='0' WHERE id = '".$_GET['id']."'";
$num = "1";
connectSql("$tmpquery1");
$msg = "closeTopic";
}
if ($_GET['action'] == "addToSite") {
$tmpquery1 = "UPDATE ".$tableCollab["topics"]." SET published='0' WHERE id = '".$_GET['id']."'";
connectSql("$tmpquery1");
$msg = "addToSite";
}
if ($_GET['action'] == "removeToSite") {
$tmpquery1 = "UPDATE ".$tableCollab["topics"]." SET published='1' WHERE id = '".$_GET['id']."'";
connectSql("$tmpquery1");
$msg = "removeToSite";
}
$tmpquery = "WHERE topic.id = '$id'";
$detailTopic = new request();
$detailTopic->openTopics($tmpquery);
$tmpquery = "WHERE pos.topic = '".$detailTopic->top_id[0]."' ORDER BY pos.created DESC";
$listPosts = new request();
$listPosts->openPosts($tmpquery);
$comptListPosts = count($listPosts->pos_id);
$tmpquery = "WHERE pro.id = '".$detailTopic->top_project[0]."'";
$detailProject = new request();
$detailProject->openProjects($tmpquery);
$teamMember = "false";
$tmpquery = "WHERE tea.project = '".$detailTopic->top_project[0]."' AND tea.member = '$idSession'";
$memberTest = new request();
$memberTest->openTeams($tmpquery);
$comptMemberTest = count($memberTest->tea_id);
if ($comptMemberTest == "0") {
$teamMember = "false";
} else {
$teamMember = "true";
}
if ($teamMember == "false" && $projectsFilter == "true") {
header("Location:../general/permissiondenied.php?".session_name()."=".session_id());
exit;
}
if ($detailProject->pro_org_id[0] == "1") {
$detailProject->pro_org_name[0] = $strings["none"];
}
$idStatus = $detailTopic->top_status[0];
$idPublish = $detailTopic->top_published[0];
include('../themes/'.THEME.'/header.php');
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/listprojects.php?",$strings["projects"],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/viewproject.php?id=".$detailProject->pro_id[0],$detailProject->pro_name[0],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../topics/listtopics.php?project=".$detailProject->pro_id[0],$strings["discussions"],in));
$blockPage->itemBreadcrumbs($detailTopic->top_subject[0]);
$blockPage->closeBreadcrumbs();
if ($msg != "") {
include('../includes/messages.php');
$blockPage->messagebox($msgLabel);
}
$block1 = new block();
$block1->form = "tdP";
$block1->openForm("");
if ($error != "") {
$block1->headingError($strings["errors"]);
$block1->contentError($error);
}
$block1->heading($strings["discussion"]." : ".$detailTopic->top_subject[0]);
if ($idSession == $detailTopic->top_owner[0]) {
$block1->openPaletteIcon();
$block1->paletteIcon(0,"remove",$strings["remove"]);
$block1->paletteIcon(1,"lock",$strings["close"]);
$block1->paletteIcon(2,"add_projectsite",$strings["add_project_site"]);
$block1->paletteIcon(3,"remove_projectsite",$strings["remove_project_site"]);
$block1->closePaletteIcon();
}
$block1->openContent();
$block1->contentTitle($strings["info"]);
$block1->contentRow($strings["project"],$blockPage->buildLink("../projects/viewproject.php?id=".$detailProject->pro_id[0],$detailProject->pro_name[0]." (#".$detailProject->pro_id[0].")",in));
$block1->contentRow($strings["organization"],$detailProject->pro_org_name[0]);
$block1->contentRow($strings["owner"],$blockPage->buildLink("../users/viewuser.php?id=".$detailProject->pro_mem_id[0],$detailProject->pro_mem_name[0],in)." (".$blockPage->buildLink($detailProject->pro_mem_email_work[0],$detailProject->pro_mem_login[0],mail).")");
if ($sitePublish == "true") {
$block1->contentRow($strings["published"],$statusPublish[$idPublish]);
}
$block1->contentRow($strings["retired"],$statusTopicBis[$idStatus]);
$block1->contentRow($strings["posts"],$detailTopic->top_posts[0]);
$block1->contentRow($strings["last_post"],createDate($detailTopic->top_last_post[0],$timezoneSession));
$block1->contentTitle($strings["posts"]);
if ($detailTopic->top_status[0] == "1" && $teamMember == "true") {
$block1->contentRow("",$blockPage->buildLink("../topics/addpost.php?id=".$detailTopic->top_id[0],$strings["post_reply"],in));
}
for ($i=0;$i<$comptListPosts;$i++) {
$block1->contentRow($strings["posted_by"],$blockPage->buildLink($listPosts->pos_mem_email_work[$i],$listPosts->pos_mem_name[$i],mail));
if ($listPosts->pos_created[$i] > $lastvisiteSession) {
$block1->contentRow($strings["when"],"<b>".createDate($listPosts->pos_created[$i],$timezoneSession)."</b>");
} else {
$block1->contentRow($strings["when"],createDate($listPosts->pos_created[$i],$timezoneSession));
}
if ($detailProject->pro_owner[0] == $idSession || $profileSession == "0" || $listPosts->pos_member[$i] == $idSession) {
$block1->contentRow($blockPage->buildLink("../topics/deletepost.php?topic=".$detailTopic->top_id[0]."&id=".$listPosts->pos_id[$i],$strings["delete_message"],in),nl2br($listPosts->pos_message[$i]));
} else {
$block1->contentRow("",nl2br($listPosts->pos_message[$i]));
}
$block1->contentRow("","","true");
}
$block1->closeContent();
$block1->closeForm();
if ($idSession == $detailTopic->top_owner[0]) {
$block1->openPaletteScript();
$block1->paletteScript(0,"remove","../topics/deletetopics.php?project=".$detailTopic->top_project[0]."&id=".$detailTopic->top_id[0]."","true,true,false",$strings["remove"]);
$block1->paletteScript(1,"lock","../topics/viewtopic.php?id=".$detailTopic->top_id[0]."&action=closeTopic","true,true,false",$strings["close"]);
$block1->paletteScript(2,"add_projectsite","../topics/viewtopic.php?id=".$detailTopic->top_id[0]."&action=addToSite","true,true,false",$strings["add_project_site"]);
$block1->paletteScript(3,"remove_projectsite","../topics/viewtopic.php?id=".$detailTopic->top_id[0]."&action=removeToSite","true,true,false",$strings["remove_project_site"]);
$block1->closePaletteScript("","");
}
include('../themes/'.THEME.'/footer.php');
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.