• [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien 4 0 5 1
Currently:  

Author Topic: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien  (Read 246699 times)

0 Members and 2 Guests are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Does anyone have idea how to allow users to create new sub-category in upload form?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
@Lucifix

... add a link in upload-form to category-create-form ...
... maybe only for members like this ...
Code: [Select]
{if user_loggedin}<a href="{addcat_url}">{addcat_url_text}</a>{endif user_loggedin}
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Knut63

  • Pre-Newbie
  • Posts: 5
    • View Profile
How can the username automatic be added as subcat. when a user make one?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
@Knut63

... in addcat.html I use this ... value="{user_name}" ...
Code: [Select]
<input type="text" name="new_cat_name" value="{user_name}" size="30" class="commentinput">
... size and class is design part and from my template ...

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline KillerCookie

  • Newbie
  • *
  • Posts: 32
    • View Profile
@ KillerCookie

Hallo KillerCookie ,

das ist ja SUPER :)

hab die von dir vorgeschlagene function schon mal in die regsiter.php integriert!

Gut Ding will Weile und auch Glück... drücke dir die Daumen das deine USB wieder funktioniert.

Besten Dank schon mal und LG

Jasi

Wie bitte? Vorgeschlagene Funktion? Falls du den englischen Text meinen solltest - ich wollte mich erkundigen, weshalb diese Funktion (die Bestandteil von 4images ist) überhaupt an dieser Stelle verwendet wird. Meiner Meinung nach ist sie überflüssig, könnte aber für die Kompatibilität zu anderen Datenbankentypen nützlich sein. Da ich mir nicht sicher bin, ob ich sowas aus dem Code rauswerfen kann frage ich lieber hier nach. Falls du da irgendwas geändert haben solltest -> bitte rückgängig machen.

BTW: Ich war im MediMax und habe eine neue Platte bekommen. Das heist dann ade AddcatV2. Ich formatiere die neue Platte soeben und setze dann neue Testserver drauf. Im Verlauf der nächsten Wochen sollte ich dann (hoffentlich) die größten Teile des Codes wieder aus meinem Hirn regenerieren können.

Bis dahin heist es also abwarten und auf die Features freuen, oder selbst basteln. Des Weiteren bin ich übrigens, wie gesagt, über Verbesserungs- und Erweiterungsvorschläge sehr erfreut.

MfG Maik

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
@Lucifix

... add a link in upload-form to category-create-form ...
... maybe only for members like this ...
Code: [Select]
{if user_loggedin}<a href="{addcat_url}">{addcat_url_text}</a>{endif user_loggedin}

Well there is problem that user will have to refresh upload form and fill all needed data again. I think Ajax or javascripts will solve that problem, but I don't know that language.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
@Lucifix

... use that link on the top of image-upload-form with a little description ...
... maybe ...
1. Add your own category to the website : Link to category-create-form ...
2. Than you can upload your images to your own category ...

... I think, it is not a good idea both forms on the same page ...
... but it is only my poit of view ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #97 on: February 01, 2008, 12:31:40 AM »
// Is work for next_id method.

E.g: New user register in USERS_TABLE table and other remove account (with MOD). If user remove, user_id remove. If user_id remove, this is right for auto_increment - is work + 1 of each new field add but order value is break. Jan method is get last value insert and add + 1 for insert. + 1 is no add 1 of auto_increment. Is add 1 of total count of SELECT MAX function of SQL.  ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline KillerCookie

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #98 on: February 01, 2008, 10:10:57 AM »
E.g: New user register in USERS_TABLE table and other remove account (with MOD). If user remove, user_id remove. If user_id remove, this is right for auto_increment - is work + 1 of each new field add but order value is break. Jan method is get last value insert and add + 1 for insert. + 1 is no add 1 of auto_increment. Is add 1 of total count of SELECT MAX function of SQL.  ;)

Ok...
- SELECT MAX is getting the highest user_id that exists. Then Jan added + 1... right?
- If you delete the previous added user then the new user will get the same id, because of the function above... right?

- auto_increment will also work, but "order value" will break ... which "order value" do you mean? Is this critical?
- i deleted the whole function and just left out the "user_id" field at the database insert so that its given an auto_increment value. After that i fetched the given id with the get_insert_id function - is this ok?
- are there other disadvantages?

I´m asking because further modifications may include this way of adding the new user to the db and i don´t want to make it buggy. If you know another way which avoids that different users will get the same id (not at the same time, but still the same id) then please share it with me. ;)

"// Is work for next_id method."

Don´t know what this means... :(

Sorry, but it´s hard for me to understand your english.

Regards Maik


Offline KillerCookie

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #99 on: February 01, 2008, 10:15:00 AM »
@Lucifix

... add a link in upload-form to category-create-form ...
... maybe only for members like this ...
Code: [Select]
{if user_loggedin}<a href="{addcat_url}">{addcat_url_text}</a>{endif user_loggedin}

Well there is problem that user will have to refresh upload form and fill all needed data again. I think Ajax or javascripts will solve that problem, but I don't know that language.

I dont think that such a function is needed. First the user should create a category and then add the images. Mixing both methods means editing the upload process or some other stuff. I think my method is much easier to understand for the user and it works fine.

Regards Maik

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #100 on: February 01, 2008, 02:08:50 PM »
Quote
Is this critical?

Is no critical. Auto_increment is no risk for next ID and no problem for remove function. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Jasi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #101 on: February 01, 2008, 04:39:46 PM »
@Knut63

... in addcat.html I use this ... value="{user_name}" ...
Code: [Select]
<input type="text" name="new_cat_name" value="{user_name}" size="30" class="commentinput">
... size and class is design part and from my template ...



mawenzi

So habe ich es bei mir auch gelöst, allerdings wird nicht zuverlässig der Username des Mitglieds automatisch includet welches eingeloggt ist und eine neue Kategorie anlegen will.

Bei mir holt es sich wahlweise irgend einen Username und erst wenn ich mehrmal aktualisiere bekomme ichden richtigen Usernamen.

Keine Ahnung woran das liegt?

LG Jasi
LG Jasi

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #102 on: February 01, 2008, 05:54:19 PM »
Hallo Jasi,

... ich habe wieder einmal festgestellt, dass ich nicht die gleiche addcat.php verwende wie hier von KillerCookie veröffentlicht ...
... da der Code hier im Thread nicht offen hinterlegt ist, muss bei Einsicht erst die aktuelle Version heruntergeladen werden ...
... von daher konnte mein Vorschlag für euch so noch nicht richtig funktionieren ...
... also folgende Änderungen sind noch vorzunehmen ...

1. finde in der addcat.php ...
Code: [Select]
include(ROOT_PATH.'includes/page_header.php');
und füge dahinter ein ...
Code: [Select]
//--- Für Username zur Kategoriebeschreibung ---
$cat_user_name = $user_info['user_name'];
//--- Für Username zur Kategoriebeschreibung ---

2. finde in der addcat.php ...
Code: [Select]
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream,
und füge dahinter ein ...
Code: [Select]
"cat_user_name" => $cat_user_name,

3. nun kannst du in der addcat.html folgendes verwenden ... value="{cat_user_name}" ...
Code: [Select]
<input type="text" name="new_cat_name" value="{cat_user_name}" size="30" class="commentinput">

... so setzte ich bei mir den User-Namen als Kategorie-Namen in das Formular ein ...
... und es funktioniert bestens ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Jasi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #103 on: February 01, 2008, 07:55:51 PM »
mawenzi

Hallo mawenzi,

danke funktioniert 1A :)

LG Jasi

NS.
bezgl. dem Thema "Kategorien untereinander" bei dir im Forum habe ich dir gestern noch geantwortet ;)
http://klick.kl.funpic.de/showthread.php?bid=3&threadid=121&page=2
LG Jasi

Offline KillerCookie

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] V1.3 Let users add (sub-)categories / User erstellen (Sub-)Kategorien
« Reply #104 on: February 02, 2008, 11:16:00 PM »
Hallo Jasi,

... ich habe wieder einmal festgestellt, dass ich nicht die gleiche addcat.php verwende wie hier von KillerCookie veröffentlicht ...
... da der Code hier im Thread nicht offen hinterlegt ist, muss bei Einsicht erst die aktuelle Version heruntergeladen werden ...
... von daher konnte mein Vorschlag für euch so noch nicht richtig funktionieren ...

Der Zaunpfahl ist bei mir angekommen. Ich werde das beim nächsten Update anpassen... ;)

MfG Maik