Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
- class nggAddGallery {
- /**
- * PHP4 compatibility layer for calling the PHP5 constructor.
- *
- */
- function nggAddGallery() {
- return $this->__construct();
- }
- /**
- * nggAddGallery::__construct()
- *
- * @return void
- */
- function __construct() {
- // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
- $this->filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
- //Look for POST updates
- //if ( !empty($_POST) )
- // $this->processor();
- //var_dump ($_POST);
- }
- /**
- * Perform the upload and add a new hook for plugins
- *
- * @return void
- */
- function processor() {
- global $wpdb, $ngg, $nggdb;
- if ( isset($_POST['confirm']) ){
- //check_admin_referer('ngg_addgallery');
- if ( !nggGallery::current_user_can( 'NextGEN Add new gallery' ))
- wp_die(__('Cheatin’ uh?'));
- include_once ( dirname (__FILE__) . '/csv.php' );
- include_once ( dirname (__FILE__) . '/processor.php' );
- $p = new bg3giProcessor();
- $p->ProcessOneLine();
- usleep(4*1000*1000); //do not stress host!
- }
- }
- /**
- * Render the page content
- *
- * @return void
- */
- function controller() {
- global $ngg, $nggdb;
- if ( !empty($_POST) )
- {
- $this->processor();
- return ;
- }
- ?>
- <form name="confirm" action="<?php echo $PHP_SELF;?>" method="POST">
- <div>
- <br/>
- <br/>
- Push start to begin import<br/>
- <br/>
- <input type="hidden" name="confirm" value="confirmed">
- <br><input type="submit" value="Start!"><br>
- </div>
- </form>
- <?
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement