MyXoops Forum

Forum - myXOOPS German Support

1 + 4 = ?  
Geben Sie das Ergebnis der Berechnung ein
Sie haben max. 10 Versuche.
 
* = Erforderlich

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Betreff: Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES
von Shine am 01.02.2010 23:20:25

See the parts in this file:
//Reusable Link Sorting Functions
function convertorderbyin($orderby)
  {
 switch (
trim($orderby))
   {
   case 
"titleA":  $orderby "title ASC"; break;
    case 
"dateA":   $orderby "date ASC"; break;
   case 
"hitsA":   $orderby "hits ASC"; break;
   case 
"ratingA"$orderby "rating ASC"; break;
// hack LUCIO - start
    
case "cityA":   $orderby "city ASC"; break;
// hack LUCIO - end
    
case "titleD":  $orderby "title DESC"; break;
   case
"dateD":    $orderby "date DESC"; break;
    case 
"hitsD":   $orderby "hits DESC"; break;
    case 
"ratingD"$orderby "rating DESC"; break;
// hack LUCIO - start
   
case "cityD":   $orderby "city DESC"; break;
// hack LUCIO - end
   
default:        $orderby "date DESC"; break;
    }
 return 
$orderby;
  }


function 
convertorderbytrans($orderby)
 {
 if (
$orderby == "hits ASC")    $orderbyTrans ""._MD_POPULARITYLTOM."";
  if (
$orderby == "hits DESC")   $orderbyTrans ""._MD_POPULARITYMTOL."";
  if (
$orderby == "title ASC")   $orderbyTrans ""._MD_TITLEATOZ."";
 if (
$orderby == "title DESC")  $orderbyTrans ""._MD_TITLEZTOA."";
 if (
$orderby == "date ASC")    $orderbyTrans ""._MD_DATEOLD."";
 if (
$orderby == "date DESC")   $orderbyTrans ""._MD_DATENEW."";
 if (
$orderby == "rating ASC")  $orderbyTrans ""._MD_RATINGLTOH."";
  if (
$orderby == "rating DESC"$orderbyTrans ""._MD_RATINGHTOL."";
// hack LUCIO - start
 
if ($orderby == "city ASC")    $orderbyTrans ""._MD_CITYATOZ."";
  if (
$orderby == "city DESC")   $orderbyTrans ""._MD_CITYZTOA."";
// hack LUCIO - end
 
return $orderbyTrans;
}


function 
convertorderbyout($orderby)
  {
 if (
$orderby == "title ASC")   $orderby "titleA";
 if (
$orderby == "date ASC")    $orderby "dateA";
  if (
$orderby == "hits ASC")    $orderby "hitsA";
  if (
$orderby == "rating ASC")  $orderby "ratingA";
// hack LUCIO - start
 
if ($orderby == "city ASC")    $orderby "cityA";  
// hack LUCIO - end
 
if ($orderby == "title DESC")  $orderby "titleD";
 if (
$orderby == "date DESC")   $orderby "dateD";
  if (
$orderby == "hits DESC")   $orderby "hitsD";
  if (
$orderby == "rating DESC"$orderby "ratingD";
// hack LUCIO - start
 
if ($orderby == "city DESC")   $orderby "cityD";
// hack LUCIO - end
 
return $orderby;
  }

These you have to adjust also to fit to your needs.

Next you also need to adjust the file: addresses/viewcat.php
//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_CURSORTEDBYconvertorderbytrans($orderby)));
    }

to fit your to needs.

Keep in mind they need to be the same. If you take a good look you will see they have the same. So if you adjust/delete/change/add something, do it within all the mentioned files.

Can you follow?

[edit]
To be frankly: althoiugh great he did it. I don't like the maphack lucio did.
At this moment I am busy updating my addresses module. It will use, on an very simple way michelin cards.
No addition within table sql or whatever. Just an simple addition within the template.
My test works like a charm. Tested it with some addresses within germany just now.
I hope to get the update ready within a week.
Will let you know.
[/edit]

Aktuell aus dem Forum

Forum Thema Antworten Views Letzter Beitrag
Modulentwicklung New Xoops Xcreate Module 0 4082 26.11.2025 15:22
efkan Gehe zum letzten Beitrag
Modulentwicklung XOOPS Custom Field Module 1 1557 24.11.2025 11:21
Goffy Gehe zum letzten Beitrag