Author Topic: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7  (Read 26610 times)

0 Members and 1 Guest are viewing this topic.

Offline Sanvean

  • Pre-Newbie
  • Posts: 2
    • View Profile
[MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« on: January 09, 2006, 10:01:22 PM »
Möchte zu dem MMS-Mod, mit dem man einen Button zum MMS-Versand in seine Webseite einbinden kann, nochmal ein neues Thema aufmachen (das alte von 2005 kann man hier noch nachlesen: http://www.4homepages.de/forum/index.php?topic=10181.0 - aber da kam es zu keiner Lösung, und ich glaube wenn ich da posten würde, liest das auch keiner mehr weil es zu alt ist).

Es geht also um das MMS-MOD - folgendes Problem:

Bei der 4images Version 1.7 läuft das MMS Tool anscheinend ohne Probleme, bei Version 1.7.1 (die ich installiert habe) läuft es auch, außer daß die Url zur MMS und die MMS ID im Pop-Up Fenster (auf der mms.html) nicht angezeigt werden.

Der Button und alles andere funktioniert. Nur die Übermittlung von Daten zwischen den Dateien mms.php und getmms.php scheint nicht zu funktionieren. Ich habe das MMS-Tool auf einer Webseite die mit Version 1.7 erstellt wurde einwandfrei gesehen. Dazu ein Screenshot:


Auf meiner Homepage (die sich gerade noch im Aufbau befindet) funktioniert es mit Version 1.7.1 nur soweit, daß das Fenster sich öffnet, die entsprechenden Parameter aber wohl nicht ausgelesen werden. Das Fenster bei MIR sieht so aus (Screenshot):


Die Dateien sind die folgenden:

1. mms.php (neu im Rootverzeichnis)
2. getmms.php (ebenfalls im Rootverzeichnis)
3. mms.html (im eigenen template-Ordner)
4. mms.gif (der Button im Image-Ordner des templates)

5. functions.php   (geänderte Datei im ROOT/includes-Verzeichnis)
6. constants.php (geänderte Datei im ROOT/includes)
7. details.html (geänderte Datei im eigenen template-Ordner)
8. main.php  (angepaßte Datei im lang/deutsch - Verzeichnis)

1. - mms.php

Code: [Select]
<?php
define
('ROOT_PATH''./');
$main_template 'mms';
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE."
             WHERE image_id = "
.$id."";
$image_row $site_db->query_firstrow($sql);

$file_size "n/a";
if (
$file_size = @filesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
   $file_size format_file_size($file_size);
   }

$size = @getimagesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."");
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode$show_link),
  "file_size" => $lang['file_size']." ".$file_size,
  "width" => $lang['imagewidth']." ".$size[0]." ".$lang['px'],
  "height" => $lang['imageheight']." ".$size[1]." ".$lang['px'],
  "mmsheadline" => $lang['mmsheadline'],
  "text" => $lang['mmstext'],
  "mms_id" => $id,
  "url_mms_id" => "".SCRIPT_URL."/getmms.php?id=".$id.""
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>

2. - getmms.php

Code: [Select]
<?php
define
('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
if (!
$id) {
echo 
$lang['error'];
exit;
}
$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE."
             WHERE image_id = "
.$id."";
$image_row $site_db->query_firstrow($sql);
echo 
$lang['id']." ".$id;
echo 
"<br><a href=\"".SCRIPT_URL."/data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\">".$lang['download']."</a>";
?>

3. - mms.html

Code: [Select]
<html>
<head>
<title>{site_name}</title>
<link rel="stylesheet" href="{template_url}/style.css">
</head>
<body bgcolor="#001B8B" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" text="#FFFFFF">
<table width="100%" border="0" cellpadding="1" cellspacing="0">
        <tr>
          <td class="head3" height="19">{mmsheadline}</td>
        </tr>
        <tr>
          <td class="head1">
          <table width="100%" border="0" cellpadding="3" cellspacing="0">
         <tr>
          <td class="row2">{text}</td>
        </tr>
        </table>
          </td>

          <td class="head1">
          <table width="100%" border="0" cellpadding="3" cellspacing="0">
        <tr>
          <td class="row2" align="center">{thumbnail}<p>{file_size}<p>{width}<p>{height}</td>
        </tr>
        </table>

</body>
</html>

4. - mms.gif



5. - functions.php

   - Zeile 264 bis 269 (entsprechend der Anleitung angepaßt)
Code: [Select]
  else {
    $user_name = $lang['userlevel_guest'];
    $user_name_link = $user_name;
  }
 
  $mms = '<a href="javascript:mms(\''.$site_sess->url(ROOT_PATH."mms.php?id=".$image_row['image_id']."").'\')"><img border="0" src="'.get_gallery_image("mms.gif").'"></a>';

   - Zeile 304 bis 307 (entsprechend der Anleitung angepaßt)
Code: [Select]
"image_file_name" => $image_row['image_media_file'],
"mms" => $mms,
    "thumbnail_file_name" => $image_row['image_thumb_file']
  ));

6. - constants.php

   - Zeile 28 und 29
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.meinedomain.info'); //no trailing slash

7. - details.html

   - Zeile 1 bis 13 (Javascript)
Code: [Select]
{header}

<script language="javascript">
function mms(url) {
  var winWidth = 500;
  var winHeight = 350;
  var w = (screen.width - winWidth)/2;
  var h = (screen.height - winHeight)/2 - 60;
  var name = 'MMS';
  var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
  window.open(url,name,features);
}
</script>

8. - main.php

Code: [Select]
//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Bild per MMS empfangen";
$lang['imagewidth'] = "Breite:";
$lang['imageheight'] = "Höhe:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID:";
$lang['mmstext'] = "<b>So kommt dieses Bild auf Ihr Handy:</b><br>
<ul>
<li> Wählen Sie im Wap-Menü 'Zur Adresse'
<li> Geben Sie dort folgendes ein:<br> <B>{url_mms_id}</B>
<li> Es erscheint folgendes:<BR> ID: <b>{mms_id}</b><br><b>Ok, Download</b>
<li> Wählen Sie 'Download'
<li> Das Bild wird nun an Ihr Handy übertragen, bitte gedulden Sie sich einen Augenblick.
<li> Nach dem abgeschlossenen Download erscheint:<br> <b>Datei empfangen</b><br>Optionen - zurück
<li> Wählen Sie <br> <b>Optionen > Speichern</b>
<li> Benennen Sie das Bild und sortieren es in einen Ordner Ihrer Wahl.
<li> <b>Jetzt ist das Bild auf Ihrem Handy abgespeichert!</b>
</ul>";

So, das waren alle Dateien, und hier folgt nun noch die Anleitung, genau so, wie ich sie umgesetzt habe:
Code: [Select]
Überblick:

Du kannst alle Bilder auf einem MMS-fähigen Mobiltelefon erhalten.

Ausgetauschte Dateien:

- includes/functions.php
- includes/constants.php
- templates/<dein Template>/details.html
- lang/<deine Sprache>/main.php

Neue Dateien:

- mms.php
- getmms.php
- templates/<dein Template>/mms.html
- templates/<dein Template>/images/mms.gif

Installation

WICHTIG: Alle "alten" Dateien sichern (Backup)

1.)
Öffne  ->    includes/functions.php
finde dort folgenden Code (Zeile 264 - 267):

  else {
    $user_name = $lang['userlevel_guest'];
    $user_name_link = $user_name;
  }


füge danach folgenden Code hinzu:


$mms = '<a href="javascript:mms(\''.$site_sess->url(ROOT_PATH."mms.php?id=".$image_row['image_id']."").'\')"><img border="0" src="'.get_gallery_image("mms.gif").'"></a>';


suche nach folgendem Code weiter
(Zeile 304 wenn obiger Code bereits eingefügt wurde):

"image_file_name" => $image_row['image_media_file'],

füge dahinter ein:

"mms" => $mms,


2.)
öffne  ->    includes/constants.php

finde folgenden Code:

// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash


ersetze den zuvor genannten Code durch folgenden:


// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash


Vergiß nicht, diese Zeilen zu editieren! Du mußt DEINE EIGENE Domain einsetzen, damit es funktioniert!!! Beachte, daß am Anfang der 2. Zeile die beiden "//" weggelassen werden müssen.


3.)
öffne  ->    templates/<dein Template>/details.html

suche folgenden Code:

{header}

füge danach folgenden Code ein:


<script language="javascript">
function mms(url) {
  var winWidth = 500;
  var winHeight = 350;
  var w = (screen.width - winWidth)/2;
  var h = (screen.height - winHeight)/2 - 60;
  var name = 'MMS';
  var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
  window.open(url,name,features);
}
</script>


Du kannst das {mms} tag in Deinem details template zu dem Zweck verwenden, User MMS empfangen zu lassen.


4.)
öffne  ->    lang/<deine Sprache>/main.php

füge folgenden Code hinzu:

//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Bild per MMS empfangen";
$lang['imagewidth'] = "Breite:";
$lang['imageheight'] = "Höhe:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID:";
$lang['mmstext'] = "<b>So kommt dieses Bild auf Ihr Handy:</b><br>
<ul>
<li> Wählen Sie im Wap-Menü 'Zur Adresse'
<li> Geben Sie dort folgendes ein:<br> <B>{url_mms_id}</B>
<li> Es erscheint folgendes:<BR> ID: <b>{mms_id}</b><br><b>Ok, Download</b>
<li> Wählen Sie 'Download'
<li> Das Bild wird nun an Ihr Handy übertragen, bitte gedulden Sie sich einen Augenblick.
<li> Nach dem abgeschlossenen Download erscheint:<br> <b>Datei empfangen</b><br>Optionen - zurück
<li> Wählen Sie <br> <b>Optionen > Speichern</b>
<li> Benennen Sie das Bild und sortieren es in einen Ordner Ihrer Wahl.
<li> <b>Jetzt ist das Bild auf Ihrem Handy abgespeichert!</b>
</ul>";



5.)
Kreiere folgende Datei  ->   mms.php

schreibe folgenden Code in die Datei:

<?php
define
('ROOT_PATH''./');
$main_template 'mms';
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE."
             WHERE image_id = "
.$id."";
$image_row $site_db->query_firstrow($sql);

$file_size "n/a";
if (
$file_size = @filesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
   $file_size format_file_size($file_size);
   }

$size = @getimagesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."");
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode$show_link),
  "file_size" => $lang['file_size']." ".$file_size,
  "width" => $lang['imagewidth']." ".$size[0]." ".$lang['px'],
  "height" => $lang['imageheight']." ".$size[1]." ".$lang['px'],
  "mmsheadline" => $lang['mmsheadline'],
  "text" => $lang['mmstext'],
  "mms_id" => $id,
  "url_mms_id" => "".SCRIPT_URL."/getmms.php?id=".$id.""
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>




6.)
Kreiere folgende Datei  ->     getmms.php

schreibe folgenden Code in die Datei:

<?php
define
('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
if (!
$id) {
echo 
$lang['error'];
exit;
}
$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE."
             WHERE image_id = "
.$id."";
$image_row $site_db->query_firstrow($sql);
echo 
$lang['id']." ".$id;
echo 
"
<br>
<a href=\""
.SCRIPT_URL."/data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\">".$lang['download']."</a>";
?>




7.)
Kreiere folgende Datei  ->    templates/<dein Template>/mms.html

Du kannst folgende Tags benutzen:

- {mmsheadline}  to show the headline
- {text}  to show the helptext
- {thumbnail}  to show the image
- {width}  to show the width
- {height}  to show the height
- {file_size}  to show the file size


Hier hast Du ein mögliches Beispiel für den Template-Code:


<html>
<head>
<title>{site_name}</title>
<link rel="stylesheet" href="{template_url}/style.css">
</head>
<body bgcolor="#001B8B" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" text="#FFFFFF">
<table width="100%" border="0" cellpadding="1" cellspacing="0">
        <tr>
          <td class="head1" height="19">{mmsheadline}</td>
        </tr>
        <tr>
          <td class="head1">
          <table width="100%" border="0" cellpadding="3" cellspacing="0">
         <tr>
          <td class="row2">{text}</td>
        </tr>
        </table>
          </td>

          <td class="head1">
          <table width="100%" border="0" cellpadding="3" cellspacing="0">
        <tr>
          <td class="row2" align="center">{thumbnail}<p>{file_size}<p>{width}<p>{height}</td>
        </tr>
        </table>

</body>
</html>


Kreiere einen neuen Button  ->   templates/<dein Template>/images/mms.gif

FERTIG!
Einige Informationen über diese Modifikation (MOD):

Die thumbnails dürfen max. 128x128 px groß und die Dateigröße sollte nicht größer als 18 kb sein..

Jetzt meine Bitte:
Ich möchte dieses MMS-Feature als kleines "Bonbon" den Usern meiner Webseite zur Verfügung stellen. Das heißt, ich möchte damit nichts verdienen und daher suche ich bitte bitte auch eine kostenlose Lösung für das Problem.
Ich bin sicher, daß ich nicht der einzige bin, den dieses Problem "nervt", daher wäre es super fein, wenn jemand das mal wirklich ernsthaft checken würde, damit man auch als Nutzer der Version 1.7.1 das MMS-MOD in die Seite einbinden kann.

Ich würde mich freuen, wenn jemand möglichst bitte auf DEUTSCH antworten könnte, weil das dann viel leichter zu verstehen ist :-)

Danke schon mal im Voraus!
Sanvean

Offline Sanvean

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #1 on: January 15, 2006, 06:56:22 PM »
Hallo?!?!?

Kann denn da NIEMAND was zu sagen???

Bitte um Hilfe !!!! Muß doch 'ne Lösung geben oder?!

Vielen Dank

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #2 on: January 15, 2006, 09:31:35 PM »
frage ivan mal, habe ihm das teil angepasst... (o:

Offline Bodzio

  • Newbie
  • *
  • Posts: 36
  • BJ Fan
    • View Profile
    • Always - Bon Jovi Portal Gallery
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #3 on: January 17, 2006, 08:55:37 PM »
With this mod user can download photos via mms? I don't speak german and I don't get anything... Where can I find somekind of a mms mod? Is this a mms based or wap based?
---
Best regards / Pozdrawiam serdecznie

Artur "Bodzio" Bogdański

Offline Bodzio

  • Newbie
  • *
  • Posts: 36
  • BJ Fan
    • View Profile
    • Always - Bon Jovi Portal Gallery
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #4 on: January 17, 2006, 10:30:16 PM »
Can you please tell me where can I find englsh install tutorial?
---
Best regards / Pozdrawiam serdecznie

Artur "Bodzio" Bogdański

Offline Bodzio

  • Newbie
  • *
  • Posts: 36
  • BJ Fan
    • View Profile
    • Always - Bon Jovi Portal Gallery
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #5 on: January 17, 2006, 10:54:10 PM »
Crap, I've got 1.7.1 :/
---
Best regards / Pozdrawiam serdecznie

Artur "Bodzio" Bogdański

Offline Bodzio

  • Newbie
  • *
  • Posts: 36
  • BJ Fan
    • View Profile
    • Always - Bon Jovi Portal Gallery
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #6 on: January 19, 2006, 11:35:24 PM »
I've installed the mod from http://www.4homepages.de/forum/index.php?topic=6787.msg30890#msg30890
but the mms icon in details.html is not showing. What did I do wrong? Anyone had same problem?

Also made a MMS button:

---
Best regards / Pozdrawiam serdecznie

Artur "Bodzio" Bogdański

Offline NTH

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #7 on: May 20, 2006, 09:32:09 AM »
Hi!
How can I download other files? (mid)
When I try download the mid files my mobil  the mobile send 403 error.

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #8 on: June 04, 2006, 01:02:16 AM »
Ich such mir jetzt schon Stunden einen Wolf  :wink:
gibt es den MOD MMS für die Version 1.7.1 ?
Hab so gut wie alles hinter den Links ausprobiert, aber wird nicht richtig angezeigt


Falls es in englisch hier stehen sollte, bitte gebt mir mal einen Schups  :D

Danke Harald
Danke Harald




Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #9 on: June 04, 2006, 07:28:33 PM »
Erledigt
brauche die Url nicht mehr

Danke
 
Danke Harald




Offline funny4

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #10 on: March 29, 2007, 08:04:47 AM »
Hello, I have problem with script MMS, I haven´t URL and ID there isn´t URL and ID. I have script 1.7.4:

Thank You


Offline Buggy Driver

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #11 on: June 28, 2007, 12:03:45 AM »
I had some time to spare today so I installed some extra mods on my gallery including this one

So for 4images 1.7.4 it works like this.

Changed files:

- includes/functions.php
- includes/constants.php
- templates/your Template/details.html
- lang/your language/main.php

New files:

- mms.php
- getmms.php
- templates/your Template/mms.html
- templates/your Template/images/mms.gif

Installation

Important: Backup all files

1.)
Open includes/functions.php find:

Code: [Select]
else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
  }

add after:
Code: [Select]
$mms = '<a href="javascript:mms(\''.$site_sess->url(ROOT_PATH."mms.php?id=".$image_row['image_id']."").'\')"><img border="0" src="'.get_gallery_image("mms.gif").'"></a>';

look for
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file']
  ));

change to
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file'],
"mms" => $mms,
  ));

2.)
open includes/constants.php

find:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

replace with:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

Don't foget 2 edit the line. Your must set your domain!!!

3.)
open templates/your Template/details.html

find:
Code: [Select]
{header}

add after
Code: [Select]
<script language="javascript">
      function mms(url) {
        var winWidth = 700;
        var winHeight = 450;
        var w = (screen.width - winWidth)/2;
        var h = (screen.height - winHeight)/2 - 60;
        var name = 'MMS';
        var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
        window.open(url,name,features);
      }
</script>

3B.)
You can use the {mms} tag in your details template in order to let users recieve mms.

Example
Look for
Code: [Select]
{download_button}&nbsp;&nbsp;

change to
Code: [Select]
{download_button}&nbsp;&nbsp;{mms}&nbsp;&nbsp;


4.)
open lang/your language/main.php

add :
Code: [Select]
//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Recieve image over mms";
$lang['imagewidth'] = "Width:";
$lang['imageheight'] = "Height:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID: ";
$lang['mmstext'] = "<b>This picture on your mobile</b><br>
<ul>
<li> Choose in the Services-menu 'Go to address'
<li> Put the following in the gap:<br> <B>{url_mms_id}</B>
<li> Then you see this:<BR> ID: <b>{mms_id}</b><br><b>Download</b>
<li> Choose 'download'
<li> The picture will be loaded. Please be patient.
<li> After the download you see the following:<br> <b>File recieved</b><br>Options - back
<li> Choose <br> <b>Options > Save</b>
<li> Rename the picture and choose a folder.
<li> <b>Now is the picture on your mobile :-)</b>
</ul>To speed things up in the future. Bookmark<br><b> {SCRIPT_URL}/getmms.php </b>on your mobile<br>there you can enter the ID shown above and hit GO";


5.)
create mms.php add the following code:

Code: [Select]
<?php 

define
('ROOT_PATH''./'); 
$main_template 'mms'
include(
ROOT_PATH.'global.php'); 
require(
ROOT_PATH.'includes/sessions.php'); 
$user_access get_permission(); 
include(
ROOT_PATH.'includes/page_header.php'); 

$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 

$file_size "n/a"
if (
$file_size = @filesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_media_file'])) { 
   
$file_size format_file_size($file_size); 
   } 

$size = @getimagesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file'].""); 
//----------------------------------------------------- 
//--- Print Out --------------------------------------- 
//----------------------------------------------------- 

$mms_text preg_replace("/".$site_template->start."url_mms_id".$site_template->end."/siU"SCRIPT_URL."/getmms.php?id=".$id.""$lang['mmstext']);

$mms_text preg_replace("/".$site_template->start."mms_id".$site_template->end."/siU"$id$mms_text);
$mms_text preg_replace("/".$site_template->start."SCRIPT_URL".$site_template->end."/siU"SCRIPT_URL$mms_text);


$site_template->register_vars(array( 
  
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode$show_link), 
  
"file_size" => $lang['file_size']." ".$file_size
  
"width" => $lang['imagewidth']." ".$size[0]." ".$lang['px'], 
  
"height" => $lang['imageheight']." ".$size[1]." ".$lang['px'], 
  
"mmsheadline" => $lang['mmsheadline'],
"image_id" => $lang['id']."<b>$id</b>",
  
"text" => $mms_text,
)); 
$site_template->print_template($site_template->parse_template($main_template)); 
include(
ROOT_PATH.'includes/page_footer.php'); 

?>



6.)
create getmms.php add the following code:

Code: [Select]
<?php 

define
('ROOT_PATH''./'); 
include(
ROOT_PATH.'global.php');

if (!
$id) { 
echo "Enter image ID";

echo "<form action=\"".SCRIPT_URL."/getmms.php\" method=\"GET\"><input type=\"text\" name=\"id\" size=\"10\"><input type=\"submit\" value=\"GO\" name=\"B1\"></form>";

$site_db->close();
$site_sess->freeze();

exit; 


$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 
echo 
$lang['id']." ".$id
echo 

<br> 
<a href=\""
.SCRIPT_URL."/data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\">".$lang['download']."</a>";
$site_db->close();
$site_sess->freeze();
exit;

?>



7.)
create templates/your Template/mms.html

you can use the following tags:

- {mmsheadline}  to show the headline
- {text}  to show the helptext
- {thumbnail}  to show the image
- {width}  to show the width
- {height}  to show the height
- {file_size}  to show the file size
- {image_id} the ID when using the bookmark version

Possible example of the template:

Code: [Select]
<html>
<head>
<title>{site_name}</title>
<link rel="stylesheet" href="{template_url}/style.css">
</head>
  <body>
    <table width="100%" border="0" cellpadding="3" cellspacing="3">
      <tr>
        <td class="head1" height="19" colspan="2">{mmsheadline}</td>
      </tr>
      <tr>
        <td class="row2" colspan="2">{image_id}</td>
      </tr>
      <tr>
       <td class="row2" >{text}</td>
       <td class="row2" align="center">{thumbnail}<p>{file_size}<p>{width}<p>{height}</td>
      </tr>
    </table>
    <br>{copyright}
  </body>
</html>


create a new button templates/your Template/images/mms.gif

Done!
Some information about the mod:

The thumbnails must be max. 128x128 px and the file size shouldn't be heigher than von 18 kb..

« Last Edit: June 28, 2007, 09:29:49 AM by Buggy Driver »

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.423
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #12 on: June 28, 2007, 02:25:44 PM »
@ Buggy Driver: Thank you!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #13 on: May 20, 2008, 11:29:04 PM »
komplett tauglich für die Version 1.7.6

I had some time to spare today so I installed some extra mods on my gallery including this one

So for 4images 1.7.4 it works like this.

Changed files:

- includes/functions.php
- includes/constants.php
- templates/your Template/details.html
- lang/your language/main.php

New files:

- mms.php
- getmms.php
- templates/your Template/mms.html
- templates/your Template/images/mms.gif

Installation

Important: Backup all files

1.)
Open includes/functions.php find:

Code: [Select]
else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
  }

add after:
Code: [Select]
$mms = '<a href="javascript:mms(\''.$site_sess->url(ROOT_PATH."mms.php?id=".$image_row['image_id']."").'\')"><img border="0" src="'.get_gallery_image("mms.gif").'"></a>';

look for
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file']
  ));

change to
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file'],
"mms" => $mms,
  ));

2.)
open includes/constants.php

find:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

replace with:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

Don't foget 2 edit the line. Your must set your domain!!!

3.)
open templates/your Template/details.html

find:
Code: [Select]
{header}

add after
Code: [Select]
<script language="javascript">
      function mms(url) {
        var winWidth = 700;
        var winHeight = 450;
        var w = (screen.width - winWidth)/2;
        var h = (screen.height - winHeight)/2 - 60;
        var name = 'MMS';
        var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
        window.open(url,name,features);
      }
</script>

3B.)
You can use the {mms} tag in your details template in order to let users recieve mms.

Example
Look for
Code: [Select]
{download_button}&nbsp;&nbsp;

change to
Code: [Select]
{download_button}&nbsp;&nbsp;{mms}&nbsp;&nbsp;


4.)
open lang/your language/main.php

add :
Code: [Select]
//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Recieve image over mms";
$lang['imagewidth'] = "Width:";
$lang['imageheight'] = "Height:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID: ";
$lang['mmstext'] = "<b>This picture on your mobile</b><br>
<ul>
<li> Choose in the Services-menu 'Go to address'
<li> Put the following in the gap:<br> <B>{url_mms_id}</B>
<li> Then you see this:<BR> ID: <b>{mms_id}</b><br><b>Download</b>
<li> Choose 'download'
<li> The picture will be loaded. Please be patient.
<li> After the download you see the following:<br> <b>File recieved</b><br>Options - back
<li> Choose <br> <b>Options > Save</b>
<li> Rename the picture and choose a folder.
<li> <b>Now is the picture on your mobile :-)</b>
</ul>To speed things up in the future. Bookmark<br><b> {SCRIPT_URL}/getmms.php </b>on your mobile<br>there you can enter the ID shown above and hit GO";


5.)
create mms.php add the following code:

Code: [Select]
<?php 

define
('ROOT_PATH''./'); 
$main_template 'mms'
include(
ROOT_PATH.'global.php'); 
require(
ROOT_PATH.'includes/sessions.php'); 
$user_access get_permission(); 
include(
ROOT_PATH.'includes/page_header.php'); 

$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 

$file_size "n/a"
if (
$file_size = @filesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_media_file'])) { 
   
$file_size format_file_size($file_size); 
   } 

$size = @getimagesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file'].""); 
//----------------------------------------------------- 
//--- Print Out --------------------------------------- 
//----------------------------------------------------- 

$mms_text preg_replace("/".$site_template->start."url_mms_id".$site_template->end."/siU"SCRIPT_URL."/getmms.php?id=".$id.""$lang['mmstext']);

$mms_text preg_replace("/".$site_template->start."mms_id".$site_template->end."/siU"$id$mms_text);
$mms_text preg_replace("/".$site_template->start."SCRIPT_URL".$site_template->end."/siU"SCRIPT_URL$mms_text);


$site_template->register_vars(array( 
  
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode$show_link), 
  
"file_size" => $lang['file_size']." ".$file_size
  
"width" => $lang['imagewidth']." ".$size[0]." ".$lang['px'], 
  
"height" => $lang['imageheight']." ".$size[1]." ".$lang['px'], 
  
"mmsheadline" => $lang['mmsheadline'],
"image_id" => $lang['id']."<b>$id</b>",
  
"text" => $mms_text,
)); 
$site_template->print_template($site_template->parse_template($main_template)); 
include(
ROOT_PATH.'includes/page_footer.php'); 

?>



6.)
create getmms.php add the following code:

Code: [Select]
<?php 

define
('ROOT_PATH''./'); 
include(
ROOT_PATH.'global.php');

if (!
$id) { 
echo "Enter image ID";

echo "<form action=\"".SCRIPT_URL."/getmms.php\" method=\"GET\"><input type=\"text\" name=\"id\" size=\"10\"><input type=\"submit\" value=\"GO\" name=\"B1\"></form>";

$site_db->close();
$site_sess->freeze();

exit; 


$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 
echo 
$lang['id']." ".$id
echo 

<br> 
<a href=\""
.SCRIPT_URL."/data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\">".$lang['download']."</a>";
$site_db->close();
$site_sess->freeze();
exit;

?>



7.)
create templates/your Template/mms.html

you can use the following tags:

- {mmsheadline}  to show the headline
- {text}  to show the helptext
- {thumbnail}  to show the image
- {width}  to show the width
- {height}  to show the height
- {file_size}  to show the file size
- {image_id} the ID when using the bookmark version

Possible example of the template:

Code: [Select]
<html>
<head>
<title>{site_name}</title>
<link rel="stylesheet" href="{template_url}/style.css">
</head>
  <body>
    <table width="100%" border="0" cellpadding="3" cellspacing="3">
      <tr>
        <td class="head1" height="19" colspan="2">{mmsheadline}</td>
      </tr>
      <tr>
        <td class="row2" colspan="2">{image_id}</td>
      </tr>
      <tr>
       <td class="row2" >{text}</td>
       <td class="row2" align="center">{thumbnail}<p>{file_size}<p>{width}<p>{height}</td>
      </tr>
    </table>
    <br>{copyright}
  </body>
</html>


create a new button templates/your Template/images/mms.gif

Done!
Some information about the mod:

The thumbnails must be max. 128x128 px and the file size shouldn't be heigher than von 18 kb..


Danke Harald




Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] MMS Version 1.7.1 Probleme gegenüber Version 1.7
« Reply #14 on: May 25, 2008, 11:13:16 PM »
I had some time to spare today so I installed some extra mods on my gallery including this one

So for 4images 1.7.4 it works like this.


2.)
open includes/constants.php

find:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

replace with:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

Don't foget 2 edit the line. Your must set your domain!!!


Leider hat das zur Folge, das sich im Admin nach der erstellen einer Kategorie, die Galerie im Admin läd (siehe Bild)
wenn ich das wieder deaktiviere, ist der Fehler weg.
Nur ohne funktioniert der MMS Mod leider nicht.

Klappt das nur bei mir nicht, oder hat es nur noch keiner bemerkt ??

Harald
Danke Harald