Author Topic: using special chracters in image_name // image sizes // show pics to registered  (Read 11036 times)

0 Members and 1 Guest are viewing this topic.

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
Hey there,
I've installed 4images 1.76 a few days ago and haven't figured out everything yet.
Could somebody help me with the following problems:

1--> I want to use special characters / Umlaute (ä,ö,ü,ß) in image names. If I use one, the name gets cut off when a special character appears (e.g. if I write dünger, the database only saves d and cuts off ünger). The mysql-database is utf-8, the lang-charset in deutsch-->main.php is utf-8 (I guess that doesn't make a difference). Does anybody have an idea?

2--> I'd like to not show the full picture size by clicking on the thumbnail, but an image with a fixed width so as to not enlargen the template. That could either be a new image size (such as a wider thumbnail) or the full image which is just scaled. How can I realize that?

3--> I'd like to show pictures to guests or registered users not depending on the category, but depending on the photographer. We have some pictures everybody can use and some which are not to be used by anyone. Does anybody have suggestions for that?

Thanks for your help (or link if I missed one)  :D
tucano

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
hi tucano & welcome to the 4images forum.

1.) where i can see it live? did you done any changes on the files?
2.) maybe this will help you > http://www.4homepages.de/forum/index.php?topic=20496.0
3.) that one i didn't understand correct

maybe you should try with german :)
cheers
Nicky
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 ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
Hallo Nicky,
ok, ich schreib auf deutsch ;-)
1) Du kannst die Bilder auf regenwaldfotos.de sehen.

Punkt 2 probiere ich gerade aus :-)

3) Normalerweise kann man ja für jede Kategorie einstellen, ob sie für jedermann sichtbar ist oder nur für registrierte Nutzer. ich habe dank einem Tutorial von hier (hab jetzt denk Link nicht hier) das additional feld freigeschaltet, um einen Fotografen mit anzugeben. Nun möchte ich gerne, dass die Bilder je nach Fotograf freigeschaltet werden können - also im Grunde genommen könnte man beim Bild hochladen ein Feld anlegen, das jeweils gewählt werden muss ob das Bild sichtbar für alle ist oder nur für registrierte User.
Ist das verständlicher?


Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
Punkt 2 funktioniert jetzt.
Wäre klasse wenn jemand noch für die anderen Probleme eine Lösung hat :-)

########

Number 2 is working now.
It'd be great if someone has a solution for the other questions :-)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
hi tucano,

1.) hmm.. irgendwie passt da was nicht... bitte die ftp, mysql daten(+ url zum mysql manager) und 4images account an mich schicken..

3.) okay das hab ich irgendwie verstanden... aber wozu, wenn derzeit auch auf die details nicht geklickt werden kann oder wird es später bilder geben welche man im gross format anschauen könnte?

LG
cheers
Nicky
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 ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline mawenzi

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

... da du den zweiten Punkt offensichtlich erfolgreich abgearbeitet hast, wäre es nett, wenn du in dem Tutorial-Thread noch mal ein Statement dazu abgibst ... mit 4images-Version und ggf. Hinweisen zur Ausführung ... denn offensichtlich tun sich viele andere 4images-User mit der Problematik "One Image - Three sizes" sehr schwer und so wäre es dann eine Motivation dieses Tutorial auch umzusetzen ...

Danke ... mawenzi
« Last Edit: June 18, 2008, 12:49:27 PM by mawenzi »
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 mawenzi

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

... zu 3. ...
... so wie du ein additional_image_field für den Fotografen eingefügt hast, so kannst du auch ein additional_image_field für die Betrachtungsrechte einführen ... ein Tutorial wäre hier http://www.4homepages.de/forum/index.php?topic=20748.0 ... für dieses Feld wäre ein Ratio-Button auszuwählen ... Alle User bzw. Reg. User ... dann kann man unabhängig von der Kategorieeinstellung die Ansichtsrechte für jedes Bild einzeln vergeben ... um die Ansichtsrechte umzusetzen gibt es m.E. zwei Möglichkeiten ...

1. in der includes/functions.php die Rechte für die "Thumbs" neu zu regeln ...
2. in der includes/functions.php z.B $detail_view_all und $detail_view_user registrieren ...
    und in der /templates/<dein_template>/tumbnail_bit.html die Rechte mit {if ...}-Tags regeln ...
    wobei mir das jetzt etwas umständlicher zu sein scheint ...

... eine ähnliche Problematik haben wir hier im Forum mal diskutiert und umgesetzt ...
... Download Ja / Nein (unabhängig von der Kategorieeinstellung) ... hier ... http://www.4homepages.de/forum/index.php?topic=11539.0 ...
... dann gibt es auch noch ein Tutorial "Bild-Uploadoption: Rating Ja / Nein" (unabhängig von der Kategorieeinstellung) ... auch ähnlich ...
« Last Edit: June 18, 2008, 12:51:17 PM by mawenzi »
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 tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
@tucano

... da du den zweiten Punkt offensichtlich erfolgreich abgearbeitet hast, wäre es nett, wenn du in dem Tutorial-Thread noch mal ein Statement dazu abgibst ... mit 4images-Version und ggf. Hinweisen zur Ausführung ... denn offensichtlich tun sich viele andere 4images-User mit der Problematik "One Image - Three sizes" sehr schwer und so wäre es dann eine Motivation dieses Tutorial auch umzusetzen ...

Danke ... mawenzi

Done :-)


@tucano

... zu 3. ...
... so wie du ein additional_image_field für den Fotografen eingefügt hast, so kannst du auch ein additional_image_field für die Betrachtungsrechte einführen ... ein Tutorial wäre hier http://www.4homepages.de/forum/index.php?topic=20748.0 ... für dieses Feld wäre ein Ratio-Button auszuwählen ... Alle User bzw. Reg. User ... dann kann man unabhängig von der Kategorieeinstellung die Ansichtsrechte für jedes Bild einzeln vergeben ... um die Ansichtsrechte umzusetzen gibt es m.E. zwei Möglichkeiten ...

1. in der includes/functions.php die Rechte für die "Thumbs" neu zu regeln ...
2. in der includes/functions.php z.B $detail_view_all und $detail_view_user registrieren ...
    und in der /templates/<dein_template>/tumbnail_bit.html die Rechte mit {if ...}-Tags regeln ...
    wobei mir das jetzt etwas umständlicher zu sein scheint ...

... eine ähnliche Problematik haben wir hier im Forum mal diskutiert und umgesetzt ...
... Download Ja / Nein (unabhängig von der Kategorieeinstellung) ... hier ... http://www.4homepages.de/forum/index.php?topic=11539.0 ...
... dann gibt es auch noch ein Tutorial "Bild-Uploadoption: Rating Ja / Nein" (unabhängig von der Kategorieeinstellung) ... auch ähnlich ...

Puh... das wird kompliziert.
Habe jetzt folgendes gemacht:

1) In includes/db_field_definitions.php zugefügt
Code: [Select]
$additional_rights_fields['image_rights'] = array($lang['image_rights'], "radio", 1);
2) in lang/deutsch/main.php
Code: [Select]
$lang['image_rights'] = "Bild-Rechte:";
3) in templates/default/member_uploadform.html
Code: [Select]
<p style="line-height:100%; margin-top:0; margin-bottom:0;"><sup class="new">{lang_image_rights}</sup><br>
<input type="radio" name="image_rights" value="1"/>Ja&nbsp;&nbsp;&nbsp;<input type="radio" name="image_rights" value="0" checked="checked"> Nein </p>

4) in templates/default/details.html
Code: [Select]
<tr>
     <td valign="top" class="row2"><b>Rechte:</b></td>
     <td valign="top" class="row2"><p align="justify">{image_rights}</td>
</tr> 

5) in der Datenbank in 4images_images das Feld image_rights als Tinyint angelegt

6) in admin/images.php bei if ($action == "editimage")
Code: [Select]
  show_additional_fields("rights", $image_row, IMAGES_TABLE); bei if ($action == "saveimages")
Code: [Select]
    if (!empty($additional_rights_fields)) {
      foreach ($additional_rights_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key.'_'.$i]) && intval($val[2]) == 1 && trim($HTTP_POST_VARS[$key.'_'.$i]) == "") {
          $error[$key.'_'.$i] = 1;
        }
      }
    } 
bei if ($action == "addimages")
Code: [Select]
    show_additional_fields("rights", array(), IMAGES_TABLE, $i);
7) in includes/functions.php unter dem anderen additional field
Code: [Select]
  if (!empty($additional_rights_fields)) {
    $additional_field_array = array();
    foreach ($additional_rights_fields as $key => $val) {
      $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  } 


...
Funktionieren tut es aber noch nicht wirklich (die Auswahl Ja/nein wird übernommen und gespeichert, aber wie gebe ich es wieder aus bzw. nutze das?), und das mit den Thumbs muss auch noch gemacht werden in functions.php. Kann mir dabei jemand helfen?

EDITH:
Muss natürlich noch in images.php den case updateimage bei index.php und bei detail.php bearbeiten:
Code: [Select]
if (!empty($additional_rights_fields)) {
    foreach ($additional_rights_fields as $key => $val) {
      if (isset($HTTP_POST_VARS[$key]) && intval($val[2]) == 1 && trim($HTTP_POST_VARS[$key]) == "") {
        $error[$key] = 1;
      }
    }
  } 
und im sql-update dort auch
Code: [Select]
image_rights = '$image_rights'
dann natürlich nicht zu vergessen:
bei if updateimage
Code: [Select]
  if (empty($error)) {
    $additional_sql = "";
    if (!empty($additional_image_fields)) {
      $table_fields = $site_db->get_table_fields(IMAGES_TABLE);
      foreach ($additional_image_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }
    $additional_sql_rights = "";
    if (!empty($additional_rights_fields)) {
      $table_fields = $site_db->get_table_fields(IMAGES_TABLE);
      foreach ($additional_rights_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql_rights .= ", $key = ".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."";
        }
      }     
    }

    $sql = "UPDATE ".IMAGES_TABLE."
            SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_photographer = '$image_photographer', image_rights = '$image_rights', image_description = '$image_description', image_keywords = '$image_keywords', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_thumb_file = '$new_thumb_name', image_download_url = '$image_download_url', image_allow_comments = $image_allow_comments, image_downloads = $image_downloads, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits".$additional_sql."".$additional_sql_rights."
            WHERE image_id = $image_id";
    $result = $site_db->query($sql);

und bei saveimages
Code: [Select]
        $additional_field_sql_rights = "";
        $additional_value_sql_rights = "";
        if (!empty($additional_rights_fields)) {
          $table_fields = $site_db->get_table_fields(IMAGES_TABLE);
          foreach ($additional_rights_fields as $key => $val) {
            if (isset($HTTP_POST_VARS[$key.'_'.$i]) && isset($table_fields[$key])) {
              $additional_field_sql_rights .= ", $key";
              $additional_value_sql_rights .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key.'_'.$i]))."'";
            }
          }
        }       

        $current_time = time();
        $sql = "INSERT INTO ".IMAGES_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.",".$additional_field_sql_rights.")
                VALUES
                ($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.",".$additional_value_sql_rights.")";

Tada, und schon funktionierts.
Jetzt jemand noch eine idee für die Umsetzung mit dem thumbs? (if image_rights=ok dann thumb anzeigen?)
« Last Edit: June 24, 2008, 04:19:48 PM by tucano »

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
hi tucano,

schau in deine service categorie..
ich hab keine problem mit den umlauten, hab aber auch nichts verändert!

habs mit 5 browsern ausprobiert (IE 6 und 7, Firefox 2 und 3, Opera 9), 2 verschiedene OS (XP und win2000).
wenn ich zuhause bin probiere ich noch von linux..
cheers
Nicky
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 ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
Hi Nicky,
hab schon gesehen, dass du dort unterwegs warst :-)
Um dir den Zugang zu geben, haben wir den Fotos eine eigene Datenbank angelegt... vielleicht liegt es daran :?: Aber danke für deine Hilfe vielmals!!!  :D

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
hab oben geedited, meine Fragen sind jetzt alle gelöst bis auf die Umsetzung mit dem thumbnails bei vorhandenen Rechten anzeigen  8)
Ideen sind herzlich willkommen  :D

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Hi Nicky,
hab schon gesehen, dass du dort unterwegs warst :-)
Um dir den Zugang zu geben, haben wir den Fotos eine eigene Datenbank angelegt... vielleicht liegt es daran :?: Aber danke für deine Hilfe vielmals!!!  :D

dann gibts mir denn vollen zugang um es zu testen ;)
keine sorge, ich stelle sicher nichts an


btw. die bilder und mein username könnts wieder löschen, ausser ich soll es nochmals testen
LG
cheers
Nicky
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 ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
hat NIEMAND eine Idee? Oder ist meine Anfrage nicht verständlich?


###############


Does NOBODY have an idea? Or didn't I make myself clear?

Offline tucano

  • Newbie
  • *
  • Posts: 16
    • View Profile
*push*

ich hab noch Hoffnung  :lol: