MyXoops Forum

Forum - myXOOPS German Support

7 - 1 = ?  
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 31.01.2010 22:55:53

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



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