Ejemplo n.º 1
0
function app()
{
    $uri_arr = explode('?', $_SERVER['REQUEST_URI']);
    $uri = $uri_arr[0];
    if ($uri == '/') {
        ob_start();
        require ROOT_DIR . '/view/main.php';
        $content = ob_get_clean();
        require ROOT_DIR . '/layout.php';
        return;
    } else {
        if (strpos($_SERVER['REQUEST_URI'], '/ajax_make_short_url') === 0) {
            ajax_make_short_url();
            return;
        }
    }
    $is_short_url = is_known_short_url($_SERVER['REQUEST_URI'], $redirect_url);
    if (!$is_short_url) {
        require_once ROOT_DIR . '/404.php';
        return;
    }
    //defalut behavior
    make_redirect($redirect_url);
    return;
}
Ejemplo n.º 2
0
                         break;
                     case 2:
                         // Delete posts
                         unlink(FNEWS_ROOT_PATH . 'news/news.' . $article['news_id'] . '.php');
                         break;
                     default:
                         break;
                 }
             } else {
                 $data .= $news;
             }
         }
         safe_write('news/toc.php', 'wb', $data);
     }
     $title = $ind1;
     echo make_redirect($ind2, '?id=categories', $ind336);
 } else {
     $catid = isset($VARS['category']) ? intval($VARS['category']) : 0;
     if (!category_exists($catid)) {
         trigger_error(sprintf($ind198, $catid), E_USER_WARNING);
     }
     $title = $ind314;
     echo '<form method="post" action="?id=categories">';
     echo get_form_security();
     $file = file(FNEWS_ROOT_PATH . 'users.php');
     array_shift($file);
     $user_array = array();
     foreach ($file as $user) {
         $user = get_line_data('users', $user);
         $user_array[] = array('user' => $user['username'], 'nick' => $user['nickname']);
     }
Ejemplo n.º 3
0
 function run_delete()
 {
     $links_base = $this->gen_menu_links_base();
     $links_export = $links_view = $links_base;
     $this->parse_filters_for_url($links_view);
     //$links_export['table_export_format'] = 'csv';
     $links_export['table_action'] = 'export';
     $menu_links['View Stored Data'] = carl_make_link($links_view);
     $menu_links['Delete Stored Data'] = '';
     $this->delete_form->set_num_rows($this->_total_rows);
     $this->delete_form->provide_link_to_csv_export(carl_make_link($links_export));
     $this->delete_form->generate();
     $status = $this->delete_form->get_status();
     if (empty($status)) {
         echo $this->gen_menu($menu_links);
         echo $this->delete_form->get_form_output();
     } elseif ($status == 'cancel') {
         header('Location: ' . make_redirect($links_view));
     } elseif ($status == 'delete_forever') {
         if ($this->_check_table_exists()) {
             $this->_delete_data();
             echo '<p><strong>Deleted ' . $this->_total_rows . ' row(s)</strong></p>';
         } else {
             echo '<p><strong>There is no data to delete</strong></p>';
         }
     }
 }