Author Topic: New add category field / Neues Kategorie hinzufügen Feld  (Read 4800 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
New add category field / Neues Kategorie hinzufügen Feld
« on: April 06, 2011, 12:51:15 PM »
Hallo zusammen,

ich habe ein neues Feld in der "Kategorie hinzufügen" ansicht hinzugefügt. Dort kann ich Icons für die benötigte Kategorie angeben. Wie kann ich aber dort ein Dropdown einbauen, dass ich die Icons direkt aus einem vorgegebenen Verzeichnis auswählen kann?

---

Hi,

I have a new field in the "Add Category" view added. There I can specify icons for the required category. How can I install a dropdown there, but that I can select the icons directly from a given directory?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: New add category field / Neues Kategorie hinzufügen Feld
« Reply #1 on: April 07, 2011, 02:13:27 AM »
Are you looking for a hint or a complete code? ;)
A hint: you can see how it's done in admin/templates.php :)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: New add category field / Neues Kategorie hinzufügen Feld
« Reply #2 on: April 07, 2011, 10:34:19 AM »
Don´t work:
admin_functions.php
add
function show_cat_icon_row($title$template_folder "") {
  global 
$template_file_name$lang;
  echo 
"<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td width=\"70%\">\n";
  
$file_list = array();
  
$handle = @opendir(ROOT_PATH."/joom/images/stories/");
  while (
$file = @readdir($handle)) {
    if (@
is_file(ROOT_PATH."/joom/images/stories/".$file) && $file != "." && $file != "..") {
      
$file_list[] = $file;
    }
  }
  @
closedir($handle);
  if (empty(
$file_list) || !is_array($file_list)) {
    echo 
$lang['no_template'];
    return 
false;
  }
  else {
    echo 
"<table border=\"0\">\n<tr>\n<td>\n";
    echo 
"<select name=template_file_name>\n";
    for(
$i 0$i sizeof($file_list); $i++) {
      echo 
"<option value=\"".$file_list[$i]."\"";
      if (
$template_file_name == $file_list[$i]) {
        echo 
" selected=\"selected\"";
      }
      echo 
">".$file_list[$i]."</option>\n";
    }
    echo 
"</select>\n</td>\n<td>\n";
    echo 
"</td>\n</tr>\n</table>\n";
  }
  echo 
"</td>\n</tr>\n";
}

admin/categories.php
find:
show_textarea_row($lang['field_description_ext'], "cat_description"$cat_row['cat_description'], $textarea_size);
add before
show_cat_icon_row($lang['field_cat_icon'], $template_folder);
find
show_textarea_row($lang['field_description_ext'], "cat_description"""$textarea_size);
add before
show_cat_icon_row($lang['field_cat_icon'], $template_folder);
« Last Edit: April 07, 2011, 11:04:22 AM by Sumale.nin »

Offline heinier

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Matzlpage.de
Re: New add category field / Neues Kategorie hinzufügen Feld
« Reply #3 on: February 22, 2013, 10:44:03 AM »
Hallo Sumale.nin,

kannst du auch bitte mal erklären, wie man eine zusätzliches Kategerie-Feld anlegt?

Ich benötige es für den Wikipedia-Mod, damit auch in der Kategorieansicht der richtige Text dargestellt wird.

Viele Grüße!

Heinier