From 02e72056516de425a39d4816e138c7ac8bcb7efa Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 15 Aug 2012 09:26:00 +0000 Subject: [PATCH] Minor fixes. --- e107_admin/cpage.php | 5 +- .../shortcodes/batch/signup_shortcodes.php | 3 +- e107_plugins/import/admin_import.php | 5 ++ .../import/providers/html_import_class.php | 83 +++++++++++++++++-- e107_themes/templates/fpw_template.php | 2 +- 5 files changed, 87 insertions(+), 11 deletions(-) diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 10a0d6458..1bea2d79c 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -734,7 +734,10 @@ class page_admin_ui extends e_admin_ui { list($tm,$key) = explode("_",$k); - $newData .= "[newpage=".$_POST['page_subtitle'][$key]."]\n"; + if($mode === FALSE) // Pages only, not menus. + { + $newData .= "[newpage=".$_POST['page_subtitle'][$key]."]\n"; + } $newData .= $v."\n\n"; } diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index 1e5957ae6..09ce833dc 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -29,7 +29,7 @@ class signup_shortcodes extends e_shortcode else { return " -
\n + \n

".LAN_NO." ".LAN_YES."
@@ -109,6 +109,7 @@ class signup_shortcodes extends e_shortcode function sc_signup_form_open() { global $rs; + return "
".e107::getForm()->token()."
"; return $rs->form_open("post", e_SELF, "signupform"); } diff --git a/e107_plugins/import/admin_import.php b/e107_plugins/import/admin_import.php index 7f24971c6..9d969c888 100644 --- a/e107_plugins/import/admin_import.php +++ b/e107_plugins/import/admin_import.php @@ -345,6 +345,11 @@ function dbImport($mode='db') return false; } + if(vartrue($converter->override)) + { + return; + } + foreach ($db_import_blocks as $k => $v) diff --git a/e107_plugins/import/providers/html_import_class.php b/e107_plugins/import/providers/html_import_class.php index dd16adca9..843abeca8 100644 --- a/e107_plugins/import/providers/html_import_class.php +++ b/e107_plugins/import/providers/html_import_class.php @@ -23,11 +23,15 @@ require_once('import_classes.php'); class html_import extends base_import_class { + public $override = true; var $sourceType = 'rss'; var $feedUrl = null; var $defaultClass = false; var $useTidy = true; var $action = 'preview'; // default action after setup page; + private $localPath = ''; + private $content = array(); + private $contentArray = array(); function init() { @@ -40,7 +44,45 @@ class html_import extends base_import_class $this->previewContent(); return false; } + + if($_POST['do_conversion']) + { + $import = $this->sortSelection(); + $this->doConversion($import); + + } + } + + + function sortSelection() + { + $import = array(); + foreach($_POST as $k=>$v) + { + + if($v == 'news' || $v=='page') + { + $file = str_replace("add__","",$k); + $import[$v][] = $file; + + } + + } + + return $import; + } + + + function doConversion($data) + { + + print_a($data); + + } + + + function config() { @@ -59,6 +101,22 @@ class html_import extends base_import_class print_a($_POST); + + + + + + + + + + + + + + + + $file = $this->feedUrl; @@ -94,23 +152,28 @@ class html_import extends base_import_class return TRUE; } - private function getAll() + + + + + + private function getAll($root = '') { - $html = $this->getRawHtml(); + $html = $this->getRawHtml($root); $pages = $this->findLinks($html); $c = 0; foreach($pages as $url=>$p) { // echo "url=".$url; - $html = $this->getRawHtml($url); + $html = $this->getAll($url); $html = str_replace("\n","",$html); // strip line-breaks. $html = preg_replace("/([^<]*)<\/title>/i","",$html); $html = trim($html,"\n"); - $body = trim(strip_tags($html,"<b><i><u><strong><br><img><object><embed>")); + $body = trim(strip_tags($html,"<b><i><u><strong><em><br><img><object><embed><a>")); - $content[$url] = array( + $this->content[$url] = array( 'title' => str_replace("\n","",$p['title']), // 'raw' => $html, 'body' => $body @@ -125,9 +188,12 @@ class html_import extends base_import_class } - return $content; + return $this->content; } + + + private function previewContent() { @@ -168,14 +234,14 @@ class html_import extends base_import_class <td>".$data['title']."</td>\n <td>".$tp->text_truncate($data['body'],150)."</td>\n <td class='center middle'> - ".$key." + <a class='e-dialog' href='".$this->localPath.$key."'>".$key."</a> </td> "; $text .= " <td class='center middle'> - ".$frm->selectbox('import_'.$key,array('news'=>'News','page'=>'Page','0'=>'Ignore'))." + ".$frm->selectbox('add__'.$key,array('news'=>'News','page'=>'Page','0'=>'Ignore'))." </td> </tr>"; } @@ -211,6 +277,7 @@ class html_import extends base_import_class $path = md5($this->feedUrl); $local_file = $path."/".$file; + $this->localPath = e_TEMP.$path."/"; if(!is_dir(e_TEMP.$path)) { diff --git a/e107_themes/templates/fpw_template.php b/e107_themes/templates/fpw_template.php index faa337acf..aa1ac0786 100644 --- a/e107_themes/templates/fpw_template.php +++ b/e107_themes/templates/fpw_template.php @@ -10,7 +10,7 @@ if(!isset($FPW_TABLE)) { $FPW_TABLE = " <div style='text-align:center'> - <form method='post' action='".SITEURL."fpw.php'> + <form method='post' action='".SITEURL."fpw.php' autocomplete='off'> <table style='".USER_WIDTH."' class='fborder'> <tr>