#6
Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
29.01.2010 22:24 Hallo,
ich hatte nur einen Punkt, aber einen Unterstrich im Dateinamen(viewcat_alt.php und viewcat_aktuell.php).
Jetzt hab ich die Datei mit unverändertem Dateinamen im Originalzustand genommen; gleiche Meldung: Protector detects attacking actions
Ich kopiere den Dateitext jetzt einfach hier hinein:
*************************************************************
Alte Version:
http://www.xoops.org/> //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include "header.php";
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$mytree = new XoopsTree($xoopsDB->prefix("addresses_cat"),"cid","pid");
$cid = intval($_GET['cid']);
$xoopsOption['template_main'] = 'addresses_viewcat.html';
include XOOPS_ROOT_PATH."/header.php";
if (isset($_GET['show']))
{
$show = intval($_GET['show']);
}
else
{
$show = $xoopsModuleConfig['perpage'];
}
$min = isset($_GET['min']) ? intval($_GET['min']) : 0;
if (!isset($max))
{
$max = $min + $show;
}
if(isset($_GET['orderby']))
{
$orderby = convertorderbyin($_GET['orderby']);
}
else
{
$orderby = "title ASC";
}
// hack LUCIO - start
$pathstring = "";
//$pathstring = "
"._MD_MAIN." : ";
$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
$pathstring = str_replace(':', '>', $pathstring);
//$pathstring = "
"._MD_MAIN." : ";
//$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
// hack LUCIO - end
$xoopsTpl->assign('category_path', $pathstring);
$xoopsTpl->assign('category_id', $cid);
// hack LUCIO - start
$sql = "SELECT title, imgurl, show_map";
$sql.= " FROM ".$xoopsDB->prefix("addresses_cat");
$sql.= " WHERE cid=".$cid;
$result=$xoopsDB->query($sql) or exit("Error");
list($title, $imgurl, $show_map) = $xoopsDB->fetchRow($result);
$description = "";
$sql = "SELECT description";
$sql.= " FROM ".$xoopsDB->prefix("addresses_cat_text");
$sql.= " WHERE cid=".$cid;
$result=$xoopsDB->query($sql) or exit("Error");
list($description) = $xoopsDB->fetchRow($result);
if ($imgurl && $imgurl != "http://")
{$imgurl = $myts->makeTboxData4Edit($imgurl);}
else
{$imgurl = '';}
$xoopsTpl->assign('category_title', $myts->makeTboxData4Show($title));
$xoopsTpl->assign('category_imgurl', $imgurl);
$xoopsTpl->assign('category_show_map', $show_map);
$xoopsTpl->assign('category_description', $myts->makeTareaData4Show($description,0));
// hack LUCIO - end
// get child category objects
$arr=array();
$arr=$mytree->getFirstChild($cid, "title");
if ( count($arr) > 0 )
{
$scount = 1;
foreach($arr as $ele)
{
$sub_arr=array();
$sub_arr=$mytree->getFirstChild($ele['cid'], "title");
$space = 0;
$chcount = 0;
$infercategories = "";
foreach($sub_arr as $sub_ele)
{
$chtitle=$myts->makeTboxData4Show($sub_ele['title']);
if ($chcount>5)
{
$infercategories .= "...";
break;
}
if ($space>0)
{
$infercategories .= ", ";
}
$infercategories .= "
".$chtitle."";
$space++;
$chcount++;
}
$xoopsTpl->append('subcategories', array(
'title' => $myts->makeTboxData4Show($ele['title']),
'id' => $ele['cid'],
'infercategories' => $infercategories,
'totallinks' => getTotalItems($ele['cid'], 1),
'count' => $scount
));
$scount++;
}
}
// hack LUCIO - start
$xoopsTpl->assign('api_key', $xoopsModuleConfig['api_key']);
$xoopsTpl->assign('default_lat', $xoopsModuleConfig['default_lat']);
$xoopsTpl->assign('default_lon', $xoopsModuleConfig['default_lon']);
$xoopsTpl->assign('default_zoom', $xoopsModuleConfig['default_zoom']);
$xoopsTpl->assign('default_address', $xoopsModuleConfig['default_address']);
// hack LUCIO - end
if ($xoopsModuleConfig['useshots'] == 1)
{
$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
$xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
$xoopsTpl->assign('show_screenshot', true);
$xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
}
if (!empty($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid()))
{
$isadmin = true;
}
else
{
$isadmin = false;
}
$fullcountresult=$xoopsDB->query("SELECT count(*) FROM ".$xoopsDB->prefix("addresses_links")." WHERE cid=$cid and status>0");
list($numrows) = $xoopsDB->fetchRow($fullcountresult);
$page_nav = '';
if($numrows>0)
{
$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
$xoopsTpl->assign('lang_address', _MD_ADDRESS);
$xoopsTpl->assign('lang_zip', _MD_ZIP);
$xoopsTpl->assign('lang_city', _MD_CITY);
$xoopsTpl->assign('lang_country', _MD_COUNTRY);
$xoopsTpl->assign('lang_phone', _MD_PHONE);
$xoopsTpl->assign('lang_fax', _MD_FAX);
$xoopsTpl->assign('lang_mobile', _MD_MOBILE);
$xoopsTpl->assign('lang_contemail', _MD_CONTEMAIL);
$xoopsTpl->assign('lang_opened', _MD_OPENED);
$xoopsTpl->assign('lang_viewmore', _MD_VIEWMORE);
$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
$xoopsTpl->assign('lang_hits', _MD_HITSC);
$xoopsTpl->assign('lang_rating', _MD_RATINGC);
$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
$xoopsTpl->assign('lang_modify', _MD_MODIFY);
$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
$xoopsTpl->assign('lang_visit' , _MD_VISIT);
$xoopsTpl->assign('show_links', true);
$xoopsTpl->assign('lang_comments' , _COMMENTS);
// hack LUCIO - start (l.lon, l.lat, l.zoom)
$sql = "SELECT l.lid, l.cid, l.title, l.address, l.zip, l.city, l.country, l.lon, l.lat, l.zoom, l.phone, l.mobile, l.fax, l.contemail, l.opentime, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description";
$sql.= " FROM ".$xoopsDB->prefix("addresses_links")." l, ".$xoopsDB->prefix("addresses_links_text")." t";
$sql.= " WHERE cid=$cid AND l.lid=t.lid AND status>0";
$sql.= " ORDER BY $orderby";
// hack LUCIO - end
$result=$xoopsDB->query($sql,$show,$min);
//if 2 or more items in result, show the sort menu
if($numrows>1)
{
$xoopsTpl->assign('show_nav', true);
$orderbyTrans = convertorderbytrans($orderby);
$xoopsTpl->assign('lang_sortby', _MD_SORTBY);
$xoopsTpl->assign('lang_title', _MD_TITLE);
$xoopsTpl->assign('lang_date', _MD_DATE);
$xoopsTpl->assign('lang_rating', _MD_RATING);
$xoopsTpl->assign('lang_popularity', _MD_POPULARITY);
$xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTEDBY, convertorderbytrans($orderby)));
}
// hack LUCIO - start ($lon, $lat, $zoom)
while(list($lid, $cid, $ltitle, $address, $zip, $city, $country, $lon, $lat, $zoom, $phone, $mobile, $fax, $contemail, $opentime, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result))
// hack LUCIO - end
{
if ($isadmin)
{$adminlink = '
';
$adminlink.= '';
$adminlink.= '';}
else
{$adminlink = '';}
if ($votes == 1)
{$votestring = _MD_ONEVOTE;}
else
{$votestring = sprintf(_MD_NUMVOTES,$votes);}
$path = $mytree->getPathFromId($cid, "title");
$path = substr($path, 1);
$path = str_replace("/","
",$path);
$new = newlinkgraphic($time, $status);
$pop = popgraphic($hits);
//JE moet hieronder nog aanpassen ivm tonen...
$xoopsTpl->append('links', array(
'id' => $lid,
'cid' => $cid,
'rating' => number_format($rating, 2),
// hack LUCIO - start
'title' => $myts->makeTboxData4Show($ltitle),
'new' => $new,
'pop' => $pop,
// hack LUCIO - end
'category' => $path,
'logourl' => $myts->makeTboxData4Show($logourl),
'address' => $myts->makeTboxData4Show($address),
'zip' => $myts->makeTboxData4Show($zip),
'city' => $myts->makeTboxData4Show($city),
'country' => $myts->makeTboxData4Show($country),
// hack LUCIO - start
'lon' => $lon,
'lat' => $lat,
'zoom' => $zoom,
// hack LUCIO - end
'phone' => $myts->makeTboxData4Show($phone),
'fax' => $myts->makeTboxData4Show($fax),
'mobile' => $myts->makeTboxData4Show($mobile),
'contemail' => $myts->makeTboxData4Show($contemail),
'opentime' => $myts->makeTboxData4Show($opentime),
'updated' => formatTimestamp($time,"m"),
'description' => $myts->makeTareaData4Show($description,0),
'adminlink' => $adminlink, 'hits' => $hits,
'comments' => $comments,
'votes' => $votestring,
'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])),
'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/addresses/singlelink.php?cid='.$cid.'&lid='.$lid)
));
}
$orderby = convertorderbyout($orderby);
//Calculates how many pages exist. Which page one should be on, etc...
$linkpages = ceil($numrows / $show);
//Page Numbering
if ($linkpages!=1 && $linkpages!=0)
{
$cid = intval($_GET['cid']);
$prev = $min - $show;
if ($prev>=0)
{
$page_nav .= "
« ";
}
$counter = 1;
$currentpage = ($max / $show);
while ( $counter<=$linkpages )
{
$mintemp = ($show * $counter) - $show;
if ($counter == $currentpage)
{
$page_nav .= "
($counter) ";
}
else
{
$page_nav .= "
$counter ";
}
$counter++;
}
if ( $numrows>$max )
{
$page_nav .= "
";
$page_nav .= "»";
}
}
}
$xoopsTpl->assign('page_nav', $page_nav);
include XOOPS_ROOT_PATH.'/footer.php';
?>
************************************************************
Aktuelle Version:
http://www.xoops.org/> //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include "header.php";
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$mytree = new XoopsTree($xoopsDB->prefix("addresses_cat"),"cid","pid");
$cid = intval($_GET['cid']);
$xoopsOption['template_main'] = 'addresses_viewcat.html';
include XOOPS_ROOT_PATH."/header.php";
if (isset($_GET['show']))
{
$show = intval($_GET['show']);
}
else
{
$show = $xoopsModuleConfig['perpage'];
}
$min = isset($_GET['min']) ? intval($_GET['min']) : 0;
if (!isset($max))
{
$max = $min + $show;
}
if(isset($_GET['orderby']))
{
$orderby = convertorderbyin($_GET['orderby']);
}
else
{
$orderby = "title ASC";
}
// hack LUCIO - start
$pathstring = "";
//$pathstring = "
"._MD_MAIN." : ";
$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
$pathstring = str_replace(':', '>', $pathstring);
//$pathstring = "
"._MD_MAIN." : ";
//$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
// hack LUCIO - end
$xoopsTpl->assign('category_path', $pathstring);
$xoopsTpl->assign('category_id', $cid);
// hack LUCIO - start
$sql = "SELECT title, imgurl, show_map";
$sql.= " FROM ".$xoopsDB->prefix("addresses_cat");
$sql.= " WHERE cid=".$cid;
$result=$xoopsDB->query($sql) or exit("Error");
list($title, $imgurl, $show_map) = $xoopsDB->fetchRow($result);
$description = "";
$sql = "SELECT description";
$sql.= " FROM ".$xoopsDB->prefix("addresses_cat_text");
$sql.= " WHERE cid=".$cid;
$result=$xoopsDB->query($sql) or exit("Error");
list($description) = $xoopsDB->fetchRow($result);
if ($imgurl && $imgurl != "http://")
{$imgurl = $myts->makeTboxData4Edit($imgurl);}
else
{$imgurl = '';}
$xoopsTpl->assign('category_title', $myts->makeTboxData4Show($title));
$xoopsTpl->assign('category_imgurl', $imgurl);
$xoopsTpl->assign('category_show_map', $show_map);
$xoopsTpl->assign('category_description', $myts->makeTareaData4Show($description,0));
// hack LUCIO - end
// get child category objects
$arr=array();
$arr=$mytree->getFirstChild($cid, "title");
if ( count($arr) > 0 )
{
$scount = 1;
foreach($arr as $ele)
{
$sub_arr=array();
$sub_arr=$mytree->getFirstChild($ele['cid'], "title");
$space = 0;
$chcount = 0;
$infercategories = "";
foreach($sub_arr as $sub_ele)
{
$chtitle=$myts->makeTboxData4Show($sub_ele['title']);
if ($chcount>5)
{
$infercategories .= "...";
break;
}
if ($space>0)
{
$infercategories .= ", ";
}
$infercategories .= "
".$chtitle."";
$space++;
$chcount++;
}
$xoopsTpl->append('subcategories', array(
'title' => $myts->makeTboxData4Show($ele['title']),
'id' => $ele['cid'],
'infercategories' => $infercategories,
'totallinks' => getTotalItems($ele['cid'], 1),
'count' => $scount
));
$scount++;
}
}
// hack LUCIO - start
$xoopsTpl->assign('api_key', $xoopsModuleConfig['api_key']);
$xoopsTpl->assign('default_lat', $xoopsModuleConfig['default_lat']);
$xoopsTpl->assign('default_lon', $xoopsModuleConfig['default_lon']);
$xoopsTpl->assign('default_zoom', $xoopsModuleConfig['default_zoom']);
$xoopsTpl->assign('default_address', $xoopsModuleConfig['default_address']);
// hack LUCIO - end
if ($xoopsModuleConfig['useshots'] == 1)
{
$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
$xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
$xoopsTpl->assign('show_screenshot', true);
$xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
}
if (!empty($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid()))
{
$isadmin = true;
}
else
{
$isadmin = false;
}
$fullcountresult=$xoopsDB->query("SELECT count(*) FROM ".$xoopsDB->prefix("addresses_links")." WHERE cid=$cid and status>0");
list($numrows) = $xoopsDB->fetchRow($fullcountresult);
$page_nav = '';
if($numrows>0)
{
$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
$xoopsTpl->assign('lang_address', _MD_ADDRESS);
$xoopsTpl->assign('lang_zip', _MD_ZIP);
$xoopsTpl->assign('lang_city', _MD_CITY);
$xoopsTpl->assign('lang_country', _MD_COUNTRY);
$xoopsTpl->assign('lang_phone', _MD_PHONE);
$xoopsTpl->assign('lang_fax', _MD_FAX);
$xoopsTpl->assign('lang_mobile', _MD_MOBILE);
$xoopsTpl->assign('lang_contemail', _MD_CONTEMAIL);
$xoopsTpl->assign('lang_opened', _MD_OPENED);
$xoopsTpl->assign('lang_viewmore', _MD_VIEWMORE);
$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
$xoopsTpl->assign('lang_hits', _MD_HITSC);
$xoopsTpl->assign('lang_rating', _MD_RATINGC);
$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
$xoopsTpl->assign('lang_modify', _MD_MODIFY);
$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
$xoopsTpl->assign('lang_visit' , _MD_VISIT);
$xoopsTpl->assign('show_links', true);
$xoopsTpl->assign('lang_comments' , _COMMENTS);
// hack LUCIO - start (l.lon, l.lat, l.zoom)
$sql = "SELECT l.lid, l.cid, l.title, l.address, l.zip, l.city, l.country, l.lon, l.lat, l.zoom, l.phone, l.mobile, l.fax, l.contemail, l.opentime, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description";
$sql.= " FROM ".$xoopsDB->prefix("addresses_links")." l, ".$xoopsDB->prefix("addresses_links_text")." t";
$sql.= " WHERE cid=$cid AND l.lid=t.lid AND status>0";
$sql.= " ORDER BY $orderby";
// hack LUCIO - end
$result=$xoopsDB->query($sql,$show,$min);
//if 2 or more items in result, show the sort menu
if($numrows>1)
{
$xoopsTpl->assign('show_nav', true);
$orderbyTrans = convertorderbytrans($orderby);
$xoopsTpl->assign('lang_sortby', _MD_SORTBY);
$xoopsTpl->assign('lang_title', _MD_TITLE);
$xoopsTpl->assign('lang_date', _MD_DATE);
$xoopsTpl->assign('lang_rating', _MD_RATING);
$xoopsTpl->assign('lang_popularity', _MD_POPULARITY);
$xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTEDBY, convertorderbytrans($orderby)));
}
// hack LUCIO - start ($lon, $lat, $zoom)
while(list($lid, $cid, $ltitle, $address, $zip, $city, $country, $lon, $lat, $zoom, $phone, $mobile, $fax, $contemail, $opentime, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result))
// hack LUCIO - end
{
if ($isadmin)
{$adminlink = '
';
$adminlink.= '';
$adminlink.= '';}
else
{$adminlink = '';}
if ($votes == 1)
{$votestring = _MD_ONEVOTE;}
else
{$votestring = sprintf(_MD_NUMVOTES,$votes);}
$path = $mytree->getPathFromId($cid, "title");
$path = substr($path, 1);
$path = str_replace("/","
",$path);
$new = newlinkgraphic($time, $status);
$pop = popgraphic($hits);
//JE moet hieronder nog aanpassen ivm tonen...
$xoopsTpl->append('links', array(
'id' => $lid,
'cid' => $cid,
'rating' => number_format($rating, 2),
// hack LUCIO - start
'title' => $myts->makeTboxData4Show($ltitle),
'new' => $new,
'pop' => $pop,
// hack LUCIO - end
'category' => $path,
'logourl' => $myts->makeTboxData4Show($logourl),
'address' => $myts->makeTboxData4Show($address),
'zip' => $myts->makeTboxData4Show($zip),
'city' => $myts->makeTboxData4Show($city),
'country' => $myts->makeTboxData4Show($country),
// hack LUCIO - start
'lon' => $lon,
'lat' => $lat,
'zoom' => $zoom,
// hack LUCIO - end
'phone' => $myts->makeTboxData4Show($phone),
'fax' => $myts->makeTboxData4Show($fax),
'mobile' => $myts->makeTboxData4Show($mobile),
'contemail' => $myts->makeTboxData4Show($contemail),
'opentime' => $myts->makeTboxData4Show($opentime),
'updated' => formatTimestamp($time,"m"),
'description' => $myts->makeTareaData4Show($description,0),
'adminlink' => $adminlink, 'hits' => $hits,
'comments' => $comments,
'votes' => $votestring,
'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])),
'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/addresses/singlelink.php?cid='.$cid.'&lid='.$lid)
));
}
$orderby = convertorderbyout($orderby);
//Calculates how many pages exist. Which page one should be on, etc...
$linkpages = ceil($numrows / $show);
//Page Numbering
if ($linkpages!=1 && $linkpages!=0)
{
$cid = intval($_GET['cid']);
$prev = $min - $show;
if ($prev>=0)
{
$page_nav .= "
« ";
}
$counter = 1;
$currentpage = ($max / $show);
while ( $counter<=$linkpages )
{
$mintemp = ($show * $counter) - $show;
if ($counter == $currentpage)
{
$page_nav .= "
($counter) ";
}
else
{
$page_nav .= "
$counter ";
}
$counter++;
}
if ( $numrows>$max )
{
$page_nav .= "
";
$page_nav .= "»";
}
}
}
$xoopsTpl->assign('page_nav', $page_nav);
include XOOPS_ROOT_PATH.'/footer.php';
?>
***********************************************************
Gruß
harry27