Author
Message
hitwalker Sells PC To Pay For Divorce Joined: Posts: 5661
Posted:
Sun Jun 19, 2005 5:12 am
ah..very nice...
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Sun Jun 19, 2005 10:20 pm
Code: <?
$title_font = 'yourtitlefont.ttf';
... some code ...
imagefttext($image, $title_dimension, $rotation, $x, $y, $title_colour, $title_font, $title, $arr_null);
?>
i hope you understand the code now that's in english
to use differents fonts just place a ttf file in the same dir of the script and use the syntax above. if you are interested i can translate all in english just ask!
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Sun Jun 19, 2005 10:38 pm
hitwalker wrote: well if you see font_testo and look for that on google i get 2 results on italian pages where they discuss that..
like .... font_testo { font-family: arial, verdana;
.
maybe yuo've found my forum but this was a post by a newbie that doesn't mean anything
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Sun Jun 19, 2005 11:28 pm
Translate it for me I need it
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Sun Jun 19, 2005 11:36 pm
ok when i'm done i'll post here
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Sun Jun 19, 2005 11:38 pm
thank you verymuch you have been a very big help also could you add the part for the font for using a true type font on my server
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Sun Jun 19, 2005 11:41 pm
but i explained ttf 4 post ago...
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Mon Jun 20, 2005 12:03 am
ok then just the translated code then
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Mon Jun 20, 2005 12:33 am
when is the translated version of your signature code going to be finished?
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Mon Jun 20, 2005 1:29 am
Manuel wrote: Code:
<?
/*
# firma.php by Manuel #
# Copyright (c) 2005 by UltraDigital.it #
# http://www.ultradigital.it #
# Last update: 18/06/2005 #
# */
require_once('mainfile.php');
global $db, $prefix, $user, $multilingual;
$at = $db->sql_numrows($db->sql_query("SELECT sid FROM ".$prefix."_stories"));
$at = number_format($at, 0, ',', '.');
if ($multilingual == 1) {
$querylang = "WHERE planguage='$currentlang' AND artid='0'";
} else {
$querylang = "WHERE artid='0'";
}
$tmp = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
$pollID = intval($tmp['pollID']);
$tmp = $db->sql_fetchrow($db->sql_query("SELECT pollTitle, voters FROM ".$prefix."_poll_desc WHERE pollID='$pollID'"));
$pollTitle = $tmp['pollTitle'];
$voters = number_format(intval($tmp['voters']), 0, ',', '.');
$ts = $db->sql_numrows($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc"));
$ts = number_format($ts, 0, ',', '.');
$tmp = $db->sql_fetchrow($db->sql_query("SELECT SUM(optionCount) as VotiTot FROM ".$prefix."_poll_data"));
$vt = $tmp['VotiTot']; $vt = number_format($vt, 0, ',', '.');
$tmp = $db->sql_fetchrow($db->sql_query("SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'", $db));
$pv = number_format($tmp['count'], 0, ',', '.');
$tot = $db->sql_numrows($db->sql_query("SELECT user_id FROM ".$prefix."_users")) - 1;
$tot = number_format($tot, 0, ',', '.');
$ris = $db->sql_query("SELECT * FROM ".$prefix."_session");
$nonline = $db->sql_numrows($ris);
$nonline = number_format($nonline, 0, ',', '.');
$nt = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbtopics"));
$np = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbposts"));
$tmp = $db->sql_query("SELECT topic_views, topic_replies, topic_vote FROM ".$prefix."_bbtopics");
while ($tr = $db->sql_fetchrow($tmp)) {
$nv += $tr['topic_views'];
$nr += $tr['topic_replies'];
}
$ns = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbvote_desc"));
$tmp = $db->sql_query("SELECT vote_result FROM ".$prefix."_bbvote_results");
while ($tr = $db->sql_fetchrow($tmp)) $nvo += $tr['vote_result'];
$pc = round(($nr*100)/$np,2); $nm = number_format($nm, 0, ',', '.');
$nm = $db->sql_numrows($db->sql_query("SELECT user_id FROM ".$prefix."_users")) - 1;
$nt = number_format($nt, 0, ',', '.'); $np = number_format($np, 0, ',', '.');
$nr = number_format($nr, 0, ',', '.'); $nv = number_format($nv, 0, ',', '.');
$ns = number_format($ns, 0, ',', '.'); $nvo = number_format($nvo, 0, ',', '.');
if (is_user($user)) {
if (!is_array($user)) {
$tmpuser = addslashes($user);
$tmpuser = base64_decode($tmpuser);
$tmpuser = explode(":", $tmpuser);
$uid = "$tmpuser[0]";
} else {
$uid = "$user[0]";
}
$uid = addslashes($uid);
$uid = intval($uid);
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id='$uid'";
if ($result = $db->sql_query($sql)) {
$tmp = $db->sql_fetchrow($result);
$uname = $tmp[username];
$tmp = $db->sql_fetchrow($db->sql_query("SELECT user_rank FROM ".$prefix."_users WHERE username='$uname'", $db));
$urank = $tmp['user_rank'];
$tmp = $db->sql_fetchrow($db->sql_query("SELECT rank_title FROM ".$prefix."_bbranks WHERE rank_id='$urank'", $db));
$tipo = $tmp['rank_title'];
} else {
$uname = ""; $tipo = "Anonimo";
}
} else {
$uname = ""; $tipo = "Anonimo";
}
$nf = $db->sql_numrows($db->sql_query("select * from ".$prefix."_downloads_downloads"));
$tmp = $db->sql_query("select hits from ".$prefix."_downloads_downloads");
while (list($hits) = sql_fetch_row($tmp, $db)) $dw += $hits;
$tmp = $db->sql_query("select sum(filesize*hits) as serv from ".$prefix."_downloads_downloads");
while (list($serv) = sql_fetch_row($tmp)) $served = $serv;
$gb = 1024*1024*1024; $mb = 1024*1024; $kb = 1024;
if ($served >= $gb){
$tr = sprintf ("%01.2f",$served/$gb) . " Gb";
} elseif ($served >= $mb) {
$tr = sprintf ("%01.2f",$served/$mb) . " Mb";
} elseif ($served >= $kb) {
$tr = sprintf ("%01.2f",$served/$kb) . " Kb";
} else{
$tr = $served . " Bytes";
}
$nf = number_format($nf, 0, ',', '.'); $dw = number_format($dw, 0, ',', '.');
$tmp = $db->sql_fetchrow($db->sql_query("SELECT count FROM ".$prefix."_counter WHERE type='firma' AND var='imp'", $db));
$if = $tmp['count'] + 1;
$db->sql_query("UPDATE ".$prefix."_counter SET count = '$if' WHERE type='firma' AND var='imp'", $db);
$if = number_format($if, 0, ',', '.');
$image = imagecreatefrompng("images/firma.png");
$colore_titolo = imagecolorallocate($image, 255, 255, 255);
$colore_subtit = imagecolorallocate($image, 0, 255, 0);
$titolo = "ULTRADIGITAL - LIVESTATS!"; $subtit = "<< $uname - $tipo >>";
$dim_titolo = 6; $font_titolo = 'titolo.ttf';
$dim_subtit = 6; $font_subtit = 'default.ttf';
header("Content-type: image/png");
$arr_null = array(0);
imagefttext($image, $dim_titolo, 0, 60, 10, $colore_titolo, $font_titolo, $titolo, $arr_null);
//imagestring($image, $font, 60, 2, $titolo, $colore_titolo);
if ($uname <> "") imagefttext($image, $dim_subtit, 0, 220, 10, $colore_subtit, $font_subtit, $subtit, $arr_null);
//imagestring($image, $dim_subtit, 260, 2, $subtit, $colore_subtit);
$colore_testo = imagecolorallocate($image, 77, 174, 241);
$dim_testo = 6; $font_testo = 'default.ttf';
$riga0 = "Membri: $nm - OnLine Adesso: $nonline - Visite: $pv - Articoli: $at";
imagefttext($image, $dim_testo, 0, 60, 25, $colore_testo, $font_testo, $riga0, $arr_null);
$riga1 = "Sondaggio corrente: '$pollTitle' - Voti: $voters";
imagefttext($image, $dim_testo, 0, 60, 35, $colore_testo, $font_testo, $riga1, $arr_null);
$riga2 = "Sondaggi: $ts - Voti Totali: $vt - Nei Forums: $ns - Voti Forums: $nvo";
imagefttext($image, $dim_testo, 0, 60, 45, $colore_testo, $font_testo, $riga2, $arr_null);
$riga3 = "Topics: $nt - Posts: $np - Risposte: $nr ($pc%) - Letture: $nv";
imagefttext($image, $dim_testo, 0, 60, 55, $colore_testo, $font_testo, $riga3, $arr_null);
$riga4 = "Files: $nf - Downloads: $dw - Traffico: $tr";
imagefttext($image, $dim_testo, 0, 60, 65, $colore_testo, $font_testo, $riga4, $arr_null);
// imagestring($image, $dim_testo, 60, 17, "Topics $nt | Posts $np | Risposte $nr ($pc%) | Letture $nv", $colore_testo);
// imagestring($image, $dim_testo, 60, 31, "Membri $nm | OnLine Adesso $nonline | Visite $pv | Sondaggi $ns | Voti $nvo", $colore_testo);
// imagestring($image, $dim_testo, 60, 45, "Files $nf | Downloads $dw | Traffico $tr", $colore_testo);
imagefttext($image, $dim_testo, 90, 454, 49, $colore_testo, $font_testo, 'FIRMA N.', $arr_null);
$dim = imageftbbox($dim_testo, 0, $font_testo, $if, $arr_null);
$x = 468 - $dim[3] - 6; $y = 30 + $dim[2] / 2;
imagefttext($image, $dim_testo, 90, $x, $y, $colore_testo, $font_testo, $if, $arr_null);
imagepng($image);
imagedestroy($image);
?>
if you use this code please give me some credits
this is a forum related:
feel free to ask in english, remember to translate strings in my code obviously
Manuel can you translate this code for me so I can use it.
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Thu Jun 23, 2005 11:06 am
don't spam me, isn't very helpful...
so there is the code
i'll put a package in donwnloads sections of my site when i'll have time
Code:
<?
/*
# ultrasignature.php by Manuel #
# Copyright (c) 2005 by UltraDigital.it #
# http://www.ultradigital.it #
# #
# Developed to be used on PHP-Nuke 7.6 may be compatible with others #
# Last update: 23/06/2005 #
# #
# PLEASE IF YOU USE THIS SCRIPT GIVE ME SOME CREDITS :) THANKS #
# PROGRAM LICENSED UNDER GNU/GPL LICENSE #
# */
require_once('mainfile.php');
global $db, $prefix, $user, $multilingual;
$at = $db->sql_numrows($db->sql_query("SELECT sid FROM ".$prefix."_stories"));
$at = number_format($at, 0, ',', '.');
if ($multilingual == 1) {
$querylang = "WHERE planguage='$currentlang' AND artid='0'";
} else {
$querylang = "WHERE artid='0'";
}
$tmp = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
$pollID = intval($tmp['pollID']);
$tmp = $db->sql_fetchrow($db->sql_query("SELECT pollTitle, voters FROM ".$prefix."_poll_desc WHERE pollID='$pollID'"));
$pollTitle = $tmp['pollTitle'];
$voters = number_format(intval($tmp['voters']), 0, ',', '.');
$ts = $db->sql_numrows($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc"));
$ts = number_format($ts, 0, ',', '.');
$tmp = $db->sql_fetchrow($db->sql_query("SELECT SUM(optionCount) as VotiTot FROM ".$prefix."_poll_data"));
$vt = $tmp['VotiTot']; $vt = number_format($vt, 0, ',', '.');
$tmp = $db->sql_fetchrow($db->sql_query("SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'", $db));
$pv = number_format($tmp['count'], 0, ',', '.');
$tot = $db->sql_numrows($db->sql_query("SELECT user_id FROM ".$prefix."_users")) - 1;
$tot = number_format($tot, 0, ',', '.');
$ris = $db->sql_query("SELECT * FROM ".$prefix."_session");
$nonline = $db->sql_numrows($ris);
$nonline = number_format($nonline, 0, ',', '.');
$nt = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbtopics"));
$np = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbposts"));
$tmp = $db->sql_query("SELECT topic_views, topic_replies, topic_vote FROM ".$prefix."_bbtopics");
while ($tr = $db->sql_fetchrow($tmp)) {
$nv += $tr['topic_views'];
$nr += $tr['topic_replies'];
}
$ns = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbvote_desc"));
$tmp = $db->sql_query("SELECT vote_result FROM ".$prefix."_bbvote_results");
while ($tr = $db->sql_fetchrow($tmp)) $nvo += $tr['vote_result'];
$pc = round(($nr*100)/$np,2); $nm = number_format($nm, 0, ',', '.');
$nm = $db->sql_numrows($db->sql_query("SELECT user_id FROM ".$prefix."_users")) - 1;
$nt = number_format($nt, 0, ',', '.'); $np = number_format($np, 0, ',', '.');
$nr = number_format($nr, 0, ',', '.'); $nv = number_format($nv, 0, ',', '.');
$ns = number_format($ns, 0, ',', '.'); $nvo = number_format($nvo, 0, ',', '.');
if (is_user($user)) {
if (!is_array($user)) {
$tmpuser = addslashes($user);
$tmpuser = base64_decode($tmpuser);
$tmpuser = explode(":", $tmpuser);
$uid = "$tmpuser[0]";
} else {
$uid = "$user[0]";
}
$uid = addslashes($uid);
$uid = intval($uid);
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id='$uid'";
if ($result = $db->sql_query($sql)) {
$tmp = $db->sql_fetchrow($result);
$uname = $tmp[username];
$tmp = $db->sql_fetchrow($db->sql_query("SELECT user_rank FROM ".$prefix."_users WHERE username='$uname'", $db));
$urank = $tmp['user_rank'];
$tmp = $db->sql_fetchrow($db->sql_query("SELECT rank_title FROM ".$prefix."_bbranks WHERE rank_id='$urank'", $db));
$type = $tmp['rank_title'];
} else {
$uname = ""; $type = "Anonymous";
}
} else {
$uname = ""; $type = "Anonymous";
}
$nf = $db->sql_numrows($db->sql_query("select * from ".$prefix."_downloads_downloads"));
$tmp = $db->sql_query("select hits from ".$prefix."_downloads_downloads");
while (list($hits) = sql_fetch_row($tmp, $db)) $dw += $hits;
$tmp = $db->sql_query("select sum(filesize*hits) as serv from ".$prefix."_downloads_downloads");
while (list($serv) = sql_fetch_row($tmp)) $served = $serv;
$gb = 1024*1024*1024; $mb = 1024*1024; $kb = 1024;
if ($served >= $gb){
$tr = sprintf ("%01.2f",$served/$gb) . " Gb";
} elseif ($served >= $mb) {
$tr = sprintf ("%01.2f",$served/$mb) . " Mb";
} elseif ($served >= $kb) {
$tr = sprintf ("%01.2f",$served/$kb) . " Kb";
} else{
$tr = $served . " Bytes";
}
$nf = number_format($nf, 0, ',', '.'); $dw = number_format($dw, 0, ',', '.');
// Increments the counter for our signature.php script. Need a modification to nuke_counter table to work!
$tmp = $db->sql_fetchrow($db->sql_query("SELECT count FROM ".$prefix."_counter WHERE type='firma' AND var='imp'", $db));
$if = $tmp['count'] + 1;
$db->sql_query("UPDATE ".$prefix."_counter SET count = '$if' WHERE type='firma' AND var='imp'", $db);
$if = number_format($if, 0, ',', '.');
$image = imagecreatefrompng("images/firma.png"); // You may change this image... ('firma' = 'signature')
$title_color = imagecolorallocate($image, 255, 255, 255);
$subtit_color = imagecolorallocate($image, 0, 255, 0);
$title = "ULTRADIGITAL - LIVESTATS!"; $subtit = "<< $uname - $type >>";
$title_dim = 6; $title_font = 'titolo.ttf';
$dim_subtit = 6; $font_subtit = 'default.ttf';
header("Content-type: image/png");
$arr_null = array(0);
imagefttext($image, $title_dim, 0, 60, 10, $title_color, $title_font, $title, $arr_null);
if ($uname <> "") imagefttext($image, $dim_subtit, 0, 220, 10, $subtit_color, $font_subtit, $subtit, $arr_null);
$text_color = imagecolorallocate($image, 77, 174, 241);
$text_dim = 6; $font_testo = 'default.ttf';
$riga0 = "Members: $nm - OnLine Now: $nonline - Visits: $pv - Articles: $at";
imagefttext($image, $text_dim, 0, 60, 25, $text_color, $font_testo, $riga0, $arr_null);
$riga1 = "Current Survey: '$pollTitle' - Votes: $voters";
imagefttext($image, $text_dim, 0, 60, 35, $text_color, $font_testo, $riga1, $arr_null);
$riga2 = "Surveys: $ts - Total Votes: $vt - In Forums: $ns - Forum's Votes: $nvo";
imagefttext($image, $text_dim, 0, 60, 45, $text_color, $font_testo, $riga2, $arr_null);
$riga3 = "Topics: $nt - Posts: $np - Replies: $nr ($pc%) - Reads: $nv";
imagefttext($image, $text_dim, 0, 60, 55, $text_color, $font_testo, $riga3, $arr_null);
$riga4 = "Files: $nf - Downloads: $dw - Traffic: $tr";
imagefttext($image, $text_dim, 0, 60, 65, $text_color, $font_testo, $riga4, $arr_null);
imagefttext($image, $text_dim, 90, 454, 49, $text_color, $font_testo, 'SIGN N.', $arr_null);
$dim = imageftbbox($text_dim, 0, $font_testo, $if, $arr_null);
$x = 468 - $dim[3] - 6; $y = 30 + $dim[2] / 2;
imagefttext($image, $text_dim, 90, $x, $y, $text_color, $font_testo, $if, $arr_null);
imagepng($image);
imagedestroy($image);
?>
i pray moderators to delete precedent unuseful posts
Manuel Regular Joined: May 28, 2005 Posts: 90
Posted:
Fri Jun 24, 2005 11:37 am
now on my site you can download the latest signature package named UltraSignature
m-weisel2 Regular Joined: May 22, 2005 Posts: 78
Posted:
Sun Jun 26, 2005 3:58 am
Goto page Previous 1 , 2
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum