News:

It's a bad decade to be bipedal, soft and unarmed.

Main Menu

Discordia Cards

Started by NotPublished, January 12, 2010, 07:40:30 AM

Previous topic - Next topic

NotPublished

Ok updated the site

1) Added Text wrap, so you don't have to worry soo much about pushing enter (as long as the word has a space!) [But now you've lost ability to change font-size. Maybe I'll make some fonts later on]

2) Fixed up image resize, its now ratio based ... haven't tested it properly yet so if it acts funky gimme a heads up.

3) Made the Yugi-Oh card description area bigger

- Gonna work on different card templates now

Quote
Discardians

Hmm I can go with that :D
In Soviet Russia, sins died for Jesus.

Mesozoic Mister Nigel

This is completely fucking awesome.
"I'm guessing it was January 2007, a meeting in Bethesda, we got a bag of bees and just started smashing them on the desk," Charles Wick said. "It was very complicated."


BabylonHoruv

You're a special case, Babylon.  You are offensive even when you don't post.

Merely by being alive, you make everyone just a little more miserable

-Dok Howl

Triple Zero

Quote from: NotPublished on January 12, 2010, 04:42:32 PM
I was wondering if I could upload directly to imageshack and you just brought it to me :D (That code is a keeper btw!)

awesome! it doesn't really get much easier than 2 lines of code huh :D

Quoteeta: Damn! Looks like they are just doing a regex and inserts into all <body> tags :(

bitches!!

and judging from the change in http://notpublished.ulmb.com/card/card.php it also triggers when there are no <body> elements at all! which is odd because how does it distinguish when PHP generates an image which would get botched if you insert code ..

oh well, we can't let this happen.


    <head>
        <link href="css/reset.css" rel="stylesheet" type="text/css" />
        <link href="css/main.css" rel="stylesheet" type="text/css" />
    </head>
    <script>
        /*
        <body>
        */
        document.write('<bo' + 'dy>');
    </script>


<head> section remains as it was, then comes a <script> tag which has a commented /*<body>*/ tag in it to trigger the regex script, BUT THEN the real <body> tag is written using JavaScript as a string split into two parts so it doesn't trigger the advertisement-rewrite regex. Because JavaScript is executed only clientside.

does that work?
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

Triple Zero

... of course we could also find a better free webhost, but even if we did, we'd still have to solve this puzzle right :)
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

NotPublished

#20
The images are already generated via PHP,

header('Content-type: image/png');

That seems to of stopped it from intruding on the file.

Though that seems like alot of effort to avoid the reg-ex :) If its not intruding I guess theres no harm .. or I could just find out what functions are being called in the inserted script and just declare them earlier

Though for a free-webhost its pretty impressive, 500 GB worth of bandwidth a month!
In Soviet Russia, sins died for Jesus.

NotPublished

Ok sweet, now you can change the card template with a drop down menu. Gonna work on that imageshack uploader thing and I think thats enough for now. Wonder how that will go hehe
In Soviet Russia, sins died for Jesus.

LMNO

Hey, what the hell is that pop-up ad all about, anyway?

NotPublished

#23
Are you getting pop ups?

The host is inserting a line into the <body> tag

<script src="/.system/insert.php" type="text/javascript"/>


But I just checked with Firefox Firebug and it just says -

Failed to load source for: http://notpublished.ulmb.com/.system/insert.php

by the looks of it - it isn't working.

Thought it might be intrustive to the php generated image, but not getting any errors so far thankfully. Guess I'll just let it be for now

edit: Actually, 000 - Your a genius! I didn't realise it at the time but what you wrote makes perfect sense. I'll try it


       <link href="css/reset.css" rel="stylesheet" type="text/css" />
       <link href="css/main.css" rel="stylesheet" type="text/css" />
   </head>
   <script>
       /*
       <body>
<!-- Begin Free Hosting Code Insert -->
<script type="text/javascript" src="/.system/insert.php"></script>
<!-- End Free Hosting Code Insert -->

       */
       document.write('<bo' + 'dy>');
   </script>
       <div id="mainbody">

:lulz:

With the ImageShack upload code, its returning

"SimmpleXMLElement Object ( [error] => http://notpublished.ulmb.com/card/bg.png has no video content ) "

Looks like gotta find the right switch

hxxp://www.rohitab.com/discuss/index.php?showtopic=29759 - found this link will try the code from that.

EPIC! The code works, just gotta parse the response - then I'll upload the current version.

Quote
HTTP/1.1 302 Moved Temporarily Server: nginx/0.7.64 Date: Tue, 12 Jan 2010 21:37:58 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: close X-Powered-By: PHP/5.2.9 Set-Cookie: new_imageshack=y; expires=Thu, 21-Nov-2019 21:37:58 GMT; path=/; domain=.imageshack.us Set-Cookie: PHPSESSID=56c1d001fb0cdca20bb81462fdb8d52c; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: imgshck=56c1d001fb0cdca20bb81462fdb8d52c; expires=Fri, 07-Jan-2011 21:37:58 GMT; path=/; domain=.imageshack.us Set-Cookie: un_cookie=1; expires=Wed, 13-Jan-2010 21:37:58 GMT; path=/; domain=.imageshack.us Set-Cookie: latest=img51; expires=Fri, 07-Jan-2011 21:37:58 GMT; path=/; domain=.imageshack.us Set-Cookie: conversion=deleted; expires=Mon, 12-Jan-2009 21:37:57 GMT; path=/; domain=.imageshack.us Set-Cookie: always_opt=-1; path=/; domain=.imageshack.us Set-Cookie: rem_bar=-1; path=/; domain=.imageshack.us location: http://img51.imageshack.us/content_round.php?page=done&l=img51/8669/2122800000.png Set-Cookie: is_uuid=e124fafa9f0b4aafbaa3aa009064f58a; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=.imageshack.us; path=/ P3P: CP="NOI CUR ADM OUR NOR STA NID" X-Server-Name-And-Port: _:14000

It returns that (Bolded part is what I want to retrieve)

http://img51.imageshack.us/content_round.php?page=done&l=img51/8669/2122800000.png


http\://[a-zA-Z0-9./?&_\-=]*

That will be the regex, if anyone knows anything better please share ! :)
In Soviet Russia, sins died for Jesus.

NotPublished

#24
Ok sweet, you can now upload directly to Image Shack :)

It provides you with the link; I just tested it.
http://img191.imageshack.us/content_round.php?page=done&l=img191/1971/113152054800000.png


Its a start atleast, I think I can try get the server to view the page then attempt to grab the direct link for itself :)

I think the next step will be to choose between URL or upload from your computer.

Anyhow with the changes
- You can now select your resize method. Whether it is Ratio or Stretch based. With Ratio it will keep it 'nice' looking where as stretch will just force it to a certain width/height, the only problem with ratio is that there will be a black space
- If you wish to upload the image to ImageShack please make sure you check the upload to image shack box (Kinda realising its useless hahaha I suppose I could just let people hotlink from the free server aye?) - I'll provide a link to use it from the freehost to ... haha very redundant.
In Soviet Russia, sins died for Jesus.

Mesozoic Mister Nigel

Is not working for me. :(*
"I'm guessing it was January 2007, a meeting in Bethesda, we got a bag of bees and just started smashing them on the desk," Charles Wick said. "It was very complicated."


NotPublished

#26
Whats it say?

It could be that the filesize is large, I should put a warning up - there is no progress bar on your upload progress :)
In Soviet Russia, sins died for Jesus.

The Good Reverend Roger

Quote from: NotPublished on January 12, 2010, 07:40:30 AM
I didn't know where to post this,

Anyhow I spent 30 minutes writting up a PHP application (heres the source)
It obviously needs some refinement with things like image resizing and other stuff.

Here you can make them to -
http://notpublished.ulmb.com/card/ - Card generator in website style
http://notpublished.ulmb.com/card/card.php - card generator - without website

IF anyone wants to offer up hosting I will gladly take that up, otherwise I'll keep it here.
If anyone wants to add their own things to it (Or even take over the programming side) feel free - otherwise if there are any suggestions to add to it; feel free to post and I'll get around to it.


So here is an example I made using it -


... Wasn't in a creative mood unfortunantely :P I'm sure someone can come up with something

Latest source version : 20100112

Future plans :

- Store create images and provide link to use
- Provide alternate card layouts
- Fix up resize formula for the 2nd image

Any ideas, suggest away!

FUCKING THING DOES NOT WORK.  I CANNOT SAVE MY CARD.

FUCK THIS, I WILL DO IT MYSELF.
" It's just that Depeche Mode were a bunch of optimistic loveburgers."
- TGRR, shaming himself forever, 7/8/2017

"Billy, when I say that ethics is our number one priority and safety is also our number one priority, you should take that to mean exactly what I said. Also quality. That's our number one priority as well. Don't look at me that way, you're in the corporate world now and this is how it works."
- TGRR, raising the bar at work.

Mesozoic Mister Nigel

Quote from: NotPublished on January 12, 2010, 10:07:42 PM
Whats it say?

I forget. Some error message when I tried to save it.
"I'm guessing it was January 2007, a meeting in Bethesda, we got a bag of bees and just started smashing them on the desk," Charles Wick said. "It was very complicated."


NotPublished

Ohhh OOPS I forget to add a semicolon when I rushed.

Ok now its good  :lulz:
In Soviet Russia, sins died for Jesus.