$dirmess = changedir($currdir);
}
if ($currsort == "posting_id") {
    $dirbelo = changedir($currdir);
}
if ($currsort == "audio_length") {
    $dirtime = changedir($currdir);
}
//table which should be coded way more beautiful
echo "<table>\n<tr>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirpost . "posted") . "\">date</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirname . "name") . "\">name</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirmess . "message_input") . "\">message</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirbelo . "posting_id") . "\">belongs to</a></th>\n";
echo "<th>play</th>\n";
echo "<th class=\"size\"><a href=\"index.php" . addToUrl("sort", $dirtime . "audio_length") . "\">time</a></th>\n";
echo "<th></th>\n</tr>\n\n";
//one table-row for each entry in the database
for ($i = 0; $i < $rowcount; $i++) {
    echo "<tr>\n";
    //showing the date/time
    $dateformat = $settings['dateformat'];
    $showdate = date($dateformat, strtotime($showtable[$i]['posted']));
    echo "<td>" . $showdate . "</td>\n";
    //showing the commentators name
    echo "<td>" . $showtable[$i]['name'] . "</td>\n";
    //generating the link
    $link = $settings['url'] . "/audio/" . $showtable[$i]['audio_file'];
    //showing the message
    $text = strip_tags($showtable[$i]['message_html']);
    if (substr($text, 0, 80) == $text) {
Пример #2
0
}
//pink print for active sorting type
$pink = array("posted" => "", "author_id" => "", "title" => "", "audio_length" => "", "status" => "");
foreach ($pink as $key => $value) {
    if ($currsort == $key) {
        $pink[$key] = " class=\"pink\"";
    }
}
//generates the links
echo "<th><a" . $pink['posted'] . " href=\"index.php" . addToUrl("sort", $dirpost . "posted") . "\">" . bla("post_date") . "</a></th>\n";
echo "<th><a" . $pink['author_id'] . " href=\"index.php" . addToUrl("sort", $dirauth . "author_id") . "\">" . bla("post_author") . "</a></th>\n";
//echo "<th>".bla("post_sticky")."</th>\n";
echo "<th><a" . $pink['title'] . " href=\"index.php" . addToUrl("sort", $dirtitl . "title") . "\">" . bla("post_title") . "</a></th>\n";
echo "<th>" . bla("post_play") . "</th>\n";
echo "<th><a" . $pink['audio_length'] . " href=\"index.php" . addToUrl("sort", $diraudi . "audio_length") . "\">" . bla("post_length") . "</a></th>\n";
echo "<th><a" . $pink['status'] . " href=\"index.php" . addToUrl("sort", $dirstat . "status") . "\">" . bla("post_status") . "</a></th>\n";
echo "<th></th>\n</tr>\n\n";
//one table-row for each entry in the database
for ($i = 0; $i < $rowcount; $i++) {
    echo "<tr>\n";
    //showing the date/time
    $dateformat = $settings['dateformat'];
    $showdate = date($dateformat, strtotime($showtable[$i]['posted']));
    echo "<td>" . $showdate . "</td>\n";
    //showing the author
    $tempauth = getnickname($showtable[$i]['author_id']);
    if ($tempauth == $_SESSION['nickname']) {
        $tempauth = "<b>" . bla("post_yourself") . "</b>";
    }
    echo "<td>" . $tempauth . "</td>\n";
    //generating the link
function link_next($content)
{
    //generates a href-link to the next page
    global $nextpage;
    if (isset($_GET['page'])) {
        $here = $_GET['page'];
    } else {
        $here = 1;
    }
    if (!isset($_GET['id']) and $nextpage == true) {
        $return = "<a href=\"index.php" . addToUrl("page", $here + 1) . "\" title=\"previous page\">";
        $return .= fullparse(stripcontainer($content));
        $return .= "</a>\n";
    } else {
        $return = "";
    }
    return $return;
}
/**
 * @param string $code
 * @param string $name
 * @param string $canHaveCourses
 * @param int $parent_id
 *
 * @return bool
 */
function addNode($code, $name, $canHaveCourses, $parent_id)
{
    $tbl_category = Database::get_main_table(TABLE_MAIN_CATEGORY);
    $code = trim(Database::escape_string($code));
    $name = trim(Database::escape_string($name));
    $parent_id = trim(Database::escape_string($parent_id));
    $canHaveCourses = Database::escape_string($canHaveCourses);
    $code = generate_course_code($code);
    $result = Database::query("SELECT 1 FROM {$tbl_category} WHERE code='{$code}'");
    if (Database::num_rows($result)) {
        return false;
    }
    $result = Database::query("SELECT MAX(tree_pos) AS maxTreePos FROM {$tbl_category}");
    $row = Database::fetch_array($result);
    $tree_pos = $row['maxTreePos'] + 1;
    $sql = "INSERT INTO {$tbl_category}(name, code, parent_id, tree_pos, children_count, auth_course_child)\n            VALUES('{$name}','{$code}'," . (empty($parent_id) ? "NULL" : "'{$parent_id}'") . ",'{$tree_pos}','0','{$canHaveCourses}')";
    Database::query($sql);
    $categoryId = Database::insert_id();
    updateCategoryChildren($parent_id);
    if (isMultipleUrlSupport()) {
        addToUrl($categoryId);
    }
    return $categoryId;
}
Пример #5
0
/**
 * generates a href-link to the next page
 *
 * @param unknown_type $content
 * @return unknown
 */
function link_next($content)
{
    global $nextpage;
    $here = isset($_GET['page']) ? $_GET['page'] : 1;
    if (!isset($_GET['id']) and $nextpage == true) {
        $return = '<a href="index.php' . addToUrl('page', $here + 1) . '" title="next page">';
        $return .= fullparse(stripcontainer($content));
        $return .= "</a>\n";
    } else {
        $return = '';
    }
    return $return;
}
if ($currsort == "title") {
    $dirtitl = changedir($currdir);
}
if ($currsort == "audio_length") {
    $diraudi = changedir($currdir);
}
if ($currsort == "status") {
    $dirstat = changedir($currdir);
}
//generates the links
echo "<th><a href=\"index.php" . addToUrl("sort", $dirpost . "posted") . "\">date</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirauth . "author_id") . "\">by</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirtitl . "title") . "\">title</a></th>\n";
echo "<th>play</th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $diraudi . "audio_length") . "\">time</a></th>\n";
echo "<th><a href=\"index.php" . addToUrl("sort", $dirstat . "status") . "\">status</a></th>\n";
echo "<th></th>\n</tr>\n\n";
//one table-row for each entry in the database
for ($i = 0; $i < $rowcount; $i++) {
    echo "<tr>\n";
    //showing the date/time
    $dateformat = $settings['dateformat'];
    $showdate = date($dateformat, strtotime($showtable[$i]['posted']));
    echo "<td>" . $showdate . "</td>\n";
    //showing the author
    $tempauth = getnickname($showtable[$i]['author_id']);
    if ($tempauth == $_SESSION['nickname']) {
        $tempauth = "<b>yourself</b>";
    }
    echo "<td>" . $tempauth . "</td>\n";
    //generating the link
/**
 * @param string $code
 * @param string $name
 * @param string $canHaveCourses
 * @param int $parent_id
 *
 * @return bool
 */
function addNode($code, $name, $canHaveCourses, $parent_id)
{
    $tbl_category = Database::get_main_table(TABLE_MAIN_CATEGORY);
    $code = trim($code);
    $name = trim($name);
    $parent_id = trim($parent_id);
    $code = CourseManager::generate_course_code($code);
    $sql = "SELECT 1 FROM {$tbl_category}\n            WHERE code = '" . Database::escape_string($code) . "'";
    $result = Database::query($sql);
    if (Database::num_rows($result)) {
        return false;
    }
    $result = Database::query("SELECT MAX(tree_pos) AS maxTreePos FROM {$tbl_category}");
    $row = Database::fetch_array($result);
    $tree_pos = $row['maxTreePos'] + 1;
    $params = ['name' => $name, 'code' => $code, 'parent_id' => empty($parent_id) ? '' : $parent_id, 'tree_pos' => $tree_pos, 'children_count' => 0, 'auth_course_child' => $canHaveCourses, 'auth_cat_child' => 'TRUE'];
    $categoryId = Database::insert($tbl_category, $params);
    updateParentCategoryChildrenCount($parent_id, 1);
    if (isMultipleUrlSupport()) {
        addToUrl($categoryId);
    }
    return $categoryId;
}
Пример #8
0
}
//pink print for active sorting type
$pink = array("posted" => "", "name" => "", "message_input" => "", "posting_id" => "", "audio_length" => "");
foreach ($pink as $key => $value) {
    if ($currsort == $key) {
        $pink[$key] = " class=\"pink\"";
    }
}
//table which should be coded way more beautiful
echo "<table>\n<tr>\n";
echo "<th><a" . $pink['posted'] . " href=\"index.php" . addToUrl("sort", $dirpost . "posted") . "\">" . bla("com_date") . "</a></th>\n";
echo "<th><a" . $pink['name'] . " href=\"index.php" . addToUrl("sort", $dirname . "name") . "\">" . bla("com_name") . "</a></th>\n";
echo "<th><a" . $pink['message_input'] . " href=\"index.php" . addToUrl("sort", $dirmess . "message_input") . "\">" . bla("com_message") . "</a></th>\n";
echo "<th><a" . $pink['posting_id'] . " href=\"index.php" . addToUrl("sort", $dirbelo . "posting_id") . "\">" . bla("com_belong") . "</a></th>\n";
echo "<th>" . bla("com_play") . "</th>\n";
echo "<th class=\"size\"><a" . $pink['audio_length'] . " href=\"index.php" . addToUrl("sort", $dirtime . "audio_length") . "\">" . bla("com_time") . "</a></th>\n";
echo "<th></th>\n</tr>\n\n";
//one table-row for each entry in the database
for ($i = 0; $i < $rowcount; $i++) {
    echo "<tr class=\"" . $showtable[$i]['id'] . "\">\n";
    //showing the date/time
    $dateformat = $settings['dateformat'];
    $showdate = date($dateformat, strtotime($showtable[$i]['posted']));
    echo "<td class=\"date\">" . $showdate . "</td>\n";
    //showing the commentators name
    echo "<td class=\"author\"><p>" . $showtable[$i]['name'] . "</p></td>\n";
    //generating the link
    $link = $settings['url'] . "/audio/" . $showtable[$i]['audio_file'];
    //showing the message
    $text = strip_tags($showtable[$i]['message_input']);
    if (substr($text, 0, 80) == $text) {
Пример #9
0
echo addToUrl("sort", $dirpost . "posted") . "\">";
echo "<span>" . bla("sta_date") . "</span></a></th>\n";
echo "  <th><a" . $pink['title'] . " href=\"index.php";
echo addToUrl("sort", $dirtitle . "title") . "\">";
echo bla("sta_title") . "</a></th>\n";
echo "  <th class=\"number\"><a" . $pink['countweb'] . " href=\"index.php";
echo addToUrl("sort", $dirweb . "countweb") . "\">";
echo bla("sta_web") . "</a></th>\n";
echo "  <th class=\"number\"><a" . $pink['countfla'] . " href=\"index.php";
echo addToUrl("sort", $dirfla . "countfla") . "\">";
echo bla("sta_fla") . "</a></th>\n";
echo "  <th class=\"number\"><a" . $pink['countpod'] . " href=\"index.php";
echo addToUrl("sort", $dirpod . "countpod") . "\">";
echo bla("sta_pod") . "</a></th>\n";
echo "  <th class=\"number\"><a" . $pink['countall'] . " href=\"index.php";
echo addToUrl("sort", $dirall . "countall") . "\">";
echo bla("sta_all") . "</a></th>\n";
echo "</tr>\n\n";
//showing numbers in a table
foreach ($showtable as $value) {
    echo "<tr>\n";
    echo "  <td class=\"date\">";
    echo date($settings['dateformat'], strtotime($value['posted'])) . "</td>\n";
    echo "  <td><a href=\"index.php?page=record2&amp;do=edit&amp;";
    echo "id=" . $value['id'] . "\">" . $value['title'] . "</a></td>\n";
    echo "  <td class=\"number\">" . $value['countweb'] . "</td>\n";
    echo "  <td class=\"number\">" . $value['countfla'] . "</td>\n";
    echo "  <td class=\"number\">" . $value['countpod'] . "</td>\n";
    echo "  <td class=\"number\">" . $value['countall'] . "</td>\n";
    echo "</tr>\n\n";
}