Browser Imager

Started on the old forum in February 2009 · view the original in the archive · old links redirect here

26 replies · 2,241 views · started 17 years ago · 1 min read

TL;DR · summary of 26 replies
  • subzero was asking how to add font support to his image browser.
  • GumSlone suggested using imagettftext function from PHP's GD library to add text with custom fonts.
  • Subzero confirmed that adding a font worked, but he still couldn't change the color of the text in the browser info.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
subzero Super moderator Fellow · 3,954 posts #21

i know that bro 😉

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

opticalpigion Lead · 593 posts #22

i have use array for operating system. e.g

$OSList = array
(
        // Match user agent string with operating systems
        'Windows 3.11' => 'Win16',
        'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)',
        'Windows 98' => '(Windows 98)|(Win98)',
        'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',
        'Windows XP' => '(Windows NT 5.1)|(Windows XP)',
);
foreach($OSList as $OS=>$Match)
{
        // Find a match
        if (eregi($Match, $_SERVER['HTTP_USER_AGENT']))
        {
                // We found the correct match
                break;
        }
}
GumSlone Administrator Principal · 1,690 posts #23

I think its nonsense to fight here who has done what, the browser image is a free script which can everyone download and modify. Even if opticalpigion has used subzeeros script, he has modified it so far that at least half code of it it his work. I have based my sig on subzeeros code too, but now there is nothing left from his code in my sig. Please keep your fights away from public.

Topic cleaned.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

opticalpigion Lead · 593 posts #25

GumSlone wrote: I think its nonsense to fight here who has done what, the browser image is a free script which can everyone download and modify. Even if opticalpigion has used subzeeros script, he has modified it so far that at least half code of it it his work. I have based my sig on subzeeros code too, but now there is nothing left from his code in my sig. Please keep your fights away from public.

Topic cleaned.

in my sign there is nothing from his code too.

herez proof. !!

<?php

$src = "sign2.jpg";

$xfile = @file("random.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
$counternum = "counter.txt";
$fp = fopen($counternum,rw);
$num = fgets($fp,9999);
fclose($fp);
$fp = fopen($counternum,w);
$num += 1;
fputs($fp, $num);
fclose($fp);
$string= @exec ( "uptime" );
$OSList = array
(
        // Match user agent string with operating systems
        'Windows 3.11' => 'Win16',
        'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)',
        'Windows 98' => '(Windows 98)|(Win98)',
        'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',
        'Windows XP' => '(Windows NT 5.1)|(Windows XP)',
        'Windows Server 2003' => '(Windows NT 5.2)',
        'Windows Vista' => '(Windows NT 6.0)',
        'Windows 7' => '(Windows NT 7.0)',
        'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',
        'Windows ME' => 'Windows ME',
        'Open BSD' => 'OpenBSD',
        'Sun OS' => 'SunOS',
        'Linux' => '(Linux)|(X11)',
        'Mac OS' => '(Mac_PowerPC)|(Macintosh)',
        'QNX' => 'QNX',
        'BeOS' => 'BeOS',
        'OS/2' => 'OS/2',
        'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)'
);
 
// Loop through the array of user agents and matching operating systems
foreach($OSList as $CurrOS=>$Match)
{
        // Find a match
        if (eregi($Match, $_SERVER['HTTP_USER_AGENT']))
        {
                // We found the correct match
                break;
        }
}

//resize image
list($width, $height, $type, $attr) = getimagesize($src);
$im = imagecreatefromjpeg($src);
//write text to image
$textcolor = imagecolorallocate($im, 255, 255, 255);
ImageColorAllocate($im, 0xAA, 0xBB, 0xCC);
//detect IP
$number = "IP: $_SERVER[REMOTE_ADDR]";
//now detect browser
$browsers = "mozilla msie gecko firefox ";
$browsers.= "konqueror safari netscape navigator ";
$browsers.= "opera mosaic lynx amaya omniweb";
       
$browsers = split(" ", $browsers);

$nua = strToLower( $_SERVER['HTTP_USER_AGENT']);

$l = strlen($nua);
for ($i=0; $i<count($browsers); $i++){
  $browser = $browsers[$i];
  $n = stristr($nua, $browser);
  if(strlen($n)>0){
    $GLOBALS["ver"] = "";
    $GLOBALS["nav"] = $browser;
    $j=strpos($nua, $GLOBALS["nav"])+$n+strlen($GLOBALS["nav"])+1;
    for (; $j<=$l; $j++){
      $s = substr ($nua, $j, 1);
      if(is_numeric($GLOBALS["ver"].$s) )
      $GLOBALS["ver"] .= $s;
      else
      break;
    }
  }
}

//detcting browsing page
$referer = $_SERVER['HTTP_REFERER'];
$line = "forum.wapfuns.com";
$font_file="visitor2.ttf";
$font_file2="arial.ttf";
imagettftext($im,15,0,5,15,$textcolor,$font_file,"$number");
ImageLine($im, 0, 19,200,19, $linecolor);
ImageLine($im, 0, 18,200,18, $linecolor);

imagettftext($im,15,0,5,34,$textcolor,$font_file,"Browser: ".$GLOBALS["nav"]." ".$GLOBALS["ver"]."");
ImageLine($im, 0, 37,200,37, $linecolor);
ImageLine($im, 0, 38,200,38, $linecolor);

imagettftext($im,15,0,5,52,$textcolor,$font_file,"OS: ".$CurrOS."");
ImageLine($im, 0, 56,500,56, $linecolor);
ImageLine($im, 0, 57,500,57, $linecolor);

imagettftext($im,10,0,5,70,$textcolor,$font_file2,"Browsing: ".$referer."");
ImageLine($im, 0, 77,500,77, $linecolor);
ImageLine($im, 0, 76,500,76, $linecolor);
imagettftext($im,12,0,5,100,$textcolor,$font_file2,"$udata[0]");

imagettftext($im,15,0,300,155,$textcolor,$font_file,"$line");
$r1 = rand(1,255);
$r2 = rand(1,255);
$r3 = rand(1,255);
$col=ImageColorAllocate($im, $r1, $r2, $r3);
$col2=ImageColorAllocate($im, $r3, $r2, $r1);
$px = (imagesx($im)-7.5*strlen($string))/2;
$inc = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);
ImageColorTransparent($im, $inc);
ImageFill($im, 0, 0, $inc);
$avg=$num/60;
imagettftext($im,13,0,5,140,$textcolor,$font_file,"This Sign Has Been Viewed,$col1");
ImageLine($im, 0, 129,500,129, $linecolor);
ImageLine($im, 0, 130,500,130, $linecolor);
ImageLine($im, 0, 144,500,144, $linecolor);
ImageLine($im, 0, 143,500,143, $linecolor);

ImageString($im,333,185,130,$num,$col2);
imagettftext($im,13,0,215,140,$textcolor,$font_file,"times $avg views/hour,$col1");
//save
header("Content-Type: image/jpeg");
imagejpeg($im);
?>
RewriteRule ^vishalsign.jpeg$ vishalsign.php

you are free to use,modify,sell whatever you want to do i dont care.

subzero Super moderator Fellow · 3,954 posts #26

Dont keep this up with bulls ok

I was clearly sayin once i had my up and shared it and then others started it ??

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

GumSlone Administrator Principal · 1,690 posts #27

cs.spot123 wrote: Bro, I Din Use Your Script... I Liked Yours So Made It Like Yours...... Now tryin to add favicon.. ;)

i know that you are not using my script because i have not shared my script yet, but you cloned the look, (its not a problem for me) but you could use your imagination and try to create something whats looking different

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close