Author Topic: Signature 2.21 and PHP versions  (Read 6789 times)

0 Members and 1 Guest are viewing this topic.

Offline geohei

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Signature 2.21 and PHP versions
« on: December 11, 2006, 11:28:13 PM »
Hi.

Here my signature code:
http://www.geohei.lu/geoheiBB/viewtopic.php?t=471

This works fine with PHP 4.4.2, however it doesn't show anything for PHP 5.1.2.

Since I do require PHP 5.1.2 for wiki, I'd like to change the Signature 2.21 in order to make it compatible to PHP 5.1.2.

Any ideas what's wrong?

Thanks.

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
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 geohei

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Signature 2.21 and PHP versions
« Reply #2 on: December 12, 2006, 06:49:05 AM »
... search for php5 compatible ...
http://www.4homepages.de/forum/index.php?topic=6632.msg83700#msg83700

This backet issue seems to be mandatory. I found 3 instances of "LEFT JOIN". I changed the code as follows:
Code: [Select]
...
      $sql = "CREATE TEMPORARY TABLE ".$temptab." TYPE  =  HEAP
              SELECT i.image_id, i.cat_id
              FROM (".IMAGES_TABLE." i)
              LEFT JOIN ".CATEGORIES_TABLE." c ON c.cat_id = i.cat_id
              WHERE i.image_active = 1 AND c.auth_viewcat = $auth AND i.cat_id NOT IN ($not_in_cat)".(($peruser) ? " AND i.user_id = ".$peruser : "").(($imageid) ? " AND i.image_id <> ".$imageid : "")."
              ORDER  BY RAND()
              LIMIT 1";
...
      $sql = "SELECT t.image_id, t.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file
              FROM (".$temptab." AS t)
              LEFT JOIN ".IMAGES_TABLE." AS i ON i.image_id=t.image_id";
...
      $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file
              FROM (".IMAGES_TABLE." i)
              LEFT JOIN ".CATEGORIES_TABLE." c ON c.cat_id = i.cat_id
              WHERE i.image_active = 1 AND c.auth_viewcat = $auth AND i.cat_id NOT IN ($not_in_cat)".(($peruser) ? " AND i.user_id = ".$peruser : "").(($imageid) ? " AND i.image_id <> ".$imageid : "")."
              ORDER  BY RAND()
              LIMIT 1";
...

Is this correct?
It doesn't work for me :cry:

http://www.4homepages.de/forum/index.php?topic=10184.msg50191#msg50191

This seems to apply only to the gallery itself, not to signature.php. Correct?

Thanks,
« Last Edit: December 12, 2006, 07:06:15 AM by geohei »

Offline geohei

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Signature 2.21 and PHP versions
« Reply #3 on: December 15, 2006, 09:07:45 AM »
No answers yet ...  :(

I can hardly imagine that I am the first one who hits this problem.

Is the MySQL version also related to some extent to this problem, or is it only the PHP version which makes the signature.php code not work?

Thanks,

Offline geohei

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Signature 2.21 and PHP versions
« Reply #4 on: December 18, 2006, 08:32:06 AM »
Hi.

I installed XAMPP on a test system in order to trace the problem regarding PHP 5. Can't find find anything posted in this thread (or included links), which would solve this issue.