forked from leonardoxc/leonardoxc
/
INC_comment_row.php
113 lines (87 loc) · 4.34 KB
/
INC_comment_row.php
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
<?
// called directly ?
if (!$commentID) exit;
// we get these from the caller
// $commentID=$thread['id'];
// $commentData=$flightComments->comments[$thread['id']];
// $commentDepth=$thread['depth'];
$str.="\n\n\n<div id='comment_$commentID' class='commentBox depth$commentDepth'>";
// helper hidden div
$str.="<span id='cid_$commentID'>
<span id='pid_".$commentData['parentID']."' class='parentFinder'></span></span>";
$str.="<table class='commentRowTable' width='100%'>";
if (!$print) {
if ($commentData['userID']) {
$imgBig=getPilotPhotoFilename($commentData['userServerID'],$commentData['userID']);
if (is_file($imgBig) ) {
list($width, $height, $type, $attr) = getimagesize($imgBig);
list($width2, $height2)=CLimage::getJPG_NewSize($CONF['photos']['tiny']['max_width'],
$CONF['photos']['tiny']['max_height'], $width, $height);
$header="<img src='".getPilotPhotoRelFilename($commentData['userServerID'],$commentData['userID'],1)."'
width='$width2' height='$height2' border=0>";
} else {
$header="<img src='$moduleRelPath/img/photo_no_profile_photo.jpg' width='50' height='50' border=0>";
}
$str.="<tr><td rowspan='2' width='65' valign='top'><div class='commentHeader'>$header</div></td>";
$str.="<td valign='top'><div id='commentText$commentID' class='commentBody'>".$commentData['text']."</div></td></tr>";
} else {
$header="<img src='$moduleRelPath/img/photo_guest.jpg' width='50' height='50' border=0>";
$str.="<tr><td rowspan='2' width='65' valign='top'><div class='commentHeader'>$header</div></td>";
$str.="<td valign='top'><div id='commentText$commentID' class='commentBody'>".$commentData['text']."</div></td></tr>";
//$str.="<div class='commentHeaderGuest'>".$commentData['guestName']."</div>";
//$str.="<div class='commentBodyGuest'>".$commentData['text']."</div>";
}
} else {
}
$langName=array_search ($commentData['languageCode'], $lang2isoEditor);
$flagCode=$CONF['lang']['lang2countryFlag'][$langName];
// echo "flag_code: $flagCode";
$flagImg=leoHtml::img($flagCode.".gif",18,12,'absmiddle',_LANGUAGE,'fl');
$str.="<tr><td valign='bottom'>";
if ($commentData['userID']) {
$name=$pilotNames[$commentData["userID"]][$commentData["userServerID"]];
if (!$name) {
$name=getPilotRealName($commentData["userID"],$commentData["userServerID"],1,1,1);
$pilotNames[$commentData["userID"]][$commentData["userServerID"]]=$name;
}
$name=prepare_for_js($name);
if (! $print){
$userInfo="<a href=\"javascript:pilotTip.newTip('inline', 0, 13, 'p_$commentID', 250, '".$commentData["userServerID"]."_".$commentData["userID"]."','".addslashes($name)."' )\" onmouseout=\"pilotTip.hide()\">$name</a>\n";
} else {
$userInfo="<span style='color:red;'>$name</span>";
}
} else {
$userInfo="Guest: ".$commentData['guestName']." ";
}
if (!$print) {
$translateText="<span><a id='translate_".$commentData['commentID']."' href='javascript:translateComment(".$commentData['commentID'].",\"".$commentData['languageCode']."\")'>"._Translate.
leoHtml::img("icon_arrow_down.gif",0,0,'absmiddle','','icons1')."</a></span>";
} else {
$translateText='';
$flagImg='';
}
if (! $print){
$str.="<div class='actionBox' id='p_$commentID'>";
$str.="<div class='commentInfo'>".$userInfo." @ ".$commentData['dateUpdated']." GMT $flagImg $translateText </div>";
} else {
$str.="<div align='left'>";
$str.="<div class='commentInfo' style='text-align:left; padding:3px; background-color:#e9e9e9;'>".$userInfo." @ ".$commentData['dateUpdated']." GMT $flagImg $translateText </div>";
$str.="</div>";
$str.="</td></tr>";
$str.="<tr>";
$str.="<td valign='top'><div id='commentText$commentID' class='commentBody'>".$commentData['text']."";
}
if ($CONF['comments']['guestComments'] || $userID>0 ) {
$str.="<div id='parent$commentID' class='commentActions reply'>"._Reply."</div>";
}
if ($moderatorRights || $flight->belongsToUser($userID)) {
$str.="<div id='edit$commentID' class='commentActionsIcons edit'><img src='$moduleRelPath/img/change_icon.png'></div>";
$str.="<div id='delete$commentID' class='commentActionsIcons delete'><img
id='deletep".$commentData['parentID']."' src='$moduleRelPath/img/delete_icon.png'></div>";
}
// $str.="<div style='clear:both'></div>";
$str.="</div>";
$str.="</td></tr>";
$str.="</table>";
$str.="</div>\n";
?>