Ejemplo n.º 1
0
                }
            } else {
                if (!empty($get_gallery['flag'])) {
                    if (empty($get_gallery['filename'])) {
                        $unlink_gallery = $get_gallery['flag'];
                    } else {
                        $unlink_gallery = $get_gallery['flag'];
                    }
                } else {
                    $unlink_gallery = $get_gallery['filename'];
                }
                $filename_gallery = $gallery_flag;
            }
            if (!empty($get_gallery['filename']) and $get_gallery['filename'] != $get_gallery['flag'] and file_exists($get_gallery['flag'])) {
                unlink($get_gallery['flag']);
            }
            if ($count_gallery['rows'] > 0) {
                $gallery_order = 1;
                update_gallery($filename_gallery, $link, $order, $unlink_gallery, $gallery_id);
            } else {
                $gallery_order = $latest_gallery_order['order'] + 1;
                if ($count_gallery['rows'] < 10) {
                    insert_gallery($filename_gallery, 'NOT DEFINED YET', $gallery_order, $unlink_gallery);
                }
                //insert_gallery($gallery_id, $filename, $link, $order, $flag)
            }
        }
        // END FOR
        /* -- END gallery -- */
    }
}
Ejemplo n.º 2
0
        fwrite($gallery_fp, $url . "\n");
        fwrite($gallery_fp, $image . "\n");
        echo "{$name}\n{$url}\n{$image}\n";
    }
    fclose($gallery_fp);
    echo "</pre>\n";
    echo "done.<br/>\n";
}
function update_discussion()
{
    global $FEED_URL;
    global $MAX_DISCUSSION_ENTRIES;
    echo "Downloading feed...<br>\n";
    $feed = file_get_contents($FEED_URL);
    $doc = domxml_open_mem($feed);
    $entry_count = 0;
    $doc_element = $doc->document_element();
    $child_nodes = $doc_element->child_nodes();
    foreach ($child_nodes as $node) {
        if ($node->node_type() == XML_ELEMENT_NODE && $node->node_name() == 'entry') {
            $entry_count += 1;
            if ($entry_count > $MAX_DISCUSSION_ENTRIES) {
                $doc_element->remove_child($node);
            }
        }
    }
    $doc->dump_file('pyglet-users.xml');
}
ob_end_flush();
update_gallery();
//update_discussion();