Recent Posts

Pages: 1 [2] 3 4 5 6 ... 10
11
Discussion & Troubleshooting / Anything Happening with 4images?
« Last post by kitty999 on May 13, 2020, 09:08:33 PM »
Hi,

I was just wondering if anyone knew anything about 4images getting an update, it seems like the project has been abandoned.
12
Error Messages / Fehlermeldungen / Re: Webseite mit PHP 7.2 nicht kompatibel
« Last post by Jan-Lukas on May 12, 2020, 07:14:59 PM »
:thumbup:

Ich habe mir den Sourcecode von 4images mal genauer angeschaut und kann nun Licht ins dunkel bringen.

Das gute Vorab:
Es spielt keine Rolle, ob ihr PHP 7.0, 7.0.33 oder (so wie ich, das aktuelle 7.3.15) einsetzt - 4images in Version 1.8 wird auch unter allen aktuell verfügbaren Versionen von PHP 7 laufen!

Die entscheidende Konfiguration von 4images steht in der nachfolgenden Zeile in der Datei config.php:
Code: [Select]
$db_servertype = "mysql";ändert diese Zeile einfach in:
Code: [Select]
$db_servertype = "mysqli";

Huch... Wer bist Du denn ??
13
Error Messages / Fehlermeldungen / Re: Webseite mit PHP 7.2 nicht kompatibel
« Last post by parkshots on May 12, 2020, 12:47:50 PM »
Hallo,

kurze Verständnisfrage: Mit der Umstellung auf "mysqli" bekomme ich im Adminbereich unter Datenbank Backup die Meldung "Note: You are not using MySQL. Maybe the backup function won't work!" Ein Backup lässt sich zwar noch ausführen, die generierte SQL Datei ist jedoch nur noch ca. halb so groß wie vorher. Ist die Backup Funktion nicht mehr nutzbar?
14
Hi,

danke für die Rückmeldung. Wenn ich irgendwie helfen kann, sag Bescheid.

Grüße!
15
Mods & Plugins (Releases & Support) / Re: [MOD] Birthday Mod v1.0
« Last post by Aleksey on May 09, 2020, 12:55:04 PM »
Improving the [MOD] Birthday Mod v1.0

If the user doesn't want to show the year of birth, they no longer need to enter the year 0000.
Just leave this field empty and the system will automatically enter the year 0000.

Open includes/functions.php

find:
Code: [Select]
function check_birthday($birthday_day = "", $birthday_month = "", $birthday_year = "", $valid = 0) {
  $error = 0;

below insert:
Code: [Select]
  if (empty($birthday_year)) {
  $birthday_year = "0000";
  }

The user must not enter a date of birth more than 100 years old.
The user must not enter a date of birth greater than the current year.
The check must take into account 0000 when the user hides their year of birth.

find:
Code: [Select]
   else {
       $birthday = "0000-00-00";
       $error = 1;
   }

below insert:
Code: [Select]
//check if age is bigger than 100 or bigger current year
$today = getdate (time());
if ($birthday_year == "0000") { }
elseif (($today['year'] > (intval($birthday_year)+100)) || (intval($birthday_year) > $today['year'])) return false;

By default, if the user enters the last two digits of the year, the function automatically inserts the year 19XX at the beginning.
This is wrong because there are people born in 2001.

find:
Code: [Select]
      case 2:
          $birthday_year = "19$birthday_year";
          break;

and replace:
Code: [Select]
\\      case 2:
\\          $birthday_year = "19$birthday_year";
\\          break;

Or delete it is not the correct solution.

You can make it intuitive for the user that the year can be left empty.

Open lang/<your language>/main.php
Find
Code: [Select]
$lang['year'] = "year";Replace:
Code: [Select]
$lang['year'] = "year (optional)";
This will be displayed when registering and editing the user (control panel)
16
By default, you can register a user's nickname with any length and characters. This is very bad, there is no filtering.

This mod is lost, but it is very important and I will post it again.
This is not my mod, I restored it from my gallery.

Description: this mod checks the nickname when registering a user for forbidden characters and the length of the nickname.
By default, this mod allows the length of nicknames from 2 to 25 characters. As well as only English and Russian letters, numbers, space. But you can change that.

This MOD works on 4images 1.8 and PHP 7.4.4

[ Changed Files ]
includes/constants.php
register.php
templates/register_form.html
lang/<your language>/main.php

[ Installation ]

First Backup your Files

Step 1
Open register.php

Find
Code: [Select]
  $captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

  $error = 0;
below insert
Code: [Select]
//Mod UNEXPECTED CHARS START
function comprobar_username($nombre_usuario){

$long_max = MAX_USER_KEYWORD_LENGTH;
$long_min = MIN_USER_KEYWORD_LENGTH;
$sag = '';
if (strlen($nombre_usuario)<$long_min){
$sag = 2; // devuelve 2, como diciendo "error 2"
return $sag;
}
if (strlen($nombre_usuario)>$long_max){
$sag = 3; // devuelve 3, como diciendo "error 3"
return $sag;
}

$permitidos = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzЙЦУКЕЁНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮйцукеёнгшщзхъфывапролджэячсмитьбю0123456789 ";

for ($i=0; $i<strlen($nombre_usuario); $i++){
if (strpos($permitidos, substr($nombre_usuario,$i,1))===false){
$sag = $sag.substr($nombre_usuario,$i,1);
}
}
if ($sag != ''){
return $sag;
}
return true;
  }
//Mod UNEXPECTED CHARS END

You can change this string and enter your allowed characters.
$permitidos = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzЙЦУКЕЁНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮйцукеёнгшщзхъфывапролджэячсмитьбю0123456789 ";

Find
Code: [Select]
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
below insert
Code: [Select]
//Mod UNEXPECTED CHARS START
elseif (comprobar_username($user_name) != 1)
      {
$long_car = '';
for ($i=0; $i<strlen(comprobar_username($user_name)); $i++){
$long_car = $long_car.'#';
}

$resultado_func = comprobar_username($user_name);

if(strlen($resultado_func) >= 1 and $resultado_func != 2 and $resultado_func != 3){
$msg .= (($msg != "") ? "<br />" : "").$lang['username_bad_characters'];
$msg .= ": ".$resultado_func;
}
if($resultado_func == 2){
$msg .= (($msg != "") ? "<br />" : ""). $lang['user_name_short'];
}
if($resultado_func == 3){
$msg .= (($msg != "") ? "<br />" : ""). $lang['user_name_long'];
}

$recom = strtolower($user_name);
$recom = strtr($recom, " ", "_");
$recom = strtr($recom,comprobar_username($user_name), $long_car);
for ($i=0; $i<strlen($recom); $i++){
if (strpos($recom,'#')=== false){
}else{
$recom = substr($recom, 0,strpos($recom,'#')).substr($recom, strpos($recom,'#')+1);
}
}

$recom = trim($recom);

$long_max = MAX_USER_KEYWORD_LENGTH;
$recom = substr($recom,0,$long_max);

$username_option = $lang['user_name_option'].$recom;
 
        $error = 1;
      }

//Mod UNEXPECTED CHARS END

Step 2
Open templates/register_form.html

Find
Code: [Select]
<input type="text" name="user_name" size="30" value="{user_name}" class="input" />
below insert
Code: [Select]
<br>Allowed characters: A-Z a-z А-Я а-я 0-9 space<br>Nickname length: minimum 2, maximum 25 characters.

Step 3

Open includes/constants.php
Find
Code: [Select]
?>above insert
Code: [Select]
//Mod UNEXPECTED CHARS AND LENGHT NICKNAME
define('MIN_USER_KEYWORD_LENGTH', 2);
define('MAX_USER_KEYWORD_LENGTH', 25);
(these values are the minimum and maximum length of the nickname, edit as you need.)

Step 4

Open templates/main.php
Find
Code: [Select]
?>above insert
Code: [Select]
//Mod UNEXPECTED CHARS AND LENGHT NICKNAME
$lang['user_name_short'] = "The entered nickname is too short. The minimum value is 2 characters.";
$lang['user_name_long'] = "The entered nickname is too long. The maximum value is 25 characters.";
$lang['username_bad_characters'] = "Nickname contains invalid characters";
17
Grüße Dich,

es wird noch dauern, aber da ich es für mich selber so oder so umsetzen, werde ich dies auch veröffentlichen.

LG
18
Mods & Plugins (Releases & Support) / Re: [MOD] Birthday Mod v1.0
« Last post by Aleksey on May 06, 2020, 12:13:33 PM »
Fixes for the [MOD] Birthday Mod v1.0 to work in gallery 1.8 on php 7

Open includes/functions.php
find:
Code: [Select]
if ($valid == 1 && ($error || (!ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $birthday)))) return false;and replace with:
Code: [Select]
if ($valid == 1 && ($error || (!preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/", $birthday)))) return false;
The (ereg) function was removed from php 7, and we use (preg_match) instead.
19
Hi Benny,

das schaut schonmal alles sehr gut aus.
Ich bin sehr an dem Refresh interessiert und freue mich über neue/weitere Infos.

Lg

20
Mods & Plugins (Releases & Support) / Re: [MOD] Media sites v1.11.1 (2010-12-22)
« Last post by Warrior on April 20, 2020, 07:21:45 AM »
I know this is a rather old MOD, but believe it or not, it still  works on v.1.8 (which works in this PHP7+ world)!

I did notice something though due to a change I made on the general usage of my Gallery - I normally do NOT allow BB code in the comments, so this issue never showed up before. I turned them on and discovered that this code from this MOD was wiping out the text for Description and Comments -

From includes/Functions:
Find:
Code: [Select]
    $text = preg_replace($search_array, $replace_array, $text);
Insert above:

Code: [Select]
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
    $text = media_sites_bbcode($text);
/*
  MOD MEDIA SITES
  END INSERT
*/
I removed that code and all the description and comments text came back. It's an optional step in the MOD, so it's not a big deal as far as the MOD goes.
Pages: 1 [2] 3 4 5 6 ... 10