Încerc să fac o semnătură dinamică pentru phpBB 3.1.x
Vreau ca imaginea să fie generată automat după USER_ID în ucp.
Bănuiesc că asta ține de htaccess ca URL-ul să se rescrie ca forum.ro/sig.php?id=1
Acesta este codul pe care îl folosesc:
Cod: Selectaţi tot
<?php
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = './../../';
include($phpbb_root_path . 'common.'.$phpEx);
$bg = './sig_bg.jpg';
$bg = request_var('bg', $bg);
$user->session_begin();
$username = ($user->data['username']);
$avt = ($user->data['user_avatar']);
list($width, $height, $type) = @getimagesize($user->data['user_avatar']);
switch ( $type )
{
case 1:
$avatar = imagecreatefromgif($user->data['user_avatar']);
break;
case 2:
$avatar = imagecreatefromjpeg($user->data['user_avatar']);
break;
case 3:
$avatar = imagecreatefrompng($user->data['user_avatar']);
break;
}
list($bg_width, $bg_height, $bg_type) = @getimagesize($bg);
switch ( $bg_type )
{
case 1:
$bg_img = imagecreatefromgif($bg);
break;
case 2:
$bg_img = imagecreatefromjpeg($bg);
break;
case 3:
$bg_img = imagecreatefrompng($bg);
break;
}
$this_img = imagecreatetruecolor(468, 70);
if ( isset($bg_width) && isset($bg_height) && isset($bg_img) )
{
imagecopymerge($this_img, $bg_img, 0, 0, 0, 0, $bg_width, $bg_height, 100);
}
imagealphablending($this_img, TRUE);
$color = imagecolorallocate($this_img, 0, 0, 0);
$bg = imagecolorallocatealpha($this_img, rand(200, 250), rand(200, 250), rand(200, 250), 100);
imagefill($this_img, 0, 0, $bg);
if ( isset($width) && isset($height) )
{
imagecopymerge($this_img, $avatar, 468 - $width, 1, 5, 5, $width, $height, 100);
}
// Create the image
imagefilledrectangle($this_img, 0, 0, 467, 69, $bg);
// User avatar
// This is in progress
// User Statistics
imagestring($this_img, 3, 90, 1, 'My Statistics', $color); // My Statistics title
imagestring($this_img, 2, 90, 22, 'Name: ' . $username, $color);
imagestring($this_img, 2, 90, 33, 'Rank: Administrator', $color);
imagestring($this_img, 2, 90, 44, 'Posts: 17 372', $color);
imagestring($this_img, 2, 90, 55, 'E-mail: neculaioffi@gmail.com', $color);
// Board Statistics
imagestring($this_img, 3, 285, 1, 'Board Statistics', $color); // Board Statistics title
imagestring($this_img, 2, 285, 22, 'Total Topics: ' . $config['num_topics'], $color);
imagestring($this_img, 2, 285, 33, 'Total Posts: ' . $config['num_posts'], $color);
imagestring($this_img, 2, 285, 44, 'Total Members: ' . $config['num_users'], $color);
imagestring($this_img, 2, 285, 55, 'Newest member: ' . $config['newest_username'], $color);
// Avatar Text Right
imagestring($this_img, 3, 66, 5, 'A', $color);
imagestring($this_img, 3, 66, 14, 'V', $color);
imagestring($this_img, 3, 66, 23, 'A', $color);
imagestring($this_img, 3, 66, 32, 'T', $color);
imagestring($this_img, 3, 66, 41, 'A', $color);
imagestring($this_img, 3, 66, 50, 'R', $color);
// Background gradient, width, height + border
imagerectangle($this_img, 0, 0, 467, 69, $color);
header('Content-Type: image/gif');
imagegif($this_img);
?>
Vreau ca fiecare utilizator să aibe semnătura lui. Să o poată folosi și pe alte forumuri. Nu să arate statisticile vizitatorului.
Cam așa arată până acum:
Și așa ar vrea să arate:
Acest script arată DOAR informațiile celui ce privește, dacă nu ai cont nu arată nimic.
Eu vreau să includ această semnătură în panoul utilizatorului și să fie generată automat pentru utilizatorul respectiv ca el să poată folosi imaginea în cod BB.
Nu sunt sigur că ați înțeles.
Mă poate ajuta cineva?
Animo
phpBB.ro Styles Team Member