Fork me on GitHub
"XOOPS ist ein dynamisches OO (Objekt Orientiertes) open source Portal Script geschrieben in PHP. XOOPS ist ein ideales CMS (Content Management System) für den Aufbau von kleineren und grösseren Communities, Firmen-, Intra- und Internet-Portale, Web-Logs und vieles mehr."
forum
Bitte schaut in die DOKUMENTATION oder benutzt die SUCHFUNKTION bevor Ihr Eure Fragen im Forum stellt. Viele Fragen wurden bereits gestellt.

Leser in diesem Thema:   1 Anonyme(r)


(1) 2 3 4 »


Sortierung nach Postleitzahl in Modul ADDRESSES
#1
Benutzerinformationen
Hallo Community,

im Modul ADDRESSES Version 1.72 möchte ich die Ausgabe nach PLZ sortieren. Dazu habe ich bislang
- addresses_viewcat.html wie folgt ergänzt (analog den übrigen Sortierkriterien wie hits oder city)

<--!
<{
$lang_zip}>
(<
a href="viewcat.php?cid=<{$category_id}>&orderby=zipA"><img src="images/up.gif" border="0" align="middle" alt="" />
</
a><a href="viewcat.php?cid=<{$category_id}>&orderby=zipD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
-->


- Anpassung in language/german/main.php
- anpassung in include/functions.php

Leider funktioniert die Sortierung nicht und die Anzeige PLZ auf-/absteigend kommt nicht, stattdesen die default-Anzeige mit dem Datum.

Bitte um Eure Hilfe. Danke im Voraus!

Harry27

Edit Muki: Code formatiert

Geschrieben: 29.01.2010

Bearbeitet von Muki am 29.01.2010 14:36:38
Grund:
Erstelle PDF des Beitrags Drucke

Gast
Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#2
Gast-Gast
kannst du mal den script viewcat.php zur Verfügung stellen.

(Datei anhängen und hochladen)

Geschrieben: 29.01.2010
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#3
Benutzerinformationen
Eigentlich bräuchten wir nur ein Vorher, Nachher.

Also den Code vor der Änderung und nach der Änderung des template.

Muki

Geschrieben: 29.01.2010
_________________
Es gibt keine dummen Fragen, nur dumme Antworten (Ausnahmen bestätigen die Regel).
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#4
Benutzerinformationen
Hallo zusammen,

glaube nicht, dass ich an der Datei was geändert habe. Beim Hochladen erhalte ich die Meldung:
Protector detects attacking actions

Wie kann ich Euch die Datei zukommen lassen?

Gruß

harry27

Geschrieben: 29.01.2010
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#5
Benutzerinformationen
Indem du in dem Dateinamen nur einen Punkt (.) verwendest! Dem Protector (ärks) stoßen zwei Punkte (..) im Dateinamen sauer auf.

Geschrieben: 29.01.2010
_________________
if(ahnung == 0) {use SEARCH; use BRAIN; use GOOGLE; } else {make post;}
Wie man Fragen richtig stellt
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#6
Benutzerinformationen
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:

// $Id: viewcat.php,v 1.12 2003/03/27 12:11:07 w4z004 Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <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.= ''._MD_EDITTHISLINK.'';
$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:

// $Id: viewcat.php,v 1.12 2003/03/27 12:11:07 w4z004 Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <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.= ''._MD_EDITTHISLINK.'';
$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

Geschrieben: 29.01.2010
Erstelle PDF des Beitrags Drucke

Gast
Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#7
Gast-Gast
Zitat:

harry27 schrieb:

<--!
<{
$lang_zip}>
(<
a href="viewcat.php?cid=<{$category_id}>&orderby=zipA"><img src="images/up.gif" border="0" align="middle" alt="" />
</
a><a href="viewcat.php?cid=<{$category_id}>&orderby=zipD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
-->



Der Script ist soweit OK.
Was mir hier nur auffällt ist deine Parameterübergabe. Ändere mal &orderby=zipA in &orderby=zip%20ASC ab, dann sollte es funktionieren. Es sei denn, dass die Funktion convertorderbytrans() den Parameter verändert. Eventuell den source von convertorderbytrans() hier noch posten.

Geschrieben: 30.01.2010
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#8
Benutzerinformationen
Zitat:

feichtl schrieb:
Indem du in dem Dateinamen nur einen Punkt (.) verwendest! Dem Protector (ärks) stoßen zwei Punkte (..) im Dateinamen sauer auf.


liegt daran, das php Dateien geuplodet werden sollten. Das ist generell nicht möglich. Also entweder als txt oder zip Datei.

Geschrieben: 30.01.2010
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#9
Benutzerinformationen
I hope you understand english.

Since the adresses module (1.7) original was made by me, later on the google map hack was added by lucio...

To change the order you also have to adjust the php script:
addresses/include: functions.php
Prox line 49 - Link sorting function order by title order by ...
Prox line 92 order by title order by ...

you need to change title into city

Keep in mind that this will NOT change the sort order option above the overview. This will still be title/date etc. If you want to change this, than you have to adjust this also. Instead of title, city. Or you can add antoher sort option.
Look for: //if 2 or more items in result, show the sort menu
You can copy and paste the below code. As you can see I ADDED the option City.
//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_city'_MD_CITY);
        
$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_CURSORTEDBYconvertorderbytrans($orderby)));

Then you need to adjust the template:
addresses_viewcat.html
Look for:
<{if $show_nav == true}>
      <
div><{$lang_sortby}>&nbsp;&nbsp;<{$lang_title}> (<a href="viewcat.php?cid=<{$category_id}>&orderby=titleA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&orderby=titleD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_date}> (<a href="viewcat.php?cid=<{$category_id}>&orderby=dateA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&orderby=dateD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_rating}> (<a href="viewcat.php?cid=<{$category_id}>&orderby=ratingA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&orderby=ratingD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_popularity}> (<a href="viewcat.php?cid=<{$category_id}>&orderby=hitsA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&orderby=hitsD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
      <
br /><b><{$lang_cursortedby}></b>
      </
div>

Here you need to change the first 2 line sort by titleA into cityA and titleD into cityD. Now the standard sortorder will be on city.
I would advice you if you do this to add the sortorder title option into the order option menu.. In this case just copy the sortorderlines with titleA/titleD and change title into city.


Hope this will help you in the right direction.

Grtz., Shine



Geschrieben: 31.01.2010

Bearbeitet von Shine am 31.01.2010 23:19:16
Grund:
Erstelle PDF des Beitrags Drucke

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
#10
Benutzerinformationen
Hello Shine,

thanks for your answer. Maybe there is a misunderstanding.

I have already done some changings in the code successfully - see: http://www.mittagessen-deutschland.de/modules/addresses/viewcat.php?cid=10. The sorting for "city" already is OK!!!

Only the sorting of the zip-code was NOT successful.

Concerning your suggestions:

1) Functions.php:
I can not find the code prox lines 42 and 92. So you will find attached my functions.php in txt-file.

2) I have already included a line with
$xoopsTpl->assign('lang_zip', _MD_ZIP);
in viewcat.php (see my posting 29.01 22:24, second part of the quoting ***"Aktuelle Version"***)

3) I have already changed the addresses_viewcat.html as suggested by you - see my very first posting 29.01 10:24

I hope you can help me.

Thanks & best regards

Harry 27

Datei anhängen:


Link nur für registrierte User sichtbar

Geschrieben: 01.02.2010
Erstelle PDF des Beitrags Drucke







[Erweiterte Suche]


Fehler
Warnung: syntax error, unexpected END_OF_LINE, expecting '=' in /var/www/clients/client1/web3/security/myxoops/xoops_data/configs/xoRewriteHtaccess.ini.php on line 13 in Datei /class/smarty/xoops_plugins/xoSmartyFunctions.php Zeile 32
Warnung: array_key_exists() expects parameter 2 to be array, boolean given in Datei /class/smarty/xoops_plugins/xoSmartyFunctions.php Zeile 34
Warnung: XoSmartyPlugin : section [xoRewriteHtaccess] does not exist in /configs/xoRewriteHtaccess.ini.php in Datei /class/smarty/xoops_plugins/xoSmartyFunctions.php Zeile 42
abgelehnt
Abfragen
0.000175 - SET NAMES 'utf8'
0.000121 - SET SQL_BIG_SELECTS = 1
0.000191 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000379 - SELECT sess_data, sess_ip FROM session WHERE sess_id = '6gfi6grvgtrr6lbl22k1adbjj1'
0.000120 - SELECT * FROM modules WHERE dirname = 'newbb'
0.000104 - SELECT COUNT(*) FROM group_permission WHERE (gperm_modid = '1' AND (gperm_groupid = '3') AND gperm_name = 'module_read' AND gperm_itemid = '2')
0.000159 - SELECT * FROM config WHERE (conf_modid = '2') ORDER BY conf_order ASC
0.000076 - SELECT * FROM modules WHERE dirname = 'protector'
0.004314 - DELETE FROM protector_access WHERE expire < UNIX_TIMESTAMP()
0.001000 - SELECT COUNT(*) FROM protector_access WHERE ip='54.82.166.45' AND request_uri='/forum/viewtopic.php?post_id=64358'
0.000181 - SELECT COUNT(*) FROM protector_access WHERE ip='54.82.166.45'
0.000960 - INSERT INTO protector_access SET ip='54.82.166.45',request_uri='/forum/viewtopic.php?post_id=64358',expire=UNIX_TIMESTAMP()+'60'
0.000123 - SELECT * FROM modules WHERE dirname = 'xoopspoll'
0.000103 - SELECT * FROM modules WHERE dirname = 'umfrage'
0.002822 - SELECT t.* FROM bb_topics t, bb_posts p WHERE t.topic_id = p.topic_id AND p.post_id = 64358
0.000113 - SELECT * FROM bb_forums WHERE forum_id = '9'
0.000100 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'category_access')
0.000161 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_access')
0.000178 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_view')
0.000088 - SELECT COUNT(*) FROM `bb_posts` WHERE (topic_id = '11986' AND approved = '1')
0.002116 - SELECT COUNT(*) FROM bb_posts AS p WHERE p.topic_id=11986 AND p.approved = 1 AND p.post_id < 64358
0.000157 - SELECT p.*, t.* FROM bb_posts p, bb_posts_text t WHERE p.topic_id=11986 AND p.post_id = t.post_id AND p.approved = 1 ORDER BY p.post_id ASC LIMIT 0, 10
0.000760 - UPDATE bb_topics SET topic_views = topic_views + 1 WHERE topic_id =11986
0.000096 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.000085 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (3)
0.000075 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,2) AND b.bid IN (31,30,29,28,27,26,25,24,23,22,21,18,17,16,49,15,14,13,10,7,5,3,2,20,19,48,38,37,36,41,40,35,45,44,46,47,50,51,52) ORDER BY b.weight, m.block_id
0.001750 - DELETE FROM lastseen WHERE (uid<1 AND time<=1414284822) OR (uid>0 AND time<=1413680322)
0.000154 - UPDATE lastseen SET online=0 WHERE uid>0 AND time< 1414284822
0.000072 - SELECT * FROM modules WHERE dirname = 'onlinehistory'
0.000072 - SELECT * FROM config WHERE (conf_modid = '7') ORDER BY conf_order ASC
0.000847 - SELECT count(uid) as cuid FROM lastseen WHERE uid=0 AND ip='54.82.166.45'
0.000720 - INSERT INTO lastseen (uid, username, time, ip, online, uagent, module) VALUES (0, 'Besucher', 1414285122, '54.82.166.45', 1, 'CCBot/2.0 (http://commoncrawl.org/faq/)', 2)
0.000704 - SELECT COUNT(uid) as count FROM lastseen WHERE (online > '0' AND uid > '-1')
0.003800 - DELETE FROM bb_online WHERE online_updated < 1414284822
0.003854 - DELETE FROM online WHERE online_updated < 1414284822
0.000235 - SELECT COUNT(*) FROM online WHERE online_uid=0 AND online_ip='54.82.166.45'
0.000318 - INSERT INTO online (online_uid, online_uname, online_updated, online_ip, online_module) VALUES (0, '', 1414285122, '54.82.166.45', 2)
0.000169 - SELECT COUNT(*) FROM bb_online WHERE online_uid=0 AND online_ip='54.82.166.45'
0.000387 - INSERT INTO bb_online (online_uid, online_uname, online_updated, online_ip, online_forum, online_topic) VALUES (0, '', 1414285122, '54.82.166.45', 9, 11986)
0.001527 - DELETE FROM bb_online WHERE ( online_uid > 0 AND online_uid NOT IN ( SELECT online_uid FROM online WHERE online_module =2 ) ) OR ( online_uid = 0 AND online_ip NOT IN ( SELECT online_ip FROM online WHERE online_module =2 AND online_uid = 0 ) )
0.000191 - SELECT * FROM bb_online WHERE online_topic = '11986'
0.000073 - SELECT cat_title, cat_id FROM bb_categories WHERE cat_id = '2'
0.000114 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_post')
0.000130 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000103 - SELECT * FROM `users` WHERE uid IN (11885,8799,10094,7492,8758,1280)
0.000086 - SELECT * FROM smiles
0.000922 - SELECT online_uid FROM bb_online WHERE online_uid IN (1280, 7492, 8758, 10094, 11885)
0.000086 - SELECT * FROM ranks
0.000069 - SELECT user_digests, uid FROM bb_user_stats WHERE uid IN( 1280, 7492, 8758, 10094, 11885)
0.000118 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000107 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000117 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000137 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000114 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000122 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000128 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000109 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000120 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000123 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000111 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000132 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000137 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000112 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000130 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000140 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000110 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000122 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000128 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000110 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000138 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000123 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000111 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000140 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000122 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000114 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000122 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000124 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_edit')
0.000114 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_delete')
0.000124 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
0.000090 - SELECT * FROM modules WHERE dirname = 'xoopspoll'
0.000129 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_addpoll')
0.000131 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_addpoll')
0.000110 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'category_access')
0.000078 - SELECT `cat_id`, `cat_order`, `cat_title` FROM `bb_categories` WHERE cat_id IN (9, 20, 12, 17, 19, 21, 2) ORDER BY cat_order ASC
0.000126 - SELECT * FROM group_permission WHERE (gperm_modid = '2' AND gperm_name = 'forum_reply')
Zusammen: 85
Blöcke
Online Historie Zählblock: nicht zwischengespeichert
Zusammen: 1
Extras
plugin smarty for xoops => xoRewriteModule : Loaded
plugin smarty for xoops => xoRewriteModule : Loaded
inbegriffene Dateien: 161 Dateien
Speicher: 12877968 bytes
Zeitmessung
XOOPS brauchte 0.759 Sekunden zum laden.
XOOPS Boot brauchte 0.052 Sekunden zum laden.
Module init brauchte 0.103 Sekunden zum laden.
XOOPS output init brauchte 0.020 Sekunden zum laden.
Module display brauchte 0.548 Sekunden zum laden.
Page rendering brauchte 0.033 Sekunden zum laden.