Catagories

Forum_Lexicon_Desc

Catagories

Beitragvon wicher » 10. Mär 2006 02:51

Hello,

am i wrong or is there unfinished code in admin_lexicon_cat.php?
When i go to lexicon_cat.php i get a list with catagories, but it always says there is nothing in either one of those catagories?

Code: Alles auswählen
      // define categorie names
      while($row = $db->sql_fetchrow($result))
      {
         $cat_id = $row['cat_id'];
         $lexicon_categories[$row['cat_id']] = $row['cat_titel'];
         if ($row['cat_titel'] == 'default')
         {
            $categorie = '<i>'.$row['cat_titel'].'</i>';
         }
         else
         {
            $categorie = $row['cat_titel'];
         }
         $categorie_lang = @$lang[$row['cat_titel']];
         if ($categorie_lang == ' ')
         {
            $categorie_lang = '<font color="red">*</font> '.$lang['generally'];
         }
         if ($categorie_lang == '')
         {
            $categorie_lang = '<i>'.$lang['no_entry'].'</i>';
         }


Zugefügt nach 1 Stunde(n) 8 Minute(n):

I solved it in my own way:
I took the above code and replaced it with the below code.

Code: Alles auswählen
      // define categorie names
      while($row = $db->sql_fetchrow($result))
      {
         $cat_id = $row['cat_id'];
         $lexicon_categories[$row['cat_id']] = $row['cat_titel'];
         if ($row['cat_titel'] == 'Algemeen')
         {
            $categorie = $row['cat_titel'];
            
            $query = "SELECT * FROM phpbb_lexicon WHERE cat = ".$cat_id;
            $abc = mysql_query($query);
            if(!$itemresult = $db->sql_query($query))
            {
               message_die(GENERAL_ERROR, 'Could not get catagorie content', '', __LINE__, __FILE__, $sql);
            }
            $numberitems = mysql_num_rows($abc);
            if($numberitems == "0")
            {
               $categorie_lang = '0 items';
            }
            else
            {
               $categorie_lang = $numberitems.' items';
            }
         }
         else
         {
            $categorie = $row['cat_titel'];
            
            $query = "SELECT * FROM phpbb_lexicon WHERE cat = ".$cat_id;
            $abc = mysql_query($query);
            if(!$itemresult = $db->sql_query($query))
            {
               message_die(GENERAL_ERROR, 'Could not get catagorie content', '', __LINE__, __FILE__, $sql);
            }
            $numberitems = mysql_num_rows($abc);
            if($numberitems == "0")
            {
               $categorie_lang = '0 items';
            }
            else
            {
               $categorie_lang = $numberitems.' items';
            }
         }
Benutzeravatar
wicher
User
 
Beiträge: 32
Registriert: 9. Feb 2006 01:11
Wohnort: Netherlands

Beitragvon AmigaLink » 10. Mär 2006 13:04

:shock: What do you doing there???
The admin_lexicon_cat.php is finished and works 100 per cent correctly!!!

Take a look at the history in the installation guide:
Code: Alles auswählen
##   - add categories with language feature for the category name
##     (Categories are added over the ACP. If an entry of the same name in the language files exists,
##     this (in place of the data base entry) is indicated in the lexicon.)
and at the comments in the lang_main.php
$lang['generally'] = 'Generally'; // this is the name from the default categorie if set $lang['default'] = ' '

$lang['default'] = ' '; // example to demonstrate the categorie-titel lang feature

That is a feature which most boards never will need. Because it concerns the possibility to create multilaguage categorie names (small plaything of me)! :mrgreen:

Example:
  1. You create a categorie named "ABC".
    Normally the name "ABC" will also displayd in the lexicon!
  2. Now you create an entry in all yours lang_main.php like that:
    Code: Alles auswählen
    $lang['ABC'] = 'DEF';
  3. Now the categorie are indicated in the lexicon as "DEF" instead of "ABC"! :D
The admin_lexicon_cat.php shows you both names! The original database entry and the name that exists in the lang_main.php of your used language. :D If no entry in the lang_main.php exists, the admin_lexicon_cat.php only shows the original name and in the second column stands "no entry".
Your codechange destroys this funktion!!! :?
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon wicher » 12. Mär 2006 13:53

Sorry about destroying functions but for me it works better this way.
With me now it displayes in the second colom how many words there are in that particular catagorie.


But now i have anoher question that i will ask in another topic.

Zugefügt nach 1 Stunde(n) 1 Minute(n):

PS: if you register at my forum i can give you acces to the edit section of my lexicon.
I made it so that i can give users edit right's.
Then you can see for yourself how i have things.
I have my lexicon at http://www.detecties.com/dc
Benutzeravatar
wicher
User
 
Beiträge: 32
Registriert: 9. Feb 2006 01:11
Wohnort: Netherlands

Beitragvon AmigaLink » 12. Mär 2006 14:05

Thanks but I see no reason to look at that. :)

If it pleases you so better, then is all ok. :P
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW


Zurück zu Lexicon v2



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 13 Gäste

cron