function make_feed_table()
{
    global $feeds_d;
    global $curr_page;
    echo "<table cellpadding=\"0\" cellspacing=\"0\" id=\"feeds-table\">";
    echo "<thead><tr class=\"header\"><th class=\"num\"><input type=\"checkbox\" id=\"check-all\" /></th><th>URL</th><td style=\"width:150px;\">Manage</td></tr></thead>";
    echo "<tbody>";
    for ($n = 0; $n < count($feeds_d); $n++) {
        $feed = $feeds_d[$n];
        $id = $feed['id'];
        $links = generate_manage_links($id, $feed['approved']);
        $manage = $links['manage'];
        $new_note = $links['new_note'];
        $hidden = $links['hidden'];
        $avatar = $feed['avatar'];
        if (strlen($new_note) != 0) {
            $new_class = ' new';
        } else {
            $new_class = '';
        }
        echo "<tr{$hidden} id=\"table-row-{$id}\">" . "<td class=\"num\">" . "<input type=\"checkbox\"/>{$new_note}" . "</td>" . "<td>" . "<img src=\"../{$avatar}\" height=\"15px\" />" . "<a href=\"{$feed['url']}\" target=\"_blank\">{$feed['url']}</a>" . "</td>" . "<td class=\"manage-links\">{$manage}</td>" . "</tr>\n";
    }
    echo "</tbody></table>";
    echo "<script type=\"text/javascript\">\n\t\t\$('#feeds-table').tableSorter({\n\t\t\tsortColumn: 'URL',\n\t\t\tstripingRowClass: ['even','odd'],\n\t\t\tstripRowsOnStartUp: true,\n\t\t\tsortClassAsc: 'sortAsc',\n\t\t\tsortClassDesc: 'sortDesc',\n\t\t\theaderClass: 'sortMisc'\n\t\t});\n\t</script>";
}
function make_plugins_table()
{
    $plugins = list_info_dir('../inc/plugins', 'plugin');
    echo "<table cellpadding=\"0\" cellspacing=\"1px\" id=\"plugins-table\">";
    echo "<thead><tr class=\"header\"><td>Name</td><td>Description</td><td>Manage</td></tr></thead>";
    echo "<tbody>";
    for ($n = 0; $n < count($plugins); $n++) {
        $plugin = $plugins[$n];
        $dir = $plugin[1];
        $attrs = $plugin[0];
        echo "<tr id=\"{$dir}-row\"><td>" . "<img src=\"../inc/plugins/{$dir}/{$attrs['Icon']}\" alt=\"\" style=\"height:16px;\" />" . "<a href=\"{$attrs['PluginURL']}\">{$attrs['PluginName']}</a> <small>{$attrs['PluginVersion']}</small></td>" . "<td>{$attrs['PluginDescrip']} <em>&#8210; <a href=\"{$attrs['AuthorURL']}\">{$attrs['AuthorName']}</a></em></td>" . "<td>" . generate_manage_links($dir) . "</td></tr>";
    }
    echo "</tbody>";
    echo "</table>";
}
         include 'feeds-functions.php';
     }
     $ids = explode(',', $ids);
     for ($n = 0; $n < count($ids); $n++) {
         $id = sql_escape($ids[$n]);
         sql_query("UPDATE feeds SET approved=1 WHERE id='" . sql_escape($id) . "';");
         $curr_feed_d = sql_action("SELECT * FROM feeds WHERE id='" . sql_escape($id) . "';");
         $mail = $curr_feed_d['email'];
         $admin_mail = sql_query("SELECT email FROM users WHERE role_level='admin';");
         $admin_mail = $admin_mail['email'];
         if ($mail != $admin_mail) {
             $mail_cont = nl2br("Your feed on <a href=\"" . get_home_link() . "\">" . get_title() . "</a> has been approved.\n\t\t\t\t\t---\n\t\t\t\t\tPowered by <a href=\"http://project-planetoid.org\">Planetoid</a> " . PLANETOID_VERSION . " - Generated on " . date('r'));
             mail($mail, "Planetoid administration", $mail_cont, "From: Planetoid <*****@*****.**> \r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "X-Mailer: PHP/" . phpversion());
         }
         if ($ajax) {
             $manage = generate_manage_links($id, 1);
             $manage = $manage['manage'];
             echo "\$('#table-row-{$id} td:first img').remove();";
             echo "\$('#table-row-{$id} td:last').html('{$manage}').parent().Highlight(1000,'#64b31b');";
         }
     }
     if (!$ajax) {
         header("Location: {$_GET['r_to']}");
     }
     add_feed($curr_feed_d);
     refresh_cache();
     sql_close();
 } else {
     if ($ajax) {
         echo 'alert("An error occured while adding feed.\\nTry again later.");';
     } else {
    $ajax = true;
}
if (isset($_SESSION['uid']) && $_SESSION['ulevel'] == 'admin') {
    if (isset($_GET['dir'])) {
        include '../config.php';
        include '../planetoid.php';
        if ($ajax) {
            include 'plugins-functions.php';
        }
        $dir = sql_escape($_GET['dir']);
        sql_query("DELETE FROM settings WHERE name='plugin_{$dir}:active';");
        if (file_exists("../inc/plugins/{$dir}/deactivate.php")) {
            include_once "../inc/plugins/{$dir}/deactivate.php";
        }
        if ($ajax) {
            $links = str_replace("'", "\\'", generate_manage_links($dir));
            echo "\$('#{$dir}-row td:last').html('{$links}').parent().Highlight(500, '#e72300');";
        } else {
            header("Location: {$_GET['r_to']}");
        }
        sql_close();
    } else {
        if ($ajax) {
            echo 'alert("An error occured.\\nTry again later.");';
        } else {
            header("Location: {$_GET['r_to']}?failed=true");
        }
    }
} else {
    if ($ajax) {
        echo "window.location= '../login.php';";
示例#5
0
                 }
             }
         } else {
             $to_n = intval($_GET['to_n']);
         }
         if ($to_n == 1) {
             $class_act = 'remove';
             add_feed($current);
         } else {
             $class_act = 'add';
             remove_feed($id);
         }
         sql_query("UPDATE feeds SET approved='{$to_n}' WHERE id='{$id}';");
         sleep(1);
         if ($ajax) {
             $links = generate_manage_links($id, $to_n);
             echo "\$('#table-row-{$id} td:last').html('{$links['manage']}').parent().{$class_act}Class('hidden');";
         }
     }
     if ($ajax) {
         // 				header("Connection: Close");
     } else {
         header("Location: {$_GET['r_to']}");
     }
     refresh_cache();
     sql_close();
 } else {
     if ($ajax) {
         echo 'alert("An error occured.\\nTry again later.");';
     } else {
         header("Location: {$_GET['r_to']}?failed=true");
示例#6
0
         $avatar = 'inc/images/no-avatar.png';
     }
     $insert = sql_query("INSERT INTO feeds VALUES (" . sql_autoid('feeds') . ", '" . sql_escape($_POST['url']) . "', '" . sql_escape($_POST['email']) . "', '{$avatar}', " . sql_escape($_POST['approved']) . ", '" . date('Y-m-d') . "');");
     if (!$insert) {
         if ($ajax) {
             echo "alert('An error occured.');";
         } else {
             header("Location: {$_POST['r_to']}?e=true");
         }
         exit(1);
     }
     if ($ajax) {
         sleep(1);
         $id = sql_action("SELECT id FROM feeds WHERE url='" . sql_escape($_POST['url']) . "';");
         $id = $id['id'];
         $links = generate_manage_links($id, $feed['approved']);
         $manage = $links['manage'];
         $new_note = $links['new_note'];
         $hidden = $links['hidden'];
         $table_row = "<tr{$hidden} id=\"table-row-{$id}\"><td class=\"num\">{$id} {$new_note}</td><td><a href=\"{$feed['url']}\" target=\"_blank\">{$feed['url']}</a></td><td>{$manage}</td></tr>\n";
         echo "\$('#feeds-table tbody').append('{$table_row}');\$('#feeds-table tbody tr:last').Highlight(1000, '#ffe');";
     } else {
         header("Location: {$_POST['r_to']}");
     }
     sql_close();
     refresh_cache();
 } else {
     if ($ajax) {
         echo 'alert("You have to fill all fields execept avatar\'s URL.");';
     } else {
         header("Location: " . r_to(0) . "?e=not-all#" . r_to(1));