function ForumPermTable($fid, $fpl = array()) { global $permCats, $permDescs; if (!$fid) { echo ' <tr class="header0"> <th colspan="2">' . __('Add permission set') . '</th> </tr> <tr> <td class="cell2 center">Forum</td> <td class="cell1">' . makeForumList('newforumid', 0) . '</td> </tr> <tr class="header0"> <th colspan="2" style="height:6px;"></th> </tr>'; } else { echo ' <tr class="header0"> <th colspan="2">' . htmlspecialchars($fpl['_ftitle']) . '</th> </tr>'; unset($fpl['_ftitle']); } $lastcat = -1; $pd = array('forum' => $permDescs['forum'], 'mod' => $permDescs['mod']); foreach ($pd as $cat => $perms) { if ($lastcat != $cat) { if ($lastcat != -1) { echo ' <tr class="header0"> <th colspan="2" style="height:6px;"></th> </tr>'; } $lastcat = $cat; } foreach ($perms as $permid => $permname) { $pkey = 'fperm_' . $fid . '_' . str_replace('.', '_', $permid); echo ' <tr> <td class="cell2 center" style="width: 250px;">' . htmlspecialchars($permname) . '</td> <td class="cell1">' . (CanEditPerm($permid, $fid) ? PermSwitch($pkey, true, $fpl[$permid]) : PermLabel($fpl[$permid])) . '</td> </tr>'; } } if (!$fid) { echo ' <tr class="header0"> <th colspan="2" style="height:6px;"></th> </tr> <tr> <td class="cell2"> </td> <td class="cell1"><input type="submit" name="addfpermaction" value="' . __('Add permissions') . '"></td> </tr>'; } }
if ($iconid == $i) { $check = "checked=\"checked\" "; } $icons .= "\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check} name=\"iconid\" value=\"{$i}\">\n\t\t\t\t\t\t<img src=\"" . resourceLink("img/icons/icon{$i}.png") . "\" alt=\"Icon {$i}\" onclick=\"javascript:void()\">\n\t\t\t\t\t</label>"; $i++; } $check[0] = ""; $check[1] = ""; if ($iconid == 0) { $check[0] = "checked=\"checked\" "; } if ($iconid == 255) { $check[1] = "checked=\"checked\" "; } $iconSettings = "\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[0]} name=\"iconid\" value=\"0\">\n\t\t\t\t\t\t<span>" . __("None") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} name=\"iconid\" value=\"255\">\n\t\t\t\t\t\t<span>" . __("Custom") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type=\"text\" name=\"iconurl\" size=60 maxlength=\"100\" value=\"" . htmlspecialchars($iconurl) . "\">"; $fields['title'] = "<input type=\"text\" id=\"tit\" name=\"title\" size=80 maxlength=\"60\" value=\"" . htmlspecialchars($thread['title']) . "\">"; $fields['icon'] = $iconSettings; } if ($canClose) { $fields['closed'] = "<label><input type=\"checkbox\" name=\"isClosed\" " . ($thread['closed'] ? " checked=\"checked\"" : "") . "> " . __('Closed') . "</label>"; } if ($canStick) { $fields['sticky'] = "<label><input type=\"checkbox\" name=\"isSticky\" " . ($thread['sticky'] ? " checked=\"checked\"" : "") . "> " . __('Sticky') . "</label>"; } if ($canMove) { $fields['forum'] = makeForumList('moveTo', $thread['forum']); } $fields['btnEditThread'] = "<input type=\"submit\" name=\"actionedit\" value=\"" . __("Edit") . "\">"; echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . htmlentities(actionLink("editthread")) . "\" method=\"post\">"; RenderTemplate('form_editthread', array('fields' => $fields, 'canRename' => $canRename, 'canClose' => $canClose, 'canStick' => $canStick, 'canMove' => $canMove)); echo "\n\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\">\n\t\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser['token'] . "\">\n\t\t<input type=\"hidden\" name=\"ref\" value=\"" . htmlspecialchars($_SERVER['HTTP_REFERER']) . "\">\n\t</form>";
$input = "<input type=\"text\" id=\"{$name}\" name=\"{$name}\" value=\"{$value}\" />"; } else { if ($type == "text") { $input = "<input type=\"text\" id=\"{$name}\" name=\"{$name}\" value=\"{$value}\" class=\"width75\"/>"; } else { if ($type == "password") { $input = "<input type=\"password\" id=\"{$name}\" name=\"{$name}\" value=\"{$value}\" class=\"width75\"/>"; } else { if ($type == "textbox" || $type == "textbbcode") { $input = "<textarea id=\"{$name}\" name=\"{$name}\" rows=\"8\">\n{$value}</textarea>"; } else { if ($type == "texthtml") { $input = "<textarea id=\"{$name}\" name=\"{$name}\" rows=\"30\">\n{$value}</textarea>"; } else { if ($type == "forum") { $input = makeForumList($name, $value, true); } else { if ($type == 'group') { $input = makeSelect($name, $value, $grouplist); } else { if ($type == "theme") { $input = makeThemeList($name, $value); } else { if ($type == "layout") { $input = makeLayoutList($name, $value); } else { if ($type == "language") { $input = makeLangList($name, $value); } } }
$_POST['iconid'] = 0; } else { $_POST['iconid'] = 255; $_POST['iconurl'] = $thread['icon']; } } //ICONS! $icons = ""; $i = 1; while (is_file("img/icons/icon" . $i . ".png")) { $check = ""; if ($_POST['iconid'] == $i) { $check = "checked=\"checked\" "; } $icons .= "\t<label>\n\t\t\t\t\t<input type=\"radio\" {$check} name=\"iconid\" value=\"{$i}\" />\n\t\t\t\t\t<img src=\"" . resourceLink("img/icons/icon{$i}.png") . "\" alt=\"Icon {$i}\" onclick=\"javascript:void()\" />\n\t\t\t\t</label>"; $i++; } $check[0] = ""; $check[1] = ""; if ($_POST['iconid'] == 0) { $check[0] = "checked=\"checked\" "; } if ($_POST['iconid'] == 255) { $check[1] = "checked=\"checked\" "; $iconurl = $_POST['iconurl']; } if ($canMod) { echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . actionLink("editthread") . "\" method=\"post\">\n\t\t<table class=\"outline margin\" style=\"width: 100%;\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Edit thread") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"tit\">" . __("Title") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td id=\"threadTitleContainer\">\n\t\t\t\t\t<input type=\"text\" id=\"tit\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"" . htmlspecialchars($_POST['title']) . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Icon") . "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"threadIcons\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[0]} id=\"noicon\" name=\"iconid\" value=\"0\">\n\t\t\t\t\t\t" . __("None") . "\n\t\t\t\t\t</label>\n\t\t\t\t\t{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} name=\"iconid\" value=\"255\" />\n\t\t\t\t\t\t<span>" . __("Custom") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type=\"text\" name=\"iconurl\" style=\"width: 50%;\" maxlength=\"100\" value=\"" . htmlspecialchars($iconurl) . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Extras") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"isClosed\" " . ($thread['closed'] ? " checked=\"checked\"" : "") . " />\n\t\t\t\t\t\t" . __("Closed") . "\n\t\t\t\t\t</label>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"isSticky\" " . ($thread['sticky'] ? " checked=\"checked\"" : "") . " />\n\t\t\t\t\t\t" . __("Sticky") . "\n\t\t\t\t\t</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Move") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t" . makeForumList('moveTo', $thread["forum"]) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"asdf\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{$loguser["token"]}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>"; } else { echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . actionLink("editthread") . "\" method=\"post\">\n\t\t<table class=\"outline margin width50\">\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"tit\">" . __("Title") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"tit\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"" . htmlspecialchars($_POST['title']) . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Icon") . "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"threadIcons\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[0]} id=\"noicon\" name=\"iconid\" value=\"0\">\n\t\t\t\t\t\t" . __("None") . "\n\t\t\t\t\t</label>\n\t\t\t\t\t{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} name=\"iconid\" value=\"255\" />\n\t\t\t\t\t\t<span>" . __("Custom") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type=\"text\" name=\"iconurl\" style=\"width: 50%;\" maxlength=\"100\" value=\"" . htmlspecialchars($iconurl) . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"asdf\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{$loguser["token"]}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>"; }