New Signature Pic feature [FEEDBACK]
Moderator: AniDB
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
ex.
http://www.fredericaspage.com/joesjunk/ ... ?u=GIJOE98
hmm... this board doesn't support dynamic urls?
JOE
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?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.
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.
yes I have.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)
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.
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.cenedra wrote:hey, man, that does look pretty nice....
but i still would like to do 'my own thing' for my sig..
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
should be max. 20 minutes of work, also not knowing nothing about the gd, there are really great tutorials around..
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.ruxkor wrote: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.cenedra wrote:hey, man, that does look pretty nice....
but i still would like to do 'my own thing' for my sig..
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
should be max. 20 minutes of work, also not knowing nothing about the gd, there are really great tutorials around..
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)
i already use a transparent pic, created from the xml and then
combine it with the bg
-
- Posts: 13
- Joined: Sun Oct 15, 2006 12:55 pm
*Steps up to the plate*
*opens mouth*
Something like this:
*opens mouth*
*closes it again and starts coding*Please either shut up and code or shut up and don't code.
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);
?>
-
- Posts: 28
- Joined: Sat Jul 29, 2006 8:10 pm
just added two more xml data pages for use by the sig server:
http://anidb.info/perl-bin/animedb.pl?s ... tat&uid=32
and
http://anidb.info/perl-bin/animedb.pl?s ... stat&aid=1
where it is possible to add additional uid and gid parameters (one or both) to get more info:
hope it helps.
as always this is not tested well so there might be some random features :o)
BYe!
EXP
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>
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>
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>
as always this is not tested well so there might be some random features :o)
BYe!
EXP
-
- Posts: 13
- Joined: Sun Oct 15, 2006 12:55 pm
-
- AniDB Staff
- Posts: 438
- Joined: Thu Apr 08, 2004 1:43 am
- Location: Portugal
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
http://wiki.anidb.info/w/Mylist_export_ ... guidelines
most of the vars are the same
-
- Posts: 13
- Joined: Sun Oct 15, 2006 12:55 pm
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);
?>
-
- Posts: 13
- Joined: Sun Oct 15, 2006 12:55 pm