'Wallpaper War' scripts/hosting - anyone interested?

For discussions, announcements, non-technical questions and anything else comics-related or otherwise that doesn't fit in any of the other categories.
Post Reply

Register your interest!

Poll ended at Sat Aug 05, 2006 9:05 am

Yes, give me scripts!
3
60%
Might be interested...
1
20%
Not intrested at all.
1
20%
 
Total votes: 5

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

'Wallpaper War' scripts/hosting - anyone interested?

Post by NotQuiteInsane »

I'm toying with the idea of writing a few 'gadget' scripts. Along the lines of voting, comic wars, donation bars, that sort of thing. Kinda like the "this month's donation goal" bars on Namir Deiter and YSIF, and the "wallpaper wars" on Shivae and DMFA.

First clarification: these scripts will be free. Always. Only rule is that if you modify the code, you make your modifications available for free. I write these scripts for free, so I'd prefer it if you didn't sell them. Also, you're pretty much on your own if you just grab the scripts and use them.

The big problem with this plan seems to be that ComicGenesis doesn't have any support for scripts. Quite frankly, I can't blame them - with the N-thousand comics hosted on Cgen, the servers must be creaking under the strain..

But I have a pair of dedicated servers doing very little at the moment - they're born-and-bred high-speed webservers (in fact, one of them has a couple of gameservers on it too). So what I'm proposing is:
  • I'll host one Wallpaper War type script for free, but there'll be a small 80x15 "hosted by X" or "free webcomic gadgets: go here" type 'bug' in the bottom-right corner. You'll get to choose what colour this bug is, so it matches your site layout and doesn't look out of place. No setting the background colour and foreground colour the same to hide it though
  • If you want the bug gone, you'll have the option of paying a very small amount to get rid of it - I'm thinking in the region of $10-$15 a year. If people prefer monthly, that's fine too.
  • I'll help you convert your images to work with the scripts. You won't get this if you just download the scripts (but they will be well-documented, I want people to be able to learn how my code works).
So what I'd really like to know before I start work on this is... Is anyone actually interested in this sort of thing?

(post approved by STrRedWolf)
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

User avatar
Warofwinds
Cartoon Hero
Posts: 1088
Joined: Sat May 08, 2004 7:46 pm
Location: Beneath stormy skies
Contact:

Post by Warofwinds »

Yes, quite. I've been wondering how to do this outside of manually updating images. 8-)
-Kez
ImageImageImage

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

Curses, the poll's broken. I put in three entries - "Yes - give me scripts!", "Maybe" and "No - not interested at all", but it seems only "Yes" and "Maybe" got through... And now there's a vote on the poll so I can't fix it. :(
Either phpBB is out to get me, or I did something stupid. Probably the latter :)

But in any case, looks like I've got some interest. Any preferences for what you'd like to see done first, warofwinds? (or anyone else for that matter)
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

User avatar
Warofwinds
Cartoon Hero
Posts: 1088
Joined: Sat May 08, 2004 7:46 pm
Location: Beneath stormy skies
Contact:

Post by Warofwinds »

First I'd like a vote poll, and then donation bars, but that's just me. What I need is the ability to make the voting "area" a certain size. Most of the free hosting places out there have only set sizes, or you have to have a certain number of choices to get a certain size, but there's not much inherent flexibility. I haven't thought too much about donation bars, it'd be for a site I work on but not my own, but it's something we're all thinking about.

But hmm, that wallpaper war script also sounds like it'd be very useful. I've always wondered how AD and Cyantia did that. :)
-Kez
ImageImageImage

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

warofwinds wrote:First I'd like a vote poll, and then donation bars, but that's just me.
That's good, polls are usually quite easy to implement. It's the ballot-stuffing protection that gets hard - you can either do 'one vote per IP' or set a cookie; neither way is foolproof. For IP address locking a disconnect/reconnect cycle is enough, and for cookies.. well, you just delete the cookie.
warofwinds wrote:What I need is the ability to make the voting "area" a certain size. Most of the free hosting places out there have only set sizes, or you have to have a certain number of choices to get a certain size, but there's not much inherent flexibility.
That's not hard. Set it up as an IFrame, then the page is generated by the remote server. Colours, etc. would be fairly easy to configure. Then, whatever size the IFrame is, the HTML adapts to fit.

The plan is to have the system based on Smarty (http://smarty.php.net/) templates, so you'd get quite a bit of configurability. Most of the configuration would be in a text file associated with the script, and the appropriate config would be loaded when the page is rendered. Smarty takes that config, merges it with the template and produces the HTML code.
warofwinds wrote:I haven't thought too much about donation bars, it'd be for a site I work on but not my own, but it's something we're all thinking about.

But hmm, that wallpaper war script also sounds like it'd be very useful. I've always wondered how AD and Cyantia did that. :)
In a way, the wallpaper war and donation bar are very similar. In fact, the code would be almost identical.
The way it generally works is:
  • There's a link on the page that goes to PayPal
  • Someone feeds a payment through via that link
  • PayPal sends a message back to the webserver to say 'Hey, this guy just gave you some money!'
  • The donation bar is marked as 'to be updated', and is updated on the next cycle (which is likely to be every ten minutes or so, depending on system load).
If you want to read up on this stuff, the keywords you want are 'Paypal' and 'IPN' (IPN = Instant Payment Notification). The trick is, you use the "seller specific data" field to say which user account the payment went to, and what the user voted for. For a straight donation bar, you just have the single bar, with a background image that marks out the targets. As part of that, you also have a little "Donated this month: $12.34" type banner at the top.

The trick is in implementing it in a way that prevents unnecessary processing. You don't want to be generating the image for every person that accesses the page, so you cache it and have a cron-job running every ten minutes to update the relevant images.
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

User avatar
Warofwinds
Cartoon Hero
Posts: 1088
Joined: Sat May 08, 2004 7:46 pm
Location: Beneath stormy skies
Contact:

Post by Warofwinds »

NotQuiteInsane wrote:
warofwinds wrote:What I need is the ability to make the voting "area" a certain size. Most of the free hosting places out there have only set sizes, or you have to have a certain number of choices to get a certain size, but there's not much inherent flexibility.
That's not hard. Set it up as an IFrame, then the page is generated by the remote server. Colours, etc. would be fairly easy to configure. Then, whatever size the IFrame is, the HTML adapts to fit.
Hadn't thought of that! Good idea!
NotQuiteInsane wrote: The plan is to have the system based on Smarty (http://smarty.php.net/) templates, so you'd get quite a bit of configurability. Most of the configuration would be in a text file associated with the script, and the appropriate config would be loaded when the page is rendered. Smarty takes that config, merges it with the template and produces the HTML code.
Interesting! So the text file would be in the site's FTP and not remote?
NotQuiteInsane wrote:
warofwinds wrote:I haven't thought too much about donation bars, it'd be for a site I work on but not my own, but it's something we're all thinking about.

But hmm, that wallpaper war script also sounds like it'd be very useful. I've always wondered how AD and Cyantia did that. :)
In a way, the wallpaper war and donation bar are very similar. In fact, the code would be almost identical.
The way it generally works is:
  • There's a link on the page that goes to PayPal
  • Someone feeds a payment through via that link
  • PayPal sends a message back to the webserver to say 'Hey, this guy just gave you some money!'
  • The donation bar is marked as 'to be updated', and is updated on the next cycle (which is likely to be every ten minutes or so, depending on system load).
If you want to read up on this stuff, the keywords you want are 'Paypal' and 'IPN' (IPN = Instant Payment Notification). The trick is, you use the "seller specific data" field to say which user account the payment went to, and what the user voted for. For a straight donation bar, you just have the single bar, with a background image that marks out the targets. As part of that, you also have a little "Donated this month: $12.34" type banner at the top.

The trick is in implementing it in a way that prevents unnecessary processing. You don't want to be generating the image for every person that accesses the page, so you cache it and have a cron-job running every ten minutes to update the relevant images.
...I have no idea what you just said :lol: Thou be speaking a different languge, fo'! hehehe. Suffice it to say, you know far more on the subject than I. :D
-Kez
ImageImageImage

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

warofwinds wrote:
NotQuiteInsane wrote:That's not hard. Set it up as an IFrame, then the page is generated by the remote server. Colours, etc. would be fairly easy to configure. Then, whatever size the IFrame is, the HTML adapts to fit.
Hadn't thought of that! Good idea!
The problem would be getting the histogram bars to fit. OTOH, I might be able to use HTML tables to do that -- I'll have a play around in a bit.
warofwinds wrote:Interesting! So the text file would be in the site's FTP and not remote?
What you'd do is log into the admin panel, then upload your template. If you wanted to have background images, etc., you'd have to host them on something like Photobucket.

In this way, you could make the poll fit in with your site layout. Instead of having a textual title, you could have an image instead. Or you could make the poll script generate Javascript code suitable for inlining into the HTML (instead of using an IFrame). The possibilities are pretty much endless.
warofwinds wrote: ...I have no idea what you just said :lol: Thou be speaking a different languge, fo'! hehehe. Suffice it to say, you know far more on the subject than I. :D
Well to put it simply, someone clicks the button, pays some money, and Paypal tells the script that money has been transferred. You can either update the donation-bar image as soon as some money is received, or update it every N minutes (assuming the 'image needs updating' flag is set). 'Every N minutes' is usually better - it reduces the load on the server (among other things).

When it's done, there will be a 'cute little webadmin panel' where you can configure all this stuff. Just 'cos it's easier than you emailing me every month or so to get me to change the poll :)
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

OK, I've got the first version of the polling script up:
http://executor.castlecore.com/~philpem ... fo=philpem
It's just a test at the moment (I still need to do the admin interface), but you can get some idea how it behaves.

'Scuse the subject of the poll, I kinda ran out of ideas :)

It's all based on tables, so it'll adapt to pretty much any size of Iframe you want. You can change almost everything about it - background colour, text colour, error message background/text colour, poll title background/text colour, bar colour / blank space colour, visited/active/inactive link colours, and so on.

The protection against repeat-voting is a bit weak, but as long as you're not using this thing to do the next US Presidential Election or anything like that, it should be fine.

When it's done, the poll URLs will likely be something along the lines of 'http://gadgets.castlecore.com/poll/username/poll-ID'. I hate long, unfriendly URLs with lots of question marks and '&' symbols - only reason it's like that now is because it's sitting on the development server and I'm too lazy to write a mod_rewrite rule for it :)

Thanks.
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

User avatar
Warofwinds
Cartoon Hero
Posts: 1088
Joined: Sat May 08, 2004 7:46 pm
Location: Beneath stormy skies
Contact:

Post by Warofwinds »

Hmm, who shall I vote for? hehehe

Question: are dropdown vote choices possible along with, or as an alternative to, the scrolling iframe?

Looking great so far!
-Kez
ImageImageImage

User avatar
STrRedWolf
Confuzzled CG Admin
Confuzzled CG Admin
Posts: 2579
Joined: Fri Jan 01, 1999 4:00 pm
Location: undef;
Contact:

Post by STrRedWolf »

Fixed the forum poll. It's worth it anyway.
Kelly "STrRedWolf" Price
Admin, Comic Genesis
Artist/Writer, Stalag '99 (WolfSkunks and Drygers, oh my!)
I NEED MORE TIME, CAPTIN!

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

warofwinds wrote:Question: are dropdown vote choices possible along with, or as an alternative to, the scrolling iframe?
I can't see why not. HTML radio-button and drop-down form fields all send the same data back to the server, so it's really just a template change and another line or two of code to switch between the templates.

I'm also going to add a "Vote!" link on the results page, but it will only appear if the viewer hasn't already voted. You can also opt to stop people voting after they've seen the results. Dunno if you wanted that, but it's there anyway.

EDIT: warofwinds, is this the sort of thing you wanted?

If you want to see the option selector, you'll have to delete the cookie. In Firefox, go into Tools -> Options -> Privacy -> Cookies -> View Cookies. Search for 'poll-philpem-1' and delete the cookie. I did say the multiple-vote protection was weak!

I've also turned "can vote after viewing results" back on. Which means you can see the 'go back and vote' link on the results page now, but only if you haven't voted already.
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

User avatar
Warofwinds
Cartoon Hero
Posts: 1088
Joined: Sat May 08, 2004 7:46 pm
Location: Beneath stormy skies
Contact:

Post by Warofwinds »

yes indeedy! That's it exactly! And did you mention somewhere that bg colors/etc could be changed in the admin section? Could images also be inserted as a bg?

Thanks for spending so much time on this, and how/where would I go about making an account?
-Kez
ImageImageImage

NotQuiteInsane
Regular Poster
Posts: 44
Joined: Sat May 06, 2006 3:51 am

Post by NotQuiteInsane »

warofwinds wrote:yes indeedy! That's it exactly! And did you mention somewhere that bg colors/etc could be changed in the admin section? Could images also be inserted as a bg?
Oh, you mean like this?
:)
warofwinds wrote:Thanks for spending so much time on this
Time? What time? Oh. The 48 hours of coding and templating.. Well, if I remove sleep, and other such things it's only eight hours, but still.. :)
warofwinds wrote:how/where would I go about making an account?
The admin stuff isn't quite done yet (understatement of the century). I've only just gotten the admin framework installed, and now I have to write the poll-management and user-management plugins for that. I'm hoping to get that up and running by this time tomorrow. As it stands, it's now 1:09AM here so I'm off to bed!
- NQI
"This is the way the world ends, not with a bang but a whimper." - T. S. Eliot

Post Reply