Update Ticker (V1.3 - working / läuft)
NOTE: All updates till page 5, post #64 are included in this instruction!
HINWEIS: Alle Updates bis Seite 5, post #64 sind in der Anleitung berücksichtigt![If you got a good idea for an extension - feel free to post / Wenn du eine Idee für zusätzliche Features hast - poste bitte]
V1.0
- lots of bugs / viele Fehler
V1.1
+ added dual language support (english / german) / Script und Interface in deutsch und englisch
+ added global links and link text / Global nutzbare link und link-text variablen
- still lots of bugs

/ immernoch viele Fehler

V1.2
+ script is working fine now (new layout) / Script arbeitet jetzt ordentlich (neues Layout erstellt)
+ fixed error-message bug (message was dsiplayed everytime) / Fehlermeldungs-Bug behoben (Meldung wurde ständig eingeblendet)
+ added thunderstrike´s code (thx) / den Code von Thunderstrike hinzugefügt (thx)
+ script creates image and thumbnail folders now / das Script erstellt jetzt die Bilder- und Thumbnail-Ordner
+ modified and listet mawenzi´s addon in first post / mavenzi´s addon modifiziert und im ersten post aufgelistet
V1.3
+ small updates of the instructions / kleine Neuerungen der Installationsbeschreibung
+ added missing language part / fehlenden Teil in den Sprachdateien hinzugefügt
+ small code update [addcat.php] / kleine code erneuerung [addcat.php]
German:Hallo Community,
da es bisher noch keine Möglichkeit gab Usern zu erlauben eigene Kategorien bzw. Subkategorien zu erstellen und die einzigste Methode eine Auslagerung der Admin-Funktionen war habe ich nun eine eigene Lösung gebaut. Nun kurz und schmerzlos die Features:
Features:- Installation in weniger als 5 Minuten (!)
- PHP und HTML sauber getrennt für Template Kompatibilität
- stabil und sicher (hoffentlich

)
- sämtliche Daten werden fehlerlos nach den Vorgaben von 4images in die Datenbank eingetragen
- Anpassung auf persönliche Bedürfnisse problemlos machbar
- der gesamte code wurde deutsch und englisch kommentiert
English:Hello community,
after searching for a way to let users add categories and/or subcategories i found that the only way to do that is to rip the admin functions out and make them available for the users. Because of that i made my own solution.
Features:- Installation takes < 5 min. (!)
- PHP and HMTL are cleanly separated for for better template compatibility
- stable and secure (i hope so

)
- all informations are put into the database like the original functions of 4images do
- customization can be easily done
- the whole code is commented in english and german
Installation (german / english):Step 1 / Schritt 1Download the attached File
Lade die Datei im Anhang herunter
1.1
Put the "addcat.php" into your 4images root-folder and the "addcat.html" to your template folder
Lege die Datei "addcat.php" in dein 4images Hauptverzeichnis und die "addcat.html" in dein Template Verzeichnis
1.2
Opfen both files with the editor you like
Öffne beide Dateien mit einem Editor deiner Wahl
Step 2 / Schritt 2[addcat.php]
Search for / suche nach
// Initial value of the category hits / Startwert der Kategorie Hits
$cat_hits = '0';
// Rights for the new categorie / Rechte für die neue Kategorie
// 0 = all / alle , 2 = registered users / registrierte benutzer , 9 = admin
$auth_viewcat = '0';
$auth_viewimage = '0';
$auth_download = '0';
$auth_upload = '2';
$auth_directupload = '9';
$auth_vote = '2';
$auth_sendpostcard = '0';
$auth_readcomment = '0';
$auth_postcomment = '2';
Change the values according to your needs / Ändere die Werte nach deinen Wünschen ab
Step 3 / Schritt 3[addcat.html]
Search for / suche nach
<!-- Start of Options -->
<tr>
<td class="row1"><b>{lang_addcat_which_subcat}</b></td>
<td align="right" class="row1">
<select name="cat_parent_id" size="">
<!-- At "value" enter a cat_id and next to it a cat_name / Bei "value" kann die Kategorie ID und daneben der Kategorie Name eingetragen werden -->
<option value="18">Upload</option>
<option value="your 2nd id / deine 2 id">your 2nd category name / der name deiner 2. Kategorie</option>
<option value="...">...</option>
</select>
</td>
</tr>
<!-- End of Options -->
At the <option... </option> lines please enter your own values.
(The users will be able to create new categories in all categories that are listet here. You can see category ID "18" and the category name "Upload" for example. Change both values according to your needs.
- you can get the category ID and the names by opening the menu-link "Edit categories" in the admin control panel)
- you can also add or delete <option...</option> lines
In den <option... </option> Zeilen bitte die eigenen Werte eintragen
(Die Benutzer können in den hier angegebenen Kategorien neue Unterkategorien erstellen. Als Beispiel habe ich Kategorie ID "18" und den
Kategorie-Name "Upload" eingetragen. Beide Einträge müssen geändert werden.
- die Kategorie ID und den zugehörigen Name findet man im Menüpunkt "Kategorien bearbeiten" im Admin Control Panel
- man kann <option...</option> Zeilen hinzufügen oder entfernen
Step 4 / Schritt 4Place a link to addcat.php somewhere in your templates (for example the user_logininfo) ( you can use {url_addcat} for the url and {url_addcat_text} for the link text
Platziere einen Link zur addcat.php irgendwo in deinen templates (als Beispiel hier die user_logininfo.html) (es kann {url_addcat} für die url und {url_addcat_text} für den Link-Text verwendet werden)
[user_logininfo.html]
Search for / suche nach
» <a href="{url_control_panel}">{lang_control_panel}</a><br />
Add after / danach einfügen
» <a href="{addcat_url}">{addcat_url_text}</a></td>
[The link can be found at the left side of the page in the user-menu now]
[Der Link steht nun im User-Menü auf der linken Seite, sofern man angemeldet ist]
Step 5 / Schritt 4Open 4images\lang\deutsch\main.php / Öffne 4images\lang\deutsch\main.php
Open 4images\lang\english\main.php / Öffne 4images\lang\english\main.php
5.1
[deutsch\main.php]
Search for / Suche nach
?>
Add before / davor einfügen
//-----------------------------------------------------
//--- Addcat MOD by Killercookie ----------------------
//-----------------------------------------------------
$lang['addcat_new_cat1'] = 'Neue Kategorie';
$lang['addcat_new_cat2'] = 'Neue Kategorie anlegen';
$lang['addcat_info'] = 'Informationen';
$lang['addcat_description'] = 'Beschreibung der Kategorie';
$lang['addcat_name'] = 'Name der Kategorie';
$lang['addcat_submit_button'] = 'Kategorie erstellen';
$lang['addcat_which_subcat'] = 'Zu welcher Kategorie hinzufügen';
$lang['addcat_error'] = 'Das Formular wurde nicht korrekt ausgefüllt, bitte erneut versuchen.';
$lang['addcat_ok'] = 'Ihre Kategorie wurde erfolgreich erstellt!';
$lang['addcat_no_rights'] = 'Sie besitzen nicht genügend Rechte zum Anzeigen der Seite!';
[english\main.php]
Search for / Suche nach
?>
Add before / davor einfügen
//-----------------------------------------------------
//--- Addcat MOD by Killercookie ----------------------
//-----------------------------------------------------
$lang['addcat_new_cat1'] = 'New category';
$lang['addcat_new_cat2'] = 'Add new category';
$lang['addcat_info'] = 'Information';
$lang['addcat_description'] = 'Category description';
$lang['addcat_name'] = 'Category name';
$lang['addcat_submit_button'] = 'Create category';
$lang['addcat_which_subcat'] = 'Add to which category';
$lang['addcat_error'] = 'The submitted information is incorrect. Please try again';
$lang['addcat_ok'] = 'Your category was created successfully!';
$lang['addcat_no_rights'] = 'You do not have the permission to display this page!';
5.2
Open includes\page_header.php
Search for / Suche nach
"rss_url" => "",
Add after / danach einfügen
"addcat_url" => ROOT_PATH."addcat.php",
"addcat_url_text" => $lang['addcat_new_cat1'],
Done! / Fertig!
Addons (german / english):Addon [1 - Show user who added the cat in cat description / Zeige den user, der die Kat. erstellt hat in der Beschreibung] by mawenzi
1. find in addcat.php / finde in addcat.php
$user_access = get_permission();
Add after / danach einfügen
$user_name = format_text(trim($user_info['user_name']), 2);
2. find in addcat.php / finde in addcat.php
$new_cat_description = (isset($HTTP_POST_VARS['new_cat_description'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS["new_cat_description"])) : "";
Add after / danach einfügen
$new_cat_description = str_replace(array("{new_cat_description}", "{user_name}"), array(format_text(trim($new_cat_description), 1, 0, 1), format_text(trim($user_info['user_name']), 2)), $lang['new_cat_description_added_by']);
3. find in lang/english/main.php / finde in lang/english/main.php
?>
Add before / davor einfügen
$lang['new_cat_description_added_by'] = "<span class=\"smalltext\">{new_cat_description} [added by : {user_name}]</span>";
4. find in lang/deutsch/main.php / finde in lang/deutsch/main.php
?>
Add before / davor einfügen
$lang['new_cat_description_added_by'] = "<span class=\"smalltext\">{new_cat_description} [hinzugefügt von: {user_name}]</span>";
5. Done

/ Fertig!

If you have questions, problems, praise or criticism then please post in this thread.
Bei Fragen, Problemen, Anregungen, Lob oder Kritik einfach hier in den Thread posten oder mir eine PN schicken.
LG / Greets Maik