1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Minor fixes.

This commit is contained in:
CaMer0n
2012-08-15 09:26:00 +00:00
parent 52867719d4
commit 02e7205651
5 changed files with 87 additions and 11 deletions

View File

@@ -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";
}

View File

@@ -29,7 +29,7 @@ class signup_shortcodes extends e_shortcode
else
{
return "
<form method='post' action='".e_SELF."?stage1' >\n
<form method='post' action='".e_SELF."?stage1' autocomplete='off'>\n
<div><br />
<input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_NO."
<input type='radio' name='coppa' value='1' /> ".LAN_YES."<br />
@@ -109,6 +109,7 @@ class signup_shortcodes extends e_shortcode
function sc_signup_form_open()
{
global $rs;
return "<form action='".e_SELF."' method='post' id='signupform' autocomplete='off'><div>".e107::getForm()->token()."</div>";
return $rs->form_open("post", e_SELF, "signupform");
}

View File

@@ -345,6 +345,11 @@ function dbImport($mode='db')
return false;
}
if(vartrue($converter->override))
{
return;
}
foreach ($db_import_blocks as $k => $v)

View File

@@ -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>([^<]*)<\/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))
{

View File

@@ -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>