[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
AniDB • New Signature Pic feature [FEEDBACK] - Page 3
Page 3 of 5

Posted: Mon Sep 04, 2006 2:42 am
by GIJOE98
interesting idea... wrote a similiar application for myself a while back... no real web interface since i wanted to have automated updates i just wrote a program in vb to update the datebase via php.. the php backend was rather simple and has support for multiple users but no registration, cache, or web ui to speak of... anyway... i can offer help or ideas if needed...

ex.
http://www.fredericaspage.com/joesjunk/ ... ?u=GIJOE98
hmm... this board doesn't support dynamic urls?

JOE

Posted: Mon Sep 04, 2006 4:08 am
by cenedra
hey, man, that does look pretty nice....

but i still would like to do 'my own thing' for my sig.. :cry:
i guess something like that would be ok... did you guys already decide on dimensions and all that? i can't really remember, lol


CeNedra

Posted: Tue Sep 12, 2006 9:17 pm
by KnightAR
Has anyone steped up and started coding this yet?

(I wouldnt mind doing it but my time is limited and it might take a while)

Posted: Fri Sep 15, 2006 6:35 pm
by HiEv
Cyrano423 wrote:K ... I need a bit of clarification. What's the purpose of the database on the sig server?
[...]
So I'm wondering if I'm missing something. As I can't see any information that would need to be written or stored to the database. It wouldn't need access to modify or even read from the anidb, since nothing's written ... and all the information needed is given in the XML file / feed.
That's great if you want to access that data from the AniDB site every time, but wouldn't it make more sense to cache that data so that you decrease the load on both servers and speed up the display of the images? Imagine a page in a popular forum where someone using one of these sigs made several posts. Do you really want to rebuild that image from scratch every time it's shown for each person who views it?

They even mentioned caching the data right in the news section on the main page, so you will need some sort of database to cache the signatures in. If you store the username, the image, and the date/time that the image was created, then you can simply reuse that image unless it's too out of date. Whoever does this will probably also want to make something that periodically clears out the old data, but that's one thing you'll definitely want to use a database for.

Posted: Fri Sep 29, 2006 11:23 pm
by EvoGT
KnightAR wrote:Has anyone steped up and started coding this yet?

(I wouldnt mind doing it but my time is limited and it might take a while)
yes I have.

http://manga-network.de/sig/improved/sig.php

the image is also cached (variable time), but i don't use a DB yet, because
I need to know what kind of DB and entries.

Posted: Tue Oct 03, 2006 11:53 pm
by ruxkor
cenedra wrote:hey, man, that does look pretty nice....

but i still would like to do 'my own thing' for my sig.. :cry:
i guess something like that would be ok... did you guys already decide on dimensions and all that? i can't really remember, lol


CeNedra
if you really are keen on doing it (putting your own background behind the stats) if you have a bit of skill in any language that can serve for image creation (lets say php with the gd library) you can dynamically generate your own pic by fetching the dynamically generated picture from the anidb (this picture will have a transparent background i hope or it should be at least configurable) and combining it with your static background.

should be max. 20 minutes of work, also not knowing nothing about the gd, there are really great tutorials around.. :wink:

although it should be possible for the sig server to host this image and combine it for you, i think it would be impossible to include it because of the traffic it would cause:
a 600*50 png with a one color font and text to cover the whole space is approx 2KB big. it would be approx. 50 times heavier if you could include your own background (ca. 100KB)

Posted: Wed Oct 04, 2006 7:00 pm
by EvoGT
ruxkor wrote:
cenedra wrote:hey, man, that does look pretty nice....

but i still would like to do 'my own thing' for my sig.. :cry:
i guess something like that would be ok... did you guys already decide on dimensions and all that? i can't really remember, lol


CeNedra
if you really are keen on doing it (putting your own background behind the stats) if you have a bit of skill in any language that can serve for image creation (lets say php with the gd library) you can dynamically generate your own pic by fetching the dynamically generated picture from the anidb (this picture will have a transparent background i hope or it should be at least configurable) and combining it with your static background.

should be max. 20 minutes of work, also not knowing nothing about the gd, there are really great tutorials around.. :wink:

although it should be possible for the sig server to host this image and combine it for you, i think it would be impossible to include it because of the traffic it would cause:
a 600*50 png with a one color font and text to cover the whole space is approx 2KB big. it would be approx. 50 times heavier if you could include your own background (ca. 100KB)
there is no problem to check the size of custom backgrounds. ;)
i already use a transparent pic, created from the xml and then
combine it with the bg ;)

Posted: Tue Oct 17, 2006 12:26 am
by Gemberkoek
*Steps up to the plate*

*opens mouth*
Please either shut up and code or shut up and don't code.
*closes it again and starts coding*

Something like this:

Code: Select all

<?php

//Sig server code

include("db.php"); //Loads database

$user_ID = $_GET["id"]; //What user do we want a sig for?

$result = MySQL_QUERY("SELECT * FROM configoptions WHERE user_ID = '".$user_ID."'");
$arr_configoptions = mySQL_FETCH_ARRAY($result);
header("Content-type: image/png");
//Add imagecreatefromjpg/gif/bmp/whathaveyou...
$im    = imagecreatefrompng("images/".$arr_configoptions["imageURL"].".png"); //OR: $im    = imagecreatefrompng("images/sig".$arr_configoptions["user_ID"]".png");
//Add specific data, use configoptions to see if they are on and where and how (color, font) they are placed
//Propably something like read_file(animedb.pl?show=xml&user=username&data=data);
//find_data und put them in a variable
//print variable via imagetext or imagefttext
imagepng($im);
imagedestroy($im);

?> 

Posted: Sun Oct 22, 2006 12:19 pm
by dooly00000
XML coding, and all this idea... cool. Thing is, I'm still newbie at xml/phpbb codings... --;

I maybe able to help out on other projects or this, if it goes incomplete, when I get the hang of the coding later. I only know HTML/CSS/Javascript as of now.

Posted: Mon Oct 23, 2006 9:28 am
by exp
just added two more xml data pages for use by the sig server:

http://anidb.info/perl-bin/animedb.pl?s ... tat&uid=32

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<root>
<userstat uid="32" uname="test"><mylist>
	<acnt>24</acnt>
	<ecnt>105</ecnt>
	<fcnt>109</fcnt>
	<size>21348</size>
	<last>
	<anime aid="106" adddate="1111918024">Azumanga Daiou</anime>
	</last>
</mylist>
<anidb>
<aacnt>0</aacnt>
<eacnt>1</eacnt>
<facnt>1</facnt>
<gacnt>0</gacnt>
<independencep>0</independencep>
<leechp>99</leechp>
<revcnt>0</revcnt>
<votecnt>0</votecnt>
<totalviewedp>0</totalviewedp>
<totalownedp>0</totalownedp>
<ownviewedp>41</ownviewedp>
<viewedepcnt>44</viewedepcnt>
</anidb>
</userstat>
</root>
and

http://anidb.info/perl-bin/animedb.pl?s ... stat&aid=1

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<root>
<animestat aid="1">
	<titles>
<romaji>Seikai no Monshou</romaji><ja>星界の紋章</ja><en>Crest of the Stars</en></titles>
<eps>13</eps>
<rating>847</rating>
<votes>1556</votes>
<tmprating>738</tmprating>
<tmpvotes>63</tmpvotes>
<atts>8</atts>
<attavg>899</attavg>
<ecnt>13</ecnt>
<fcnt>312</fcnt>
<gcnt>22</gcnt>
<ucnt>1961</ucnt>
<size>63741</size>

<lastep eid="1014">
<epno epno="13">13</epno>
<name>Trouble Soaring Through Heaven</name>
<aired>922492800</aired>
<length>40</length>
<rating>833</rating>
<votes>3</votes>
<fcnt>24</fcnt>
<ucnt>1905</ucnt>
</lastep>
</animestat>
</root>
where it is possible to add additional uid and gid parameters (one or both) to get more info:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<root>
<animestat aid="1">
	<titles>
<romaji>Seikai no Monshou</romaji><ja>星界の紋章</ja><en>Crest of the Stars</en></titles>
<eps>13</eps>
<rating>847</rating>
<votes>1556</votes>
<tmprating>738</tmprating>
<tmpvotes>63</tmpvotes>
<atts>8</atts>
<attavg>899</attavg>
<ecnt>13</ecnt>
<fcnt>312</fcnt>
<gcnt>22</gcnt>
<ucnt>1961</ucnt>
<size>63741</size>

<lastep eid="1014">
	<epno epno="13">13</epno>
<name>Trouble Soaring Through Heaven</name>
<aired>922492800</aired>
<length>40</length>
<rating>833</rating>
<votes>3</votes>
<fcnt>24</fcnt>
<ucnt>1905</ucnt>
</lastep>

<mylist uid="32" uname="test">
<epcnt>2</epcnt>
<seen>0</seen>
<spepcnt>0</spepcnt>
<spseen>0</spseen>
<state id="2">on hdd</state>
</mylist>

<group gid="41" gname="Zhentarim DivX" gshortname="zx">
<rating>808</rating>
<votes>24</votes>
<atts>2</atts>
<epcnt>13</epcnt>
<sepcnt>0</sepcnt>
<changed>1134322659</changed>
<state id="3">complete</state>
<lastepno ep="13">13</lastepno>
</group>
</animestat>
</root>
hope it helps.
as always this is not tested well so there might be some random features :o)

BYe!
EXP

Posted: Mon Oct 23, 2006 1:08 pm
by Gemberkoek
I'd love it if someone could assemble a list of all possible XML tags and their meanings, of course i can find out most myself but if someone could help - onegai?

Posted: Mon Oct 23, 2006 1:54 pm
by fahrenheit
for the xml tags you can get a few pointers by reading the mylist export info

http://wiki.anidb.info/w/Mylist_export_ ... guidelines

most of the vars are the same

Posted: Mon Oct 23, 2006 6:26 pm
by Gemberkoek

Code: Select all

<?php 

//Sig server code 

include("db.php"); //Loads database 

$user_ID = $_GET["id"]; //What user do we want a sig for? 

header("Content-type: image/png"); 
if(file_exists("images/sig".$user_ID.".png"))
{
$im    = imagecreate(600,50); 
$im2    = imagecreatefrompng("images/sig".$user_ID.".png"); 
imagecopy($im,$im2,0,0,0,0,600,50);
}else{
$im     = imagecreate(600,50);
}
$white = imagecolorallocate($im, 255,255,255);
//First let's allocate some colors
$result = MySQL_QUERY("SELECT configoptions_color FROM configoptions WHERE configoptions_uid = ".$user_ID." GROUP BY configoptions_color");
while($arr_colors = MySQL_FETCH_ARRAY($result))
{
 $red = hexdec(substr($arr_colors["configoptions_color"],0,2));
 $green = hexdec(substr($arr_colors["configoptions_color"],2,2));
 $blue = hexdec(substr($arr_colors["configoptions_color"],4,2));
 $$arr_colors["configoptions_color"] = imagecolorallocate($im, $red,$green,$blue);
}
//Now let's find out what data we should look for.
$result = MySQL_QUERY("SELECT configoptions_data FROM configoptions WHERE configoptions_uid = ".$user_ID."");
while($arr_data = MySQL_FETCH_ARRAY($result))
{
while($found = strpos($arr_data["configoptions_data"],"["))
{
if($found2 = strpos($arr_data["configoptions_data"],"]",$found))
{
 
}

}
}



//Add specific data, use configoptions to see if they are on and where and how (color, font) they are placed 
//Propably something like read_file(animedb.pl?show=xml&user=username&data=data); 
//find_data und put them in a variable 
//print variable via imagetext or imagefttext 
imagepng($im); 
imagedestroy($im); 

?> 

Posted: Tue Oct 24, 2006 1:20 pm
by EvoGT
ok, seems there is no need for my script :D
Image

Posted: Tue Oct 24, 2006 1:57 pm
by Gemberkoek
I'm still working on it, any help would be greatly appreciated as i've got a school to attend to as well...