コード例 #1
0
function insertSubcategory($category)
{
    foreach ($category->subCategories->category as $subcategory) {
        insert_page($subcategory->id, $subcategory->name, (int) $category->id);
        if (isset($subcategory->subCategories)) {
            insertSubcategory($subcategory);
        }
    }
}
コード例 #2
0
function insert_data_by_state($state_abbrev)
{
    $url = "http://209.200.89.252/search_site/list.cfm?program_name=&ZipInput=&ZipRadius=&state=" . $state_abbrev . "&city=&county=&org_type=&language=&service_type_prev=&addtl_info=&submit=Search";
    $per_page = 15;
    $html = file_get_html($url, 10);
    $count = preg_split("/ /", trim($html->find('.recordcounts', 0)->plaintext))[4];
    $page_num = $count % $per_page == 0 ? floor($count / $per_page) - 1 : floor($count / $per_page);
    for ($i = 0; $i <= $page_num; $i++) {
        $start = $i * $per_page + 1;
        $url = "http://209.200.89.252/search_site/list.cfm?program_name=&ZipInput=&ZipRadius=&state=" . $state_abbrev . "&city=&county=&org_type=&language=&service_type_prev=&addtl_info=&submit=Search";
        $url = $url . "&int_startrow=" . $start;
        var_dump($url . '<br/>');
        insert_page($url);
    }
}
コード例 #3
0
ファイル: index.php プロジェクト: alcides/e107wiki
<?php

// Initial imports
if (!defined("e107_INIT")) {
    require_once "../../class2.php";
}
include_lan(e_PLUGIN . 'wiki/languages/' . e_LANGUAGE . '.php');
require_once e_PLUGIN . 'wiki/preferences.php';
require_once e_PLUGIN . 'wiki/templates.php';
require_once e_PLUGIN . 'wiki/utils.php';
$has_page = False;
if (isset($_POST['title'])) {
    insert_page();
}
$elements = explode(".", $_SERVER['QUERY_STRING']);
if ($elements[0] == "new") {
    $title = "New Page";
    $param = array();
    if (count($elements) > 1) {
        $param['page_title'] = $elements[1];
    }
    $content = "" . page_form($param);
} elseif ($elements[0] == "edit" || $elements[0] == "revert" || $elements[0] == "delete") {
    $page = mysql_real_escape_string($elements[1]);
    $count = $sql->db_Select("wiki", "*", "page_id = '" . $page . "' and page_active=1", true);
    if ($count > 0) {
        $row = $sql->db_Fetch();
        $content = "" . page_form($row);
        if ($elements[0] == "revert") {
            $content .= get_history($page);
        }