4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: bildergallery on October 25, 2005, 12:25:56 AM
-
hier der code in deutsch
habe rausgefunden dass dieses mod nur für vers. 1.7 läuft, unter der vers. 1.7.1 tritt ein komischer fehler auf. was ist an diesem code falsch?
ich habe dieses mms mod installiert
Geänderte Dateien:
- includes/functions.php
- includes/constants.php
- templates/<dein Template>/details.html
- lang/<deine Sprache>/main.php
Neue Dateien:
- mms.php //root ordner
- getmms.php //root ordner
- templates/<dein Template>/mms.html
- templates/<dein Template>/images/mms.gif
Installation
WICHTIG: Mache vorher von den geänderten Dateien Dateien ein Backup
1.)
Öffne die Datei includes/functions.php finde:
Code:
else {
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
füge dahinter das ein:
Code:
$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:
Code:
"image_file_name" => $image_row['image_media_file'],
füge dahinter ein:
Code:
"mms" => $mms,
2.)
Öffne die Datei includes/constants.php
suche nach:
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
ersetzen mit:
Code:
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.bildergallery.com'); //no trailing slash
3.)
Öffne die templates/<dein Template>/details.html
suche nach:
Code:
{header}
füge dahinter ein
Code:
<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>
So nun kannst du irgenwo im Template noch den Tag {mms} setzen, damit die User das Bild schicken können.
4.)
Öffne die lang/<deine Sprache>/main.php
und füge folgendes ein:
Code:
//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Bild als MMS schicken";
$lang['imagewidth'] = "Bildbreite:";
$lang['imageheight'] = "Bildhöhe:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID:";
$lang['mmstext'] = "<b>So kommt dieses Bild auf Ihr Handy</b><br>
<ul>
<li> Rufen Sie im WAP-Menu \"Zur Adresse\" auf<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 auf Ihr Handy geladen. Bitte gedulden Sie sich einen Augenblick.<li>
Beim abgeschlossenen Download erscheint:<br> <b>Datei empfangen</b><br>Optionen - zurück<li> Wählen Sie <BR> <b>Optionen > Speichern</b><li> Geben Sie dem Bild nun noch einen Namen und wählen Sie einen Ordner aus.<li> <b>Jetzt ist das Bild in auf Ihrem Handy abgespeichert!</b>
</ul>";
5.)
Erstelle eine neue Datei mms.php und füge folgenen Code ein:
Code:
<?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.)
Erstelle eine neue Datei getmms.php und füge folgenen Code ein:
Code:
<?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.)
Erstelle eine neue Datei templates/<dein Template>/mms.html
In dem Template kannst du folgen Tags nutzen:
- {mmsheadline} Zur Anzeige der Überschrift
- {text} Zur Anzeige des Hilfetextes
- {thumbnail} Zur Anzeige der Bilddatei
- {width} Zur Anzeige der Breite
- {height} Zur Anzeige der Höhe
- {file_size} Zur Anzeige der Dateigröße
Ein Beispiel des gesamten Templates: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>{widh}<p>{height}</td>
</tr>
</table>
</body>
</html>
leider bekomme ich auf meiner webseite bildergallery.com (http://www.bildergallery.com) bei der detailansicht mms button zwar das javascript popup jedoch werden die kategorie und id nicht in die entsprechenden felder geladen. Siehe Beispiel... (*gif images)
(http://www.igraf.ch/orig.gif) (http://www.igraf.ch/foul.gif)
Wie kann ich ausserdem erreichen, dass nur registrierte Benutzer zugang zu diesem Button haben?
bitte helft mir, bin fast am verzweifeln.....
vielen dank
-
Are you having trouble with a published mod? if so, please reply to the topic u are refering to!
If this is something you made yourself and you require assistance, please be more specific on what you did, and what is the problem. Also, mixing two languages in one reply makes it very hard to folow. Next time post a reply to your original post with a translated version, not both in one reply.
Thank you.
-
kann ich mir das irgendwo anschauen?
-
wenn ich es später schaffe installiere ich es mal local auf einer 1.7.1 und dann mal schauen wo das Problem liegt, aber jetzt muss ich erstmal ein Dreamboard zum laufen bringen...
-
you could also try http://www.mpush.com/
That way you can earn some extra money :)
-
Hallo
Ich habe das Script heute ausprobiert.
Aber leider zeogt es mir den Button für MMs nicht an .
Kann mir jemand sagen woran das liegen könnte ?
Vielen dank im vorraus.
LG Doreen
-
Jetzt bekomme ich immer diese Fehlermeldung :-(
Parse error: syntax error, unexpected $end in /www/htdocs/v079538/4images/lang/deutsch/main.php on line 383
-
Recard,,,
http://www.4homepages.de/forum/index.php?topic=9291.msg55465#msg55465
excitex2
-
hi,
gibs da eine Variante für 1.7.2 ??
mfg smilysm
-
hi ivan ,
u have mentioned that details.html has to modified to show the mms button ?? what are the modification that are required ?
Thanks
Akshay
-
Im getting the following error .. Can anyone help please ??
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in \4images\mms.php on line 3
Parse error: syntax error, unexpected T_STRING in \4images\mms.php on line 3
Thanks
Akshay