MyXoops Forum

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES [Das aktuelle XOOPS-Update] - myXOOPS German Support

Shine

"myXOOPs"-Neuling
Gepostet am:07.02.2010 10:23
Shine
Shine Offline (Show more)
"myXOOPs"-Neuling
Posts: 91
Since: 02.11.2002
#21

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

OK Harry. Changed several things within the code. Now the sortorder works properly and addresses shows.

What I've done:
Adjusted the files:

viewcat.php (here is where the standard sortorder within categorie listings are taken place.) Now the sortorder is standard: PLZ ASC (city ASC)
If you want to change it, see my comment behind the specific line. (57)

include/functions.php
(here you can adjust the standard sortorder latest listings)
In this file I also changed the standard sortorder date ASC of the latest listing into PLZ (city ASC). See my comment behind the specific line. (80)
If you want to change this (back) into date it is easy.

Upload the files attached and have fun.
Let me know the results.

Datei anhängen:


Link nur für registrierte Benutzer

Shine

"myXOOPs"-Neuling
Gepostet am:07.02.2010 01:40
Shine
Shine Offline (Show more)
"myXOOPs"-Neuling
Posts: 91
Since: 02.11.2002
#20

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Sorrie, my fault.
Didn't test it before zipping the files.
Turn in these cases always debug on, this shows you the error, which you can place her and is easier to solve.

OK: open file functions.php
Look for line:
77
case "zipD":i   $orderby "zip DESC"; break;

You see the 'i'. This is wrong. Remove it and upload the file again.
White page will disappear.

I will test the modifications one of these days myself and will let you know. (i see some more mistakes -forgotten adjustments-. sorry for that)

Advertisement

Gepostet am:0
Advertisement (Show more)
Posts: 0
Since: 0


Hier könnten Sie Ihre Anzeige aufgeben!
Bitte kontaktieren Sie uns, um mehr darüber zu erfahren.

harry27

"myXOOPs"-Neuling
Gepostet am:05.02.2010 16:35
harry27
harry27 Offline (Show more)
"myXOOPs"-Neuling
Posts: 23
Since: 28.01.2010
#19

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Hello Shine,

sorry I had a problem with the database, so I was offline for a moment.

I tried to integrate your files. I get a white screen.

What should I do?

Best regards

Harry27

harry27

"myXOOPs"-Neuling
Gepostet am:03.02.2010 09:11
harry27
harry27 Offline (Show more)
"myXOOPs"-Neuling
Posts: 23
Since: 28.01.2010
#18

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Hello Shine,

thank you for your help. I will try it. My website is offline for the moment.

Best regards

Harry27

Shine

"myXOOPs"-Neuling
Gepostet am:03.02.2010 01:19
Shine
Shine Offline (Show more)
"myXOOPs"-Neuling
Posts: 91
Since: 02.11.2002
#17

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

As I thought. you didn't change in what I mentioned.
OK, did it for you. You only have to do 1 thing yourself which is: editing the file/ functions.php
You will see my explaining comment on the approriate position within the file.

Let me know if it runs ok.

Btw: you know your website doesn't run anymore?


Datei anhängen:


Link nur für registrierte Benutzer

harry27

"myXOOPs"-Neuling
Gepostet am:02.02.2010 14:46
harry27
harry27 Offline (Show more)
"myXOOPs"-Neuling
Posts: 23
Since: 28.01.2010
#16

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Hello Shine,

attached you will find the 4 files.

Best regards & many thanks

Harry27

Datei anhängen:


Link nur für registrierte Benutzer

Shine

"myXOOPs"-Neuling
Gepostet am:02.02.2010 14:07
Shine
Shine Offline (Show more)
"myXOOPs"-Neuling
Posts: 91
Since: 02.11.2002
#15

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

If I take a look at the attachment your placed, you didn't adjust the functions.php file.
And did you adjust all the files on several places?

Can you place the files you've adjusted here as an attachment?

harry27

"myXOOPs"-Neuling
Gepostet am:02.02.2010 09:40
harry27
harry27 Offline (Show more)
"myXOOPs"-Neuling
Posts: 23
Since: 28.01.2010
#14

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Hello Shine,

thanks for your posting.

Sorry, I can not follow, since I think I had already done these adjustments in functions.php, viewcat.php and addresses_viewcat.html - you can see it in the thread!

Nevertheless, I am looking forward to try your new hack! Thanks in advance & best regards

Harry27

Shine

"myXOOPs"-Neuling
Gepostet am:01.02.2010 23:20
Shine
Shine Offline (Show more)
"myXOOPs"-Neuling
Posts: 91
Since: 02.11.2002
#13

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

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]

harry27

"myXOOPs"-Neuling
Gepostet am:01.02.2010 15:30
harry27
harry27 Offline (Show more)
"myXOOPs"-Neuling
Posts: 23
Since: 28.01.2010
#12

Aw:: Sortierung nach Postleitzahl in Modul ADDRESSES

Hello Shine,
in my answer I took by accident the wrong functions.php-file.
I have now attached the correct one.

I am sorry for inconveniences.

Thanks & best regards

Harry27

Datei anhängen:


Link nur für registrierte Benutzer
Diesen Thread durchsuchen:  1 Anonyme Benutzer

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