- moderiert von:
- Admin
-
- Forenrang:
-
Mitglied
- registriert:
- Januar 1970
- Status:
- offline
- letzter Besuch:
- 02.05.06
- Beiträge:
- 38
add further modules to sitemap:
first add the pnuserapi function in pnuserapi.php like this
//sitemap is pnapi compilant, MODNAME is the name of the module that would be added
function sitemap_userapi_MODNAME($args){
extract($args);
//dependence on modules, some Modules not supportet the pnapi
if (!pnModAPILoad('MODNAME', 'user')) {
die('Could not load MODNAME module API');
}
//db connection
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
//get modules tables and column with pnapi or when not supportet without
$MODtable = &$pntable['MODNAME'];
$MODcolumn = &$pntable['MODNAME_column'];
//dbquery for MODNAME und MODNAME_archiv
//maybe you need more vars for a MODItem as id and title then adapt the query!
if($archiv == 1){
$query = " SELECT $MODcolumn[sid], $MODcolumn[title] FROM $MODtable
//check for active/inactive like WHERE $MODcolumn[active] = 1
ORDER BY $MODcolumn[time] DESC LIMIT 31,200";
}else{
$query = " SELECT $MODcolumn[sid], $MODcolumn[title] FROM
//check for active/inactive like WHERE $MODcolumn[active] = 1
$MODtable ORDER BY $MODcolumn[time] DESC LIMIT 0,30";
}
$sql = $dbconn->Execute($query);
if($dbconn->ErrorNo() != 0) {
echo "DB Error: sitemapMODNAME: " . $dbconn->ErrorNo() . ': ' . $dbconn->ErrorMsg() . '
';
exit ();
}
$res = array();
for($i= 0; !$sql->EOF; $sql->MoveNext()) {
list($id, $title)= $sql->fields;
// name the vars and apapt the $res[]
$res[] = array('id' => $id,
'title' =>$title);
$i++;
}
$sql->Close();
return $res;
}
//second add the pnuser function in pnuser.php
function sitemap_user_MODNAME($args) {
extract($args);
//get the array with all vars from our pnuserapi_function
$url = pnModApiFunc ('sitemap', 'user', 'getlinks', array('name' =>'MODNAME', 'archiv' =>$archiv));
//check permissions
if (!pnSecAuthAction(0, 'fewo::', '::', ACCESS_READ)) {
$output->Text(pnVarPrepHTMLDisplay(_FEWONOAUTH));
return $output->GetOutput();
}
//init the urls array
$urls = array();
foreach( $url as $a) {
foreach($a as $v){
//old module style
$urls[] = "< a href=\"modules.php?op=modload&name=MODNAME&_ADAPT_HERE_VARS=$v[id]\">$v[title]";
//new module style
$urls[] = "< a href=\"index.php?module=MODNAME&_ADAPT_HERE_VARS=$v[id]\">$v[title]";
}
}
return $urls;
}
// third got to pnadminapi.php
// look for line
// $okmods = array('News', 'Sections',.....)
// add MODNAME in this array
// last make your sitemap_table in db empty, i know this is not the best soulution, i work on it!
// go to admin panel sitemap and add modules
// done
Empfehlungen:
GratisCounter||
last minute reisen||
beschichten.net
Hotelbewertungen||
Lastminute, Reisen, Flge||
Reisen
Bayerischer Wald ||
Grosser Arber ||
Deutschland Reisebericht ||
Brasilien Infos
last minute ||
Urlaub Bayrischer Wald ||
Flüge ||
Reiserücktrittsversicherung Würzburger ||