Seite 2 von 3

Verfasst: 09.09.2008 15:55
von Latinoportal
Dr.Death hat geschrieben: Für den letzten Beitrag wäre etwas mehr SQL nötig, was wiederum auf die Performance schlagen kann.
Dann lassen wir es besser!

@ alle Interessierten

So schaut meine geänderte Version aus:

http://www.latinoportal.de/portal/signatur.php

Hier der Code dazu:

Code: Alles auswählen

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);

$image = "./signaturbild.png";
@touch($image);
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 255, 136, 0);
$tc2 = ImageColorAllocate ($im, 255, 255, 255);

$total_users_online = obtain_users_online($forum_id = 0);
$total_online_users = $total_users_online['total_online'];
$prev_user_ip = '';

$sitename = $config['sitename'];

$total_users = $config['num_users'];
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];

$newest_userdata = $config['num_users'];
$newest_user = $config['newest_username'];

ImageString($im, 3, 10, 3, "$sitename", $tc);
ImageString($im, 2, 10, 22, "Mitglieder: $total_users  |  Davon momentan online: $total_online_users", $tc2);
ImageString($im, 2, 10, 33, "Unser neustes Mitglied heißt: $newest_user", $tc2);
ImageString($im, 2, 10, 44, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc2);
header("Content-Type: image/png");
Imagepng($im);
ImageDestroy ($im);
?>

Viel Spaß!

Verfasst: 27.10.2008 01:53
von Dr@gon83
wie kann ich bei dem code eigentlich anstelle von hintergrund farbe ein Hintergrundbild einfügen also was muss ich ändern damit ich ein hintergrundbild einfügen kann

Verfasst: 27.10.2008 07:40
von DreamPromise
Moin moin

hab gerade auch mal aus Spaß probiert ob es funktioniert ... es kam so wie es kommen musste :wink:

Es kommen folgende Meldungen:
[phpBB Debug] PHP Notice: in file /signatur.php on line 9: imagecreatefrompng(./signaturbild.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory
[phpBB Debug] PHP Notice: in file /signatur.php on line 10: imagecolorallocate(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 11: imagecolorallocate(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 26: imagestring(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 27: imagestring(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 28: imagestring(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 29: imagestring(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 30: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2975)
[phpBB Debug] PHP Notice: in file /signatur.php on line 31: imagepng(): supplied argument is not a valid Image resource
[phpBB Debug] PHP Notice: in file /signatur.php on line 32: imagedestroy(): supplied argument is not a valid Image resource
http://www.tratschcafe.de/signatur.php

Was hab ich falsch gemacht ??

DP

Verfasst: 27.10.2008 10:01
von DerGonzo
Moin!
DreamPromise hat geschrieben:Was hab ich falsch gemacht ??
Deine Datei signatur.php versucht ein Bild signaturbild.png zu öffnen. Heißt Deine Grafikdatei auch wirklich so?

Ansonsten: schöne Sache, hab ich mir auch gleich zusammengebastelt und etwas erweitert... :D

http://www.jugendforum-dorsten.de/signatur.php

Danke dafür! :grin:

Schönen Gruß,
DerGonzo!

Verfasst: 27.10.2008 13:00
von DreamPromise
Moin moin

jaaa...feine Sache ..wenns denn funktioniert :wink:

Im Moment sieht es bei mir so aus:

Code: Alles auswählen

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);

$image = "sig.png";
@touch($image);
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 255, 136, 0);
$tc2 = ImageColorAllocate ($im, 255, 255, 255);

$total_users_online = obtain_users_online($forum_id = 0);
$total_online_users = $total_users_online['total_online'];
$prev_user_ip = '';

$sitename = $config['sitename'];

$total_users = $config['num_users'];
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];

$newest_userdata = $config['num_users'];
$newest_user = $config['newest_username'];

ImageString($im, 3, 10, 3, "$sitename", $tc);
ImageString($im, 2, 10, 22, "Mitglieder: $total_users  |  Davon momentan online: $total_online_users", $tc2);
ImageString($im, 2, 10, 33, "Unser neustes Mitglied heißt: $newest_user", $tc2);
ImageString($im, 2, 10, 44, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc2);
header("Content-Type: images/png");
Imagepng($im);
ImageDestroy ($im);
?>
Aber immer erscheint das Download-Fenster :-? :-?

http://www.tratschcafe.de/signatur.php

DP

Verfasst: 27.10.2008 15:03
von Dr.Death
An dieser Stelle liegt kein PNG Bild: http://www.tratschcafe.de/sig.png

Verfasst: 27.10.2008 17:16
von DreamPromise
Doch doch ... es ist nur komplett in weiß :wink:

Verfasst: 28.10.2008 19:33
von DreamPromise
Nabend ...

keiner eine Idee ??

Verfasst: 28.10.2008 19:42
von 4seven
testweise in der signatur.php mal austauschen gegen

Code: Alles auswählen

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);

echo 'Test';

?>
und berichten...

dann immer noch download?

Verfasst: 28.10.2008 19:56
von DreamPromise
Moin moin

also der Download ich nicht mehr da :wink:
Nun erscheint wunschgemäß "Test".

DP