51
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/4/3 16:37

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

artigas wrote:
Greetings -

While all this is beyond what I already know about PHP and MySQL, all things being the same, has anyone looked at the data in the table itself?

I will make the sugestion that you dump (not sure of how to do this) the data to a text file and have a look to see that it all looks reasonable and that there are no 'unsual' (what would those be?) characters in the data.



Martijn , artigas you're right
Sorry for not testing English chars b4 all those tests, when I posted it in the begining and being told it was brought up b4, I was sure it's happaning in English too.

I deleted all Xdir tables, and made about 200 test records in English, making test over and over again, and all works fine, from some reason Hebrew chars are making problems here, and I say here due to the fact that I never ever had a problem with xoops, nor another MySql app.
My local MySql have a Hebrew chars encoding, but till now I didn't had any problems also with a regular (Non Hebrew MySql) so .. now I'm lost more then ever.

The funny thing now is that I mixed 2 alpha panels (Heb + Eng) to be able to look @ the behaviour, and when I look for "a" I get all a results plus the first 4 Hebrew letters results.

Quote:
Martijn wrote:
Perhaps a workaround would be like the suggested handling in php, to query all records and only return the records where title starts with a '$list'. Let me know if you find another way to solve the root of the problem, which is the database. If there is not, I will have a look on a short workaround in php.


Oh how I need it now ...

I thought about 2 scenarios:
1. use something like "str_replace" or ereg_replace() and store the first heb char in the database.

2. which is going back to stone age ... to dedicate one of the fields for something like "File the record under the letter" ... STONE AGE !!!!

Did I mentioned I never had those problems with XOOPS and Heb Chars, all, including the search is working perfect !!!
I'm fighting this Xdir from the first minute I touched it .... from the "register_globals" I had to open for it, through the global search I embaded in it till this Alphabet thing.

HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


52
wtravel
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes

I am very happy you found the cause of the problem

Okay, to get the first letter of a value, use:

substr($value,0,1)

For each record from the total list of results, create a condition to check if the outcome is equal to the letter in the URL.

Quote:

if (substr($value,0,1) == $list) {
show this record
}


Does this provide you with enough information to try and adjust your viewlist.php file?

Martijn

53
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/4/3 17:10

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Does this provide you with enough information to try and adjust your viewlist.php file?


.... Should I say no ? or should I say no ?

no

54
wtravel
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes

Change the while loop around line 80 . It should become like this:

Quote:

while(list($lid,$lcid,$ltitle,$phone,$hits,$rating,$votes)=$xoopsDB->fetchRow($result2)){
if (substr($ltitle,0,1) == $list) {
$catpath = $mytree->getPathFromId($lcid, "title");
$catpath= substr($catpath, 1);
$catpath = str_replace("/"," ยป ",$catpath);
$rankings[$e]['links'][] = array('id' => $lid, 'cid' => $cid, 'rank' => $rank, 'title' => $myts->htmlSpecialChars($ltitle), 'category' => $catpath, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes, 'phone' => $phone);
$rank++;
}
}

55
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/4/3 21:13

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Martijn - You did the MAGIC

working !!! at last !!
Thank you thank you thank you !!!!!!!!
How can I thank you ?
Works like a charm .... right when I began loosing faith

So now ... well .. in a week or 2 I'll release "Xphones" as a ready made hacked Xdir, for the ones that can't do it themselfs - @ last alphabetic sorting phonebook for XOOPS
your name will be in the credits of course, and !!!!! again a very very big thank you.

56
wtravel
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes

Hi tzvook,

I am not sure if this would work for Hebrew too, since the words are read from right to left (right??).

Martijn

57
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/4/7 9:26

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hello Martijn

It does work for Hebrew !!!
The right to left is a very problematic thing: I had to go over all core files to adjust them to Hebrew, each table/paragraph/div/span and so on.. has to be treated, plus a lot of hacks and language changes - it took ages + the fact that every upgrade takes ages to implement even with changes log.

But !!!!
Xoops worth the work: "There's something about XOOPS ... makes you want to work with it more"

58
wtravel
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes

Quote:

Xoops worth the work: "There's something about XOOPS ... makes you want to work with it more"

I totally agree

Glad to know it also works for Hebrew.

Martijn

59
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/4/7 9:40

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi Martijn

Since I saw you follow the "Membo ..... Marketing thing" too, I just thought of something that I didn't saw someone mentioning: - one of the thing XOOPS need in the Front page for Marketing is "Sucsess stories" ... I found myself more then a few times, when examining something new - going to read some of ppls saying about the plus and minus of the specific app ...
If you want, post a suggestion out there there ......... I stopped folowing the thread due to a lot of work that suddenly fell on me (for the good and bad of it )

60
wtravel
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes

Thanks for the suggestion, I added this to the list of possible items for the XOOPS site

Martijn

Login

Who's Online

405 user(s) are online (257 user(s) are browsing Support Forums)


Members: 0


Guests: 405


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits