function tagcloud() { //outputs a string containing all tags. //Each tag is placed in a span, with a class representing its tag-weight. //CSS can be used to style the classes tagweight1 a, tagweight2 a, etc up to tagweight5 a. $weights = gettaglist(true); $taglist = array_keys($weights); $return = "<p>"; foreach ($taglist as $tag) { $f = 5; $t_i = $weights[$tag]; $t_min = 1; $t_max = max($weights); $s_i = $t_i > $t_min ? $f * ($t_i - $t_min) / ($t_max - $t_min) : $t_min; $tagweight = (int) ceil($s_i); $return .= "<span class=\"tagweight" . $tagweight . "\"><a href=\"index.php?tag=" . killentities($tag) . "\" title=\"All postings tagged " . stripusc($tag) . "\">" . stripusc($tag) . "</a></span> "; } $return .= "</p>"; return $return; }
<?php header("Content-type: text/html; charset=utf-8"); session_start(); include "inc/accesscheck.php"; if (isset($_GET['test'])) { var_dump(gettaglist(false, $_GET['test'])); } //show the login-screen if access is denied if ($access) { $p = $_POST; //which table are we in? $table = $GLOBALS['prefix'] . 'lb_'; $tables = array("authors" => "authors", "categories" => "categories", "comments" => "comments", "links" => "links", "postings" => "postings", "settings" => "settings"); $table .= $tables[$p['table']]; //which row do we manipulate? $rowpick = ""; if (isset($p['rowpick'])) { $rowpick = $p['rowpick']; } $rowval = ""; if (isset($p['rowval'])) { $rowval = $p['rowval']; } //which column do we manipulate or read? $colpick = ""; if (isset($p['colpick'])) { $colpick = $p['colpick']; } $colval = ""; if (isset($p['colval'])) {
function showcatsandauthors() { global $settings; //-------------------- authors-list ---------- echo "<div id=\"authors\">\n"; echo "<h2>" . bla("org_editauthors") . "</h2>\n\n"; //starting the table echo "<table>\n\n"; echo "<tr><th>" . bla("org_nickname") . "</th><th>" . bla("org_fullname") . "</th><th>" . bla("org_mail") . "</th>"; echo "<th>" . bla("org_rights") . "</th><th></th></tr>"; //getting all data from authors-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_authors ORDER BY id"; $result = $GLOBALS['lbdata']->GetArray($dosql); $i = 1; foreach ($result as $row) { echo "<tr>\n"; /* //showing date/time of joining $dateformat = $settings['dateformat']; $showdate = date($dateformat , strtotime($row['joined'])); echo "<td>" . $showdate . "</td>\n"; */ echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['nickname'] . "</a></td>\n"; echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['realname'] . "</a></td>\n"; echo "<td><a href=\"mailto:" . $row['mail'] . "\">" . $row['mail'] . "</a></td>\n"; //show the author's publication-rights echo "<td>\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_own']) . " title=\"" . bla("org_right1") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_own']) . " title=\"" . bla("org_right2") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_all']) . " title=\"" . bla("org_right3") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_all']) . " title=\"" . bla("org_right4") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['admin']) . " title=\"" . bla("org_right5") . "\" />\n</td>\n"; //a simple delete button echo "<td class=\"right\">\n"; echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=delauthor&id=" . $row['id']; echo "\" onSubmit=\"return yesno('" . bla("alert_deleteauthor") . "')\">\n"; echo "<input type=\"submit\" value=\"" . bla("but_delete") . "\" />\n</form>\n</td>\n"; echo "</tr>\n\n"; $i += 1; } //button for new author echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=newauthor\">"; echo "<tr>\n"; echo "<td><input type=\"text\" name=\"newnick\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newname\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newmail\" value=\"\" /></td>\n"; echo "<td></td>\n<td class=\"right\">\n"; echo "<input type=\"submit\" value=\"" . bla("but_new") . "\" />\n"; echo "</td>\n</tr>\n</form>\n</table>\n"; echo "</div>\n\n\n"; //-------------------- categories ---------- echo "<div id=\"categories\">\n"; echo "<h2>" . bla("org_editcats") . "</h2>\n\n"; //getting all data from category-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_categories ORDER BY id;"; $result = $GLOBALS['lbdata']->GetArray($dosql); $i = 1; foreach ($result as $row) { $cats[$i] = $row; $i += 1; } //start the form echo "<form action=\"index.php?page=organisation&do=savecats\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; //show all items in each list echo "<table>\n"; echo "<tr><th>" . bla("org_catname") . "</th><th>" . bla("org_catdesc") . "</th><th></th></tr>"; $i = 1; foreach ($cats as $showcat) { //show category echo "<tr>\n<td>\n"; echo "<input class=\"cat\" type=\"text\" value=\"" . $cats[$i]['name']; echo "\" name=\"cat" . $cats[$i]['id'] . "\" />\n</td>\n<td>"; //show description echo "<input class=\"desc\" type=\"text\" value=\"" . $cats[$i]['description']; echo "\" name=\"desc" . $cats[$i]['id'] . "\" />\n</td>\n"; //show delete button echo "<td class=\"right\"><input onClick=\"return yesno('" . bla("msg_deletecategory") . "')\" type=\"submit\" value=\"" . bla("but_delete") . "\" "; echo "name=\"del" . $cats[$i]['id'] . "\" />\n</td>\n</tr>\n\n"; $i += 1; } //show a new category, which is to be filled echo "<tr>\n<td>"; echo "<input class=\"cat\" name=\"newcat\" type=\"text\" value=\"\" /></td>\n"; echo "<td><input class=\"desc\"name=\"newdesc\" type=\"text\" value=\"\" />"; echo "</td><td class=\"right\"><<< " . bla("org_addnew") . " </td>\n"; echo "</tr>\n"; echo "<tr class=\"last\"><td colspan=\"2\"></td>"; echo "<td class=\"right\"><input type=\"submit\" value=\"" . bla("but_saveall") . "\" /></td>"; echo "</table>"; echo "</form>\n"; // ----- Tags -----------------------// echo "\n\n<h2>" . bla("org_cattag") . "</h2>\n\n"; echo "<table><tr><th>" . bla("org_cat") . "</th><th>" . bla("org_newtag") . "</th><th></th></tr>"; echo "<form action=\"index.php?page=organisation&do=tagfromcat\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; echo "<tr><td>"; echo "<select name=\"catname\" class=\"cat\">"; $i = 1; foreach ($cats as $showcat) { echo "<option value=\"" . $cats[$i]['id'] . "\">" . $cats[$i]['name'] . "</option>"; $i += 1; } echo "</select>"; echo "</td><td>"; echo "<input type=\"text\" name=\"newtagname\" value=\"\" class=\"tag\" />"; echo "</td><td>"; echo "<input type=\"submit\" value=\"Make tag\" />"; echo "</td></tr>"; echo "</table>"; echo "</form>"; echo "<p>" . bla("org_cattag_help") . "</p>\n"; echo "\n\n<h2>" . bla("org_managetags") . "</h2>\n\n"; echo "<table><tr><th>" . bla("org_tag") . "</th><th>" . bla("org_action") . "</th><th>" . bla("org_newname") . "</th></tr>"; echo "<form action=\"index.php?page=organisation&do=edittag\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; echo "<tr><td>"; echo "<select name=\"tagnames\" class=\"cat\">"; $taglist = gettaglist(); foreach ($taglist as $tag) { echo "<option value=\"" . $tag . "\">" . $tag . "</option>\n"; } echo "</td><td><input type=\"radio\" name=\"tagaction\" value=\"deletetag\"> " . bla("org_deletetag") . "</td><td></td></tr>\n"; echo "<tr><td></td><td><input type=\"radio\" name=\"tagaction\" value=\"amendtag\"> " . bla("org_replacetag") . " >>></td>\n"; echo "<td><input type=\"text\" name=\"newtagname\" class=\"tag\" /></td></tr>"; echo "<tr><td></td><td><input type=\"radio\" name=\"tagaction\" value=\"createcat\"> " . bla("org_tagtocat") . " >>></td>\n"; echo "<td><select name=\"catname\" class=\"tag\">"; $i = 1; foreach ($cats as $showcat) { echo "<option value=\"" . $cats[$i]['id'] . "\">" . $cats[$i]['name'] . "</option>"; $i += 1; } echo "</select></td></tr>"; echo "<tr><td></td><td></td><td><input onClick=\"return yesno('" . bla("org_confirmchange") . "')\" type=\"submit\" value=\"Submit\" /></td></tr>"; echo "</form></table>\n"; echo "<p>" . bla("org_managetags_help") . "</p>"; echo "</div>\n\n"; }
<?php header("Content-type: text/html; charset=utf-8"); session_start(); // sleep(1); include "inc/accesscheck.php"; $tags = gettaglist(); $q = isset($_GET['q']) ? $_GET['q'] : ''; foreach ($tags as $tag) { if (eregi("^" . $q, $tag)) { echo $tag . "\r\n"; } }