Help with XML guild cards

Teknoid

Fledgling Freddie
Joined
Jan 6, 2004
Messages
66
you should send in a post to Camelot Herald mate about this, tis nice work, i am just trying to make a new image in photoshop now, and just got myself a nice little cheap webhost (gonna host my personal site too)

but if posted on CH, you become famous, but i spose then all forums will be spammed with image signatures :p :touch:
 

Tharion

Fledgling Freddie
Joined
Jan 8, 2004
Messages
608
Great work, did however have to make some MAJOR upgrades to my linux box.

Didn't have image support and crap in PHP and all those libs!! gahh but now its working great :)
 

Takhasis

Can't get enough of FH
Joined
Dec 23, 2003
Messages
1,078
Tharion said:
Great work, did however have to make some MAJOR upgrades to my linux box.

Didn't have image support and crap in PHP and all those libs!! gahh but now its working great :)

Teknoid said:
you should send in a post to Camelot Herald mate about this, tis nice work, i am just trying to make a new image in photoshop now, and just got myself a nice little cheap webhost (gonna host my personal site too)

but if posted on CH, you become famous, but i spose then all forums will be spammed with image signatures :p :touch:

Show us your cards then !! :)
 

Tharion

Fledgling Freddie
Joined
Jan 8, 2004
Messages
608

Amuse

One of Freddy's beloved
Joined
Dec 31, 2003
Messages
779
Tharion said:

Exelent work m8 :) will hafto use this when i reach lvl 50., after i get my sub password back, after goa takes the time to reply...........
 

Takhasis

Can't get enough of FH
Joined
Dec 23, 2003
Messages
1,078
Gromnir said:
givf service for prydwen server also =)

erm, already in m8, if u put srvr=Prydwen ?

charlogo.php


Is this u?
 

Teknoid

Fledgling Freddie
Joined
Jan 6, 2004
Messages
66
Ok, great that this is all working, now for the next problem, It seems i can not get it to work when adding a image to any forum.
I copy and paste the link of the setup i want, and try to add to tags, but even in my guild forum, which normally supports images, wont call up images that seem to be trying to extract the data from GOAs XML files. I am guessing it is not allowing a forum server to access the PHP on the next server, which intern has to extract and forward on the XML data ontop of the image? (i know what i mean even if u dont! o_0 )

Teknoid
 

Takhasis

Can't get enough of FH
Joined
Dec 23, 2003
Messages
1,078
Teknoid said:
Ok, great that this is all working, now for the next problem, It seems i can not get it to work when adding a image to any forum.
I copy and paste the link of the setup i want, and try to add to tags, but even in my guild forum, which normally supports images, wont call up images that seem to be trying to extract the data from GOAs XML files. I am guessing it is not allowing a forum server to access the PHP on the next server, which intern has to extract and forward on the XML data ontop of the image? (i know what i mean even if u dont! o_0 )

Teknoid[/QUOTE]

instead of using the square bracket [] img calls, can u use html and do a <IMG SRC= call?
 

Teknoid

Fledgling Freddie
Joined
Jan 6, 2004
Messages
66
most boards dont allow HTML, including my guild board :( (gonna have to make a new forum for em i guess on my own server, instead of free stuff)
 

Amuse

One of Freddy's beloved
Joined
Dec 31, 2003
Messages
779
so, how do i find oute what my guilds number is? :)
 

Tulkos

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
442
Teknoid said:
most boards dont allow HTML, including my guild board :( (gonna have to make a new forum for em i guess on my own server, instead of free stuff)


Aye mate you can do that if you want :)
 

Deadnala

Fledgling Freddie
Joined
Jan 3, 2004
Messages
678
For some reason i the text dont apear, i guess i can use some help.
http://www.innersphere.be/daoc/charlogo.php?PrintName=Deadnala

Here is the code, i changed it a little to make it readable (for myself ;)

PHP:
<?php
// My link
// [url="http://www.innersphere.be/daoc/charlogo.php?PrintName=Deadnala"]http://www.innersphere.be/daoc/charlogo.php?PrintName=Deadnala[/url]
$PicFile = "dragon.jpg"; // Background
$GuildID = "1214";   // Guilde ID found on [url="http://daoc-stats.com/"]http://daoc-stats.com/[/url]
$TextCol = "L";	// Textcolor L/D
$textpos[0] = "T";   // Ver Textposition T/B
$TextPos[1] = "C";   // Hor Textposition L/C/R   
$Server = "Excalibur";  // Server
$XMLFile = "[url="http://www.camelot-europe.goa.com/herald/servers/"]http://www.camelot-europe.goa.com/herald/servers/[/url]" . $Server . "/guilds/" . $GuildID . ".xml";
$character = array();
function guildXML_startElement($parser, $tagName, $attrs){
 global $insideCharacterTag, $curTag, $name, $laston, $timestamp, $guildname, $realm, $guildrp, $activechars, $activemembers, $lastweekrp;
 global $CharType, $CharLevel;
 if (sizeof($attrs)){
  if ($tagName == "CHARACTER"){
   while (list($attrtag, $data) = each($attrs)){
	switch($attrtag){
	 case "NAME":
	  $name .= $data;
	  break;
	}
   }
  }
  if ($tagName == "GUILD"){
   while (list($attrtag, $data) = each($attrs)){
	switch($attrtag){
	 case "NAME":
	  $guildname .= $data;
	  break;
	}
   }
  }
 }
 if ($insideCharacterTag){
  $curTag = $tagName;
 } else if ($tagName == "CHARACTER"){
  $insideCharacterTag = true;
 }
}
function guildXML_characterData($parser, $data){
 global $insideCharacterTag, $curTag, $race, $class, $level, $guildrank, $totalrp, $tagName, $lastweekrp;
 global $CharType, $CharLevel;
 if ($insideCharacterTag){
  switch ($curTag){
   case "RACE":
	$race .= $data;
	break;
   case "CLASS":
	$class .= $data;
	break;
   case "LEVEL":
	$level .= $data;
	break;
   case "GUILDRANK":
	$guildrank .= $data;
	break;
   case "TOTALRP":
	$totalrp .= $data;
	break;
   case "LASTWEEKRP":
	$lastweekrp .= $data;
	break;
  }
 }
}
function guildXML_endElement($parser, $tagName){
 global $character, $insideCharacterTag, $curTag, $name, $race, $class, $level, $guildrank, $totalrp, $lastweekrp;
 global $CharType, $CharLevel;
 if ($tagName == "CHARACTER"){
  $charinfo = array($guildrank, $name, "", $race, $class, $level, $totalrp, $lastweekrp);
  array_push($character, $charinfo);
  $curTag = "";
  $name = "";
  $race = "";
  $class = "";
  $level = "";
  $guildrank = "";
  $totalrp = "";
  $timestamp = "";
  $guildrp = "";
  $lastweekrp = "" ;
  $activechars = "";
  $activemembers = "";
  $insideCharacterTag = false;
 }
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "guildXML_startElement", "guildXML_endElement");
xml_set_character_data_handler($xml_parser, "guildXML_characterData");
$fp = fopen($XMLFile,"r") or die("Error reading GOA data.");
while ($data = fgets($fp, 4096))
 xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
 fclose($fp);
 xml_parser_free($xml_parser);
 $totalofcharacter = count($character);
 for($i=0; $i<$totalofcharacter; $i++){
  $ranksort = $character[$i];
  if (strncmp($ranksort[1], $PrintName, strlen($PrintName)) == 0){
   $ih = imagecreatefromjpeg($PicFile);
   $black = imagecolorallocate($ih, 0, 0, 0); 
   $white = imagecolorallocate($ih, 255, 255, 255); 
   if ($TextCol == "L"){
	$color1 = imagecolorallocate($ih, 255, 255, 255); 
	$color2 = imagecolorallocate($ih, 255, 255, 0);
	$shade = imagecolorallocate($ih, 0, 0, 0); 
   } elseif ($TextCol == "D"){
	$color1 = imagecolorallocate($ih, 0, 0,0);
	$color2 = imagecolorallocate($ih, 0, 0, 0); 
	$shade = imagecolorallocate($ih, 255, 255, 255); 
   }
   header('Content-Type: image/jpeg');
   if (!$ih){
	$ih  = imagecreate(200, 80); /* Create a blank image */
	imagefilledrectangle($ih, 0, 0, 200, 80, $black);
	imagestring($ih, 1, 5, 5, "Error loading $imgname", $white);
   } else {
	$size = getimagesize($PicFile);
	imagealphablending($ih, true); 
	$TextLine1 = trim($ranksort[1]);
	$TextLine2 = trim("L" . trim($ranksort[5]) . " " . trim($ranksort[3]) . " " . trim($ranksort[4]));
	$TextLine3 = trim(number_format($ranksort[6], 0)) . " RP";
	$TextLine4 = trim($guildname);
	if ($TextPos[0] == 'T'){
	 $y1 = 18;
	 $y2 = 32;
	 $y3 = 46;
	 $y4 = 60;
	} elseif ($TextPos[0] == 'B') {
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine1);
	 $y1 = $size[1]  - $LnName[3] - 44;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine2);
	 $y2 = $size[1]  - $LnName[3] - 38;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine3);
	 $y3 = $size[1]  - $LnName[3] - 22;
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine4);
	 $y4 = $size[1]  - $LnName[3] - 6;
	}
	if ($TextPos[1] == 'L'){
	 $x1 = 6;
	 $x2 = 6;
	 $x3 = 6;
	 $x4 = 6;
	} elseif ($TextPos[1] == 'R') {
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine1);
	 $x1 = $size[0]  - $LnName[2] - 6;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine2);
	 $x2 = $size[0]  - $LnName[2] - 4;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine3);
	 $x3 = $size[0]  - $LnName[2] - 4;
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine4);
	 $x4 = $size[0]  - $LnName[2] - 4;
	} elseif ($TextPos[1] == 'C'){
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine1);
	 $x1 = ($size[0]  - $LnName[2]) / 2;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine2);
	 $x2 = ($size[0]  - $LnName[2]) / 2;
	 $LnName = imagettfbbox(8, 0, "tahomabd", $TextLine3);
	 $x3 = ($size[0]  - $LnName[2]) / 2;
	 $LnName = imagettfbbox(12, 0, "mael", $TextLine4);
	 $x4 = ($size[0]  - $LnName[2]) / 2;
	}
	imagettftext($ih, 12, 0, $x1, $y1, $shade, "mael", $TextLine1);
	imagettftext($ih, 12, 0, $x1-1, $y1-1, $color1, "mael", $TextLine1);
	imagettftext($ih, 8, 0, $x2, $y2, $shade, "tahomabd", $TextLine2);
	imagettftext($ih, 8, 0, $x2-1, $y2-1, $color1, "tahomabd", $TextLine2);
	imagettftext($ih, 8, 0, $x3, $y3, $shade, "tahomabd", $TextLine3);
	imagettftext($ih, 8, 0, $x3-1, $y3-1, $color2, "tahomabd", $TextLine3);
	imagettftext($ih, 12, 0, $x4, $y4, $shade, "mael", $TextLine4);
	imagettftext($ih, 12, 0, $x4-1, $y4-1, $color1, "mael", $TextLine4);
   }
   imagejpeg($ih);
   imagedestroy($ih);
  }
 }

?>
 

wwwKillaghcom

Fledgling Freddie
Joined
Jan 23, 2004
Messages
2
How do you put XML on your website by the way?

I use webeasy and it publishes my website in dynamic html.

If you don't mine explaining it, how do I put the XML for my server on the website
 

delay

Fledgling Freddie
Joined
Jan 5, 2004
Messages
54
Warms my heart to see DAoC players who actually do other things than whining =)

Way to go, all of you! Makes me proud =D

I'll have a look on the source soon to figure out what I'm doing wrong in my own project as PHP can't locate the .ttf =/



Deadnala said:
PHP:
  $curTag = "";
  $name = "";
  $race = "";
  $class = "";
  $level = "";
  $guildrank = "";
  $totalrp = "";
  $timestamp = "";
  $guildrp = "";
  $lastweekrp = "" ;
  $activechars = "";
  $activemembers = "";
PHP:
unset($curTag, $name, $race, $class, $level, $guildrank, $totalrp, $timestamp, $guildrp, $lastweekrp, $activechars, $activemembers);
comes to mind
 

Takhasis

Can't get enough of FH
Joined
Dec 23, 2003
Messages
1,078
delay said:
Warms my heart to see DAoC players who actually do other things than whining =)

Way to go, all of you! Makes me proud =D

I'll have a look on the source soon to figure out what I'm doing wrong in my own project as PHP can't locate the .ttf =/

according to www.php.net the fonts should go in the same dir as the php file, BUT they can sometimes default to looking in another folder for the fonts. If this is the case, then try changing the line as follows:

imagettfbbox(12, 0, "tahomabd", "Bit of Text");

to

imagettfbbox(12, 0, "./tahomabd", "Bit of Text");

this "should" force it to look in the same dir as the .php file...
 

Spremuta

Fledgling Freddie
Joined
Feb 4, 2004
Messages
6
Takhasis said:

Hi, i'm a new italian user :)
I tried the link above but using the charlogo.php that i put on my site...and works partially...i can't see the guild name and the pg name..this is the link:
click

I wanna use your charlogo for my pg in the italian server :)
 

Spremuta

Fledgling Freddie
Joined
Feb 4, 2004
Messages
6
Spremuta said:
Hi, i'm a new italian user :)
I tried the link above but using the charlogo.php that i put on my site...and works partially...i can't see the guild name and the pg name..this is the link:
click

I wanna use your charlogo for my pg in the italian server :)


up ;)
 

Deadnala

Fledgling Freddie
Joined
Jan 3, 2004
Messages
678
It still refuse to work, fonts are in the same dir and i made this change..

Takhasis said:
imagettfbbox(12, 0, "./tahomabd", "Bit of Text");
 

Users who are viewing this thread

Top Bottom