4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Sunny C. 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?
-
Are you looking for a hint or a complete code? ;)
A hint: you can see how it's done in admin/templates.php :)
-
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);
-
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