EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   Chit-Chat (https://www.eq2interface.com/forums/forumdisplay.php?f=2)
-   -   Cool dynamic sig (my own) (https://www.eq2interface.com/forums/showthread.php?t=1116)

mad 04-06-2005 08:25 PM

Yeah mine is only for use with my guild at my guild site. It is too bad your thread got highjacked lol :)

If you would not mind IM'ing the code to me to save me some time cleaning his current code. I do need the intergration with the db so my entire guild can use this. So I mainly want the code you commented maybe that would explain some of the stuff I am currently confused about ;)

Gotta run talk to you later.

Drumstix42 04-06-2005 09:29 PM

Best I can do is within 2 or 3 days time worth... but I'll post it.

mad 04-07-2005 01:08 AM

Nice Thanks Drum :) I will put this on the backburner until then. :nana:

predawnia 04-13-2005 01:32 AM

With reference to Octavius's themed sig gen, to make a sig with transparent background you use the following code in your theme.php file.

Code:

$image_get = "themes/theme1/sig.png";
$image_src = imagecreatefrompng($image_get);
$transcolor = imagecolorresolve($image_src, 239, 239, 239); //sets transparent color to 239,239,239
$image_out = imagecreatetruecolor(400, 200);
imagepalettecopy($image_out, $image_src); //copies source palette to new output image
imagefill($image_out,0,0,$transcolor); //fills the output image with transparent color
imagecolortransparent($image_out, $transcolor); //set output image color to transparent
imagecopyresized($image_out, $image_src, 0, 0, 0, 0, 400, 200, 400, 200); // copies source image over output image
imagedestroy($image_src);
$color = imagecolorallocate($image_out,220,220,255);
imagestring($image_out, 3, 30, 70, $player['name'].$surname, $color);
.
.
.

Here is a sample of a transparent background sig.
http://av.mmog-tng.com/sig/image.php...nye&img=ornate
Hope this helps whoever trying to make cool themes :)

Drumstix42 04-13-2005 02:47 AM

lol if the original image already has a transparent background (like a gif) you don't have to do anything special to it.

and for those waiting for me to post the code, it's coming. I've been busy.

predawnia 04-13-2005 04:06 AM

Apparently, the original Octavius theme.php code could not output the PNG with transparency even if the original PNG image is transparent, hence the mod suggested here. ;)

Khimaira 04-25-2005 01:51 PM

Hey all,

I'm pretty much a neophyte at all this kind of stuff, but I have been able to get Octavius' script to work, add new backgrounds, move text around (I know, not a big deal to most ;) )...but I was wondering if someone could either give me tips on how to change the font or point me in the right direction...hopefully somewhere with the beginner in mind :)

I can change the font size no problem, but as for changing the default font or using a truetype font...that I haven't figured out yet.

Khimaira 04-27-2005 10:04 AM

Anyone?

Okay...how about this...over at http://www.eqsig.com/ it looks like you can add your own picture (character portrait) to the signature. Is there a way to add a similar feature to Octavius' script?

yoda 05-08-2005 05:35 PM

parsing
 
Ok I've been learning php recently and started customizing Octavius's signature code. I got my custom colors, fonts, and placements down. What I am having trouble doing is parsing the html in order to get extra stats, like number of kills and such. I realize some stats are on different pages. Perhaps someone here can explain how html parsing works or provide a link or 2 for some good reference docs, so that i may learn on my own. I have tried google but can't find anything substantial.

Thank you for your time.

Khimaira 05-08-2005 08:42 PM

Quote:

Originally Posted by yoda
I got my custom colors, fonts, and placements down.

Yoda, may I ask how you do the custom fonts?

yoda 05-08-2005 09:16 PM

that was relatively easy. in Octavius's sig files you need to edit the theme.php file.

instead of imagestring use imagettftext

example:
Code:

imagettftext($image_out, 9, 0, 10, 36, $color, $font, $player['adventurer']);
you also need to upload the font file *.ttf and provide the path

example:
Code:

$font = 'font/arial.ttf';

yoda 05-10-2005 04:27 PM

So no one can point me in the right direction to learn how to parse html?

Drumstix42 05-10-2005 04:37 PM

Well I was supposed to post my code on how to easily take each txt piece from the various pages, and post my examples, but I've 1) been low on time, and 2) really don't play EQ2 anymore.

Hopefully I'll post it one of these days.

Basically you'll want the parser code, and instead of displaying the specific array numbers onto your graphic, you just want to echo all of what's in the array.

just a simple FOR loop, then you take the numbers you want for your "newly wanted stats" ect. I've modified the parser a bit since Octavious, because somethings just don't work, if they're multi-worded or you only want 1 part of it to have custom text, or whatever.

The "real" PITA (pain in the ...) is to add in for extra pages like Achievements page, because you have to add all the DB stuff for All of those, and with SQL, need them in order, ect.

I did that already, and just need to post it, but I'll need to find what I did to put it out into a simply array for you.

Anyhow, sorry for saying little in many words.

yoda 05-11-2005 07:23 PM

Ok, so lets see if i understand you any. The Octavius code is parsing for specific text and what I should do is parse the entire page and echo the parse output so i know where the text is that i want?

If i sort of have that right it kinda brings me back to my original question. is there a website or something where I can learn about html parsing commands and what its doing? maybe somewhere in www.php.net? I tried a search on that site but can't get many parsing commands to show up.

I do appreciate you taking your time to reply and help a php beginner :)

godsfshrmn 05-13-2005 06:54 PM

New Dynamic Sig generator eqsig.com
 
Hey guys I have been working out the bugs on my sig generator in the past few weeks and it is now working pretty well. Its only been up for about two weeks and already have over 100 people sign up. I am using it right now in my signature, and there are random example sigs on the website.

http://www.eqsig.com

EDIT: for some reason this got merged w/ this post, which was totally a different service. remotely hosted and i have wrote my own code

Landiin 05-18-2005 09:38 PM

With the .htaccess tag Drums posted you can still use options on the end of the url. You just need to put somthing like null=.gif and the end to fool the forums checking code.

This is my normal url to my sig
http://www.crusadersvalorous.org/lan.../sig/toran.gif


and here is one I use for soe restricted site
http://www.crusadersvalorous.org/lan...=soe&null=.gif


and here is one I use sites that have odd ball size restriction
http://www.crusadersvalorous.org/lan...=300&null=.gif


Yes I am still working on the transparency when the image gets resized:/ Other then that it works pritty good.

Landiin 05-20-2005 11:06 PM

Ok whats up with IE? In Firefox the back ground is tranparent like it is coded to do but when I look at it with IE it has black (10,10,10) back ground I used. Does IE blow that bad it can't even display graphics right? /sigh

0ctavius 05-31-2005 04:09 PM

Hi guys, I have been 'offline' for some time, but started getting a bit of nostalgia so thought I would look in to see how the progress os going. Feel free to bounce ideas off me if you need. I don't intend to pick this script back up again, as it would not be fair to anyone else who has made progress with it, nor would it be fair to anyone if I picked it up, and dropped it again later.

I can at least offer my experience and knowledge on how I originally wrote the script, for those of you wishing to adapt it to your own needs. Good work to those who have made changes for the better.

And no, I have not returned to Eq2, now I doubt will I ever. Just not in the cards right now. The web features I see have not made the move to live xml feeds, which is unfortunate, and part of the reason I am glad I am not a part of that community anymore. XML feeds would have made this script SO much easier to design / manage for more of the community.

0ctavius 05-31-2005 04:12 PM

Quote:

Originally Posted by Landiin
Ok whats up with IE? In Firefox the back ground is tranparent like it is coded to do but when I look at it with IE it has black (10,10,10) back ground I used. Does IE blow that bad it can't even display graphics right? /sigh

IE does not support transparent PNG (yet, supposedly IE7 will). Unfortunately this is one of the most contested, and angrily sought after features that MS failed to add to IE to date, and may be one of the reasons PNG has not become the defacto image format of the internet yet (replacing JPG and GIF).

For more information you should read these articles, as they cover it in great detail. From these you might begin to see why so many people consider the IE browser(despite being the most prominent) to be the worst browser in terms of compatibility and standards compliance:

http://www.w3.org/Graphics/PNG/Inline-img.html
http://www.w3.org/Graphics/PNG/all_seven.html
http://www.w3.org/Graphics/PNG/inline-alpha.html

Also go here, and scroll down to "Internet Explorer" in the list of supported browsers. This page is the official home of the PNG image format.
http://www.libpng.org/pub/png/pngapbr.html

Khimaira 06-08-2005 06:28 AM

I have no idea why, but this script is no longer working on my site (long delay and then finally just the ole red x where the sig should be) - I know I made no changes that would cause it to break. Anyone else having a problem?

Probably is my host (bravenet) but curious if anyone else experienced this - maybe a change at EQ2Players?

Any ideas on what I can do to figure this out? Pretty much at a complete loss.

Seagoat 08-11-2005 01:04 PM

Quote:

Originally Posted by yoda
instead of imagestring use imagettftext

example:
Code:

imagettftext($image_out, 9, 0, 10, 36, $color, $font, $player['adventurer']);
you also need to upload the font file *.ttf and provide the path

example:
Code:

$font = 'font/arial.ttf';

I've tried this fix, but it actually breaks my script! I get no text at all on the background image.

Does the imagettftext string parameters need to be defined in exactly the order you described, and/or does the $font definition need to be in a particular place?

I'm no newbie to coding, although PHP is new to me as of a few months back. I'm an expert tweaker, so this breakage is dumbfounding me...everything looks right. I uploaded my fonts and everything. :p

mortis42 08-11-2005 02:36 PM

Quote:

Originally Posted by LCAngela
I've tried this fix, but it actually breaks my script! I get no text at all on the background image.

Does the imagettftext string parameters need to be defined in exactly the order you described, and/or does the $font definition need to be in a particular place?

I'm no newbie to coding, although PHP is new to me as of a few months back. I'm an expert tweaker, so this breakage is dumbfounding me...everything looks right. I uploaded my fonts and everything. :p

You actually need to modify the image.php file around lines 39 - 48. At least, that was how I was able to change text on my test site.

Check this page out:
http://us2.php.net/imagettftext

Denuve 08-22-2005 11:42 AM

htaccess
 
I am trying to get the .gif extension to work so I can post on a php.nuke site, but I just cant get it going. I have the .htaccess file and changed the .php to .gif just like its posted. What could I be doing wrong? Anyone want to walk thru the steps again?

Quote:

Anyhow, I was the the one that mentioned I use HTACCESS.

-I put my pid inside the file, and save the file as just .php
-Rename the extension to .gif
-create .HTACCESS file in the same directory as file
-then I paste thie code into the HTACCESS file:
Here are the files:
Code:

<?php
ob_start("ob_gzhandler");
require("includes/config.php");
require("includes/global.php");
$pid = "219049205";
$surname = get_var($HTTP_GET_VARS['sn'], "surname");
$mode = get_var($HTTP_GET_VARS['m'], "mode");
// -----------------------------------------------------------------------------// get and update player data
if ($usedb != TRUE) {
        $phtml = get_html($pid, "player"); $phtml[0] = $pid; $check_gid = get_var($phtml[25], "gid");
        if ($phtml[26] == "Unguilded") {$phtml[67] = ""; $ghtml = array(0 => "--------------",1 => "Unguilded",2 => "--------------",3 => "--------------",5 => "--------------",7 => "--------------",9 => "--------------",11 => "--------------",21 => "--------------",23 => "--------------");}
        else {$ghtml = get_html($phtml[25], "guild"); $gserver = $ghtml[1]." Server"; $gmembers = $ghtml[7]." Total Members"; $glevel = "Guild Level ".$ghtml[21]; $gstatus = $ghtml[23]."Status"; $ghtml[0] = $phtml[25]; $ghtml[2] = $gserver; $ghtml[7] = $gmembers; $ghtml[21] = $glevel; $ghtml[23] = $gstatus; $ghtml[1] = $phtml[26]; $rhtml = get_html($phtml[25], "roster"); $k = array_search($phtml[1], $rhtml); $i = $k-1; $phtml[67] = $rhtml[$i];}
        $player = build_array($phtml, "player"); $guild = build_array($ghtml, "guild");}
else {
        $pdata = get_data($pid, "player");
        if ($obj = mysql_fetch_object($pdata)) {
                if ($obj->updated < date('YmdHis')-$update) {
                        $phtml = get_html($pid, "player"); $phtml[0] = $pid; $check_gid = get_var($phtml[25], "gid");
                        if ($phtml[26] == "Unguilded") {$phtml[67] = "";} else {$rhtml = get_html($phtml[25], "roster"); $k = array_search($phtml[1], $rhtml); $i = $k-1; $phtml[67] = $rhtml[$i];}
                        $player = build_array($phtml, "player"); $pupdate = db_process($player, "player", "update");}}
        else {
                $phtml = get_html($pid, "player"); $phtml[0] = $pid; $check_gid = get_var($phtml[25], "gid");
                if ($phtml[26] == "Unguilded") {$phtml[67] = "";} else {$rhtml = get_html($phtml[25], "roster"); $k = array_search($phtml[1], $rhtml); $i = $k-1; $phtml[67] = $rhtml[$i];}
                $player = build_array($phtml, "player"); $pupdate = db_process($player, "player", "insert");}
        $pdata = get_data($pid, "player"); $player = mysql_fetch_array($pdata, MYSQL_ASSOC);
        if ($player['guild'] != "Unguilded") {
                $gdata = get_data($player['gid'], "guild");
                if ($obj = mysql_fetch_object($gdata)) {
                        if ($obj->updated < date('YmdHis')-$update) {$ghtml = get_html($player['gid'], "guild"); $gserver = $ghtml[1]." Server"; $gmembers = $ghtml[7]." Total Members"; $glevel = "Guild Level ".$ghtml[21]; $gstatus = $ghtml[23]."Status"; $ghtml[0] = $player['gid']; $ghtml[2] = $gserver; $ghtml[7] = $gmembers; $ghtml[21] = $glevel; $ghtml[23] = $gstatus; $ghtml[1] = $player['guild']; $guild = build_array($ghtml, "guild"); $gupdate = db_process($guild, "guild", "update");}}
                else {$ghtml = get_html($player['gid'], "guild"); $gserver = $ghtml[1]." Server"; $gmembers = $ghtml[7]." Total Members"; $glevel = "Guild Level ".$ghtml[21]; $gstatus = $ghtml[23]."Status"; $ghtml[0] = $player['gid']; $ghtml[2] = $gserver; $ghtml[7] = $gmembers; $ghtml[21] = $glevel; $ghtml[23] = $gstatus; $ghtml[1] = $player['guild']; $guild = build_array($ghtml, "guild"); $gupdate = db_process($guild, "guild", "insert");}
                $gdata = get_data($player['gid'], "guild"); $guild = mysql_fetch_array($gdata, MYSQL_ASSOC);}
        else {$guild = array("name" => "Unguilded","server" => "--------------","members" => "--------------","level" => "--------------","status" => "--------------");}}
// -----------------------------------------------------------------------------// create image
if (isset($HTTP_GET_VARS['img']) && $HTTP_GET_VARS['img'] != "") {
        $theme = include("themes/".$HTTP_GET_VARS['img']."/theme.php");
        if (!$theme) {$theme = include("themes/".$dtheme."/theme.php");}}
else {$theme = include("themes/".$dtheme."/theme.php");}
?>

Code:

<FilesMatch http://www.wawwb.com/eq2sig/denuvesig.gif>
SetHandler application/x-httpd-php
</FilesMatch>


Denuve

Landiin 08-22-2005 02:24 PM

1st I beleave

Code:

<FilesMatch http://www.wawwb.com/eq2sig/denuvesig.gif>
SetHandler application/x-httpd-php
</FilesMatch>

should be

<FilesMatch denuvesig.gif>
SetHandler application/x-httpd-php
</FilesMatch>

and the .htaccess should be in the same directory as the file you are calling.

I'll look when I get home from work to see how mine is, its been a while lol..

Denuve 08-23-2005 12:49 PM

Changed it, still nothing. /cry.

Anymore hints?


I need php for dummies I think. Im totally self taught and I cannot find the info anywhere.


All times are GMT -5. The time now is 11:20 AM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI