Beiträge: |
Hallo,
ich habe mir die PHP-Datei opn/system/anypage/admin/importdiradmin.php mal genauer angeschaut und einige ungereimtheiten gefunden. Die entscheidenden Stellen habe ich markiert. Die Probleme sind in der function importdir():
function importdir () {
global $opnConfig, $opnTables;
// HTML-Verzeichnis
$verzeichnis = '';
get_var ('verzeichnis', $verzeichnis, 'form', _OOBJ_DTYPE_CLEAN);
// Kategorie = Verzeichnis
$catname = $verzeichnis;
// Absoluter Pfad
$pfad = $opnConfig['datasave']['anypage_data_url']['path'] . $verzeichnis;
// Rechte
$opnConfig['permission']->HasRights ('system/anypage', array (_ANYPAGE_PERM_IMPORTDIR, _PERM_ADMIN) );
// Save Kategorie Record
$anypage_page_cat_id = $opnConfig['opnSQL']->get_new_number ('anypage_page_cat', 'id');
$anypage_page_cat_name = $opnConfig['opnSQL']->qstr ($catname);
$anypage_page_cat_text = $opnConfig['opnSQL']->qstr ($catname);
$anypage_page_cat_img = $opnConfig['opnSQL']->qstr ('');
$opnConfig['database']->Execute ('INSERT INTO ' . $opnTables['anypage_page_cat'] . " VALUES ($anypage_page_cat_id, $anypage_page_cat_name, $anypage_page_cat_text, $anypage_page_cat_img, 0)");
// Date
$date = Date ('m/d/Y/H/i');
$date_array = explode ('/', $date);
$myyear = $date_array[2];
$mymonth = $date_array[0];
$myday = $date_array[1];
$myhour = $date_array[3];
$mymin = $date_array[4];
$opnConfig['opndate']->setTimestamp ($myyear . '-' . $mymonth . '-' . $myday . ' ' . $myhour . ':' . $mymin . ':00');
$sqldate = '';
$opnConfig['opndate']->opnDataTosql ($sqldate);
// Page Status
$pagestatus = 'V';
// Felder, die nur über Administration eingegeben werden können
$footline = '';
$shortdesc = '';
// Keine Bilddateien durchsuchen
$noext = array('.jpg','.gif','.bmp','.ico');
// Dateiliste
$dateiliste = get_file_list ($pfad,$noext);
if (count ($dateiliste) ) {
usort ($dateiliste, 'strcollcase');
$max = sizeof ($dateiliste);
for ($ii = 0; $ii< $max; $ii++) {
if ($dateiliste[$ii] != 'image') {
// PageName
$pagename = trim ($dateiliste[$ii]);
// new html_destroy class
$str = getdateiany ($dateiliste[$ii], $pfad);
$info = & new html_destroy ($str);
// PageTitle
$title = $info->get_title ();
if ($title ==''){
$title = $pagename;
}
// Parse Body
$body = $info->get_body ();
$info->clean_content ($body);
$body = str_replace ("href="", "href="" . $opnConfig['opn_url'] . '/system/anypage/index.php?page=', $body);
$body = str_replace ("href="" . $opnConfig['opn_url'] . '/system/anypage/index.php?page=#', "href="" . $opnConfig['opn_url'] . '/system/anypage/index.php?page=' . $pagename . '#', $body);
$body = str_replace ("src="", "src="" . $opnConfig['datasave']['anypage_data_url']['url'] . '/' . $catname . '/', $body);
// Free PageId
$anypid = $opnConfig['opnSQL']->get_new_number ('anypage_page', 'id');
// Record Data
$_anypid = $opnConfig['opnSQL']->get_new_number ('anypage_page', 'id');
$_pagename = $opnConfig['opnSQL']->qstr ($pagename);
$_title = $opnConfig['opnSQL']->qstr ($title);
$_footline = $opnConfig['opnSQL']->qstr ($footline);
$_shortdesc = $opnConfig['opnSQL']->qstr ($shortdesc, 'shortdesc');
$_body = $opnConfig['opnSQL']->qstr ($body, 'wpage');
$_pagestatus = $opnConfig['opnSQL']->qstr ($pagestatus);
$_sqldate = $opnConfig['opnSQL']->qstr ($sqldate);
$_anypage_pos = $anypid;
$_anypage_cat = $opnConfig['opnSQL']->qstr ($catname);
// Save New Record
$sql = 'INSERT INTO ' . $opnTables['anypage_page'] . " VALUES ($_anypid, $_pagename, $_title, $_footline, $_shortdesc, $_body, $_pagestatus, $_sqldate, $_anypage_pos, $_anypage_cat, 0, 0, 0, 0)";
$opnConfig['database']->Execute ($sql);
$opnConfig['opnSQL']->UpdateBlobs ($opnTables['anypage_page'], 'id=' . $anypid);
}
}
}
}
Gruß,
Gregor |