PDA

View Full Version : Who could program the following...?


Matrix
15-03-2004, 23:27
ProPain and I have been thinking about a solution to PBEM's that get stuck. Very simple: A Perl/CGI/PHP file with which you can add text to a text file.
On principle you only need a text One-Line Text Box, but better would be something like:
http://www.straland.com/junk/PBEMsolution.gif
As a result you add a line to a text file like: Matrix | 90 BC | 06-03-2004 17:41

Whenever someone has played that game, he only has to go to that page and fill it in.

So it's just a .txt and a .php. Would anyone here be able to make this? I really think it'll help a lot. I would do it myself, but my knowledge concerning Perl is insufficient. And PHP is totally unknown to me.

anarres
16-03-2004, 11:40
I can do it, but using ASP not PHP...

Matrix
16-03-2004, 11:50
Like I care! (ASP or PHP)

That would be great, anarres! :D

anarres
16-03-2004, 11:54
OK, will try to get time to look at it at lunch.

anarres
16-03-2004, 12:34
BTW - you know that some web servers (unix based) won't do ASP? Also that some web servers (windows based) won't do PHP?

Matrix
16-03-2004, 16:59
It doesn't say ASP is supported on my server provider's homepage. :( It's Unix based.

But this won't take a lot of space; isn't there anyone else who's got Windows based webspace to share? [confused]

anarres
16-03-2004, 17:06
We do ;)

I was going to suggest it anyway...

Matrix
16-03-2004, 17:35
Cool! [goodjob]

WildFire
16-03-2004, 22:47
Do any of you "work" during work?

Matrix
22-04-2004, 15:33
Any luck, anarres? [mischief]

ProPain
22-04-2004, 17:46
quote:Originally posted by WildFire

Do any of you "work" during work?

Preferably not [lol]b

anarres
22-04-2004, 18:33
Hmm, this fell of my radar Matrix - I will find time this weekend if possible. :)

Please remind me again if I forget, I'm not very good at remembering...

Beam
22-04-2004, 20:08
Old fashioned way of reminding a stalled PBEM mister ;)

Matrix
28-04-2004, 16:22
quote:Originally posted by anarres

Please remind me again if I forget, I'm not very good at remembering...
Ok. [tongue]

Or am I too fast?

anarres
28-04-2004, 16:32
Well, only by a lightyear. :(

Work deadlines are getting worse, and my deadlines for doing stuff at home are no better (i.e. working late on weeknights and maybe weekends, and then working on house when free at weekends).

It could be some time (a month or so) before I can look at this. OTOH, I could find an afternoon free one weekend in the next couple of weeks or so, it's just impossible to tell atm...

Skyfish
28-04-2004, 16:37
Poor baby [cry]
All this work to prepare the next CDZ reunion... :D

Matrix
28-04-2004, 23:16
Sure anarres. I'll ask no longer then.

anarres
29-04-2004, 01:04
I am happy to do this when I can fit it in, and I have no problem with you asking. I just feel bad I can't do it now...

Matrix
16-05-2004, 16:42
Now that all the commotion is over, do you think you'll have time for it this week?

anarres
16-05-2004, 17:34
Some of the commotion is over. ;)

Work is very bad atm (I work 45 hour weeks minimum and somtimes weekends on top, and all holidays are cancelled). Unfortunately the work situation is likely to last until at least July. :(

Also it is DIY season atm and the house is taking much of my time. I will however do my best to fit it in soon. :)

ViperDC
22-05-2004, 02:59
I can program it in PHP if you'd like. But, I'm not a regular at this forum, so if you want me to, email me or use another form of contact from my profile and we can talk about what you need exactly.

Matrix
26-07-2004, 13:52
May was such a busy month for me I can't even remember if I ever contacted ViperDC. http://www.straland.com/images/smilies/embarassed.gif I believe not, though. Anarres, do you have time for it in the near future? I'd like to ask you first before asking someone with one post. http://www.straland.com/images/smilies/modest.gif

smalltalk
03-08-2004, 17:25
Upgraded to Wamp 5.1.1 today, so I had a look into this.

Check it out - and test for bugs at:

http://212.227.42.12/turntrack/

- haven't entered any real Players' name yet. Gimme a list - or enter it yourself in append.php - should be quite straightforward.
- haven't entered turn years. (Too lazy to add 540 turn-dates into a drop-down.) So this has to be done manually.
- haven't bothered with text-formatting, page-title etc...
- Line-breaks in the resulting txt-file are unix-style.

Here's a zip-file with:

index.php
append.php
turns.txt

Download Attachment: icon_paperclip.gif turntrack.zip (http://www.civ3duelzone.com/forum/uploaded/smalltalk/200483171940_turntrack.zip)
1.77*KB

Drop the files into one directory and link to the index.php.

Matrix
03-08-2004, 18:26
Smalltalk!! You're da man!! :D It works perfectly. I've already adapted it for DDPP. Look:
http://www.straland.com/turntracker/
http://www.straland.com/turntracker/turns.txt

I've also changed the time format.
By the way, player names should be changed in index.php, not append.php.
I'll play with it now, making it easiest to use.
Thanks man! [yeah]

Matrix
03-08-2004, 19:26
Done. Please, check it out! ;)
http://www.straland.com/turntracker/

smalltalk
03-08-2004, 20:14
Looks nice!

Maybe there should also be a possibility to add some comment, gossip, a snide remark or whatever in a text box?

ProPain
03-08-2004, 21:18
That seriously rules!!! Now how can we set it up for different games?

Matrix
03-08-2004, 22:53
I could try that, ProPain. ;) I can't really program in PHP, but I've seen it a lot and have programmed a lot in Pascal, so with copying and pasting and using a bit common programming sense I might actually manage...

Matrix
03-08-2004, 23:28
I got how to do it. :) Only need to finish it...

Matrix
04-08-2004, 00:04
I did it!! [dance] People from Swimming Pool can also use it! :D I could add Digger's 8 player game as well...

So again, the url is:
http://www.straland.com/turntracker/
But if you want to go to Swimming Pool directly, you can go to:
http://www.straland.com/turntracker/swimmingpool.php

Matrix
04-08-2004, 18:36
I added Digger's 8 player game and Tiny Chaos II, since that is stalled quite often as well.

The first drop-down menu's purpose is simply to go another input form; every game actually has it's own URL, but they all use the same append.php. The only pitiful thing is that if I want to add another game, I have to change the first drop-down menu in all the input files (ddpp.php, swimmingpool.php, etc). But then again, it still takes one minute. :)

I hope to see it in action soon!

anarres
04-08-2004, 21:06
Thanks to smalltalk for the hard graft, and thanks to Matrix for pestering me until someone else did it. [goodjob]

anarres
04-08-2004, 21:13
Do you mind if I set it up to run at CDZ? Not sure we support php by default, but I am sure I can do something about it.

Matrix
04-08-2004, 23:33
Sure, but that would mean you have to make eventual changes, yet I'd be happy to keep that task.

digger760
06-08-2004, 11:28
is it possible to add an email notifier to it...ie when a game is updated everybody in the game is emailed that the turn has been sent.

Plux
06-08-2004, 11:41
This comes close to this idea I have been having for quite some time now, to create a turn tracker attached to a mailserver, where everybody can send the saves to and the saves are automatically send to the next player. If the player hasn't returned the save for one or two days (or whatever amount) he/she is subjected to a massive storm of SPAM-mails saying that he should hurry with playing the turn. Something like that :)

Too bad I don't have the skills yet to make this nor the time to learn them :(

anarres
06-08-2004, 14:47
Hmm. I think we can use the mailserver with the website to do that!

smalltalk
06-08-2004, 18:19
quote:Originally posted by digger760

is it possible to add an email notifier to it...ie when a game is updated everybody in the game is emailed that the turn has been sent.

I guess it is. I'll have a look at it next week.

But why notify all and not just the next player in queue?

About sending saves: easiest would be to have an upload button and then to send the uploaded save as an attachment to the notification.

Matrix
06-08-2004, 19:56
Personally I think it's fine the way it is now. An e-mail notification that it's your turn is silly, since you get the savegame by e-mail. And a notification for when the game is sent through but not to you...could be optional, but personally I'd hate to get those. [sad] I'd rather check the turn tracker myself whenever I wonder where the savegame is.

And uploading the savegames would be a waste of server space. E-mail is much more efficient.

digger760
09-08-2004, 08:58
Well being the starter of a few group emails...and the turn goes missing generally nobody chases it up but me, which i am getting tired of doing...thankfully Markstar is a good sav chaser..but i am sure he'll get sick of it to.

I guess some people dont like those emails..an if it were optional then it would be even better.

Markstar
09-08-2004, 13:41
Alright, used the TurnTracker for the first time, hope I did everything right. One just has to remember that the last person who made an entry is usually not the person who has it.

An extra field for comments would be nice (so you don't have to crunch it in with the turn #). ;)

smalltalk
11-08-2004, 19:54
Matrix, sending two e-mails would indeed be sort of a waste of resources.

About efficiency: I guess the way it is done now is like this?

- start e-mail-client
- create new e-mail
- fill in recipient, about-box, attach save-file
- send mail
- go online to turn-tracker
- submit your turn

I thought about this procedure:

- go online to turn-tracker
- select your player's name
- attach your save-file
- hit submit, save-file plus notification is sent to next player. save-file is deleted on server.

(Provided that the next player's email-adress is added beforehand in index.php/player-drop-down like

player1;player2@civ3duelzone.come

)

Matrix
11-08-2004, 21:11
That is a very good suggestion, smalltalk! :)

Eh, care to write it? [mischief] [blush]

smalltalk
12-08-2004, 16:30
Just had a look into the php5-manual. There is still no built-in attachment capability. :(

But there are some scripts and classes available for this task on the net. :)

I'll see if I can get it running, but it might take a while - I hope to do a trip to Berlin next week. [party]

Lt. Killer M
12-08-2004, 16:58
until then, can we now get that quicklink, anarres?

please!

digger760
13-08-2004, 10:55
I have been dabbling into Win32 Gui's and perl and think that i can write an executable that can email stuff. Except i dont know how i would update the turn traker at this stage..plus i dont know when i will find the time to do it...at the moment it has a basic tech calc for the ISDG game..i was thinking of adding all sorts of stuff like PP's Military Analyser, Save File emailer...any other usefull stuff all under the same hood.....someday.

Matrix
13-08-2004, 12:55
Ainwood, GOTM admin, has a PHP file with which he can send files to an e-mail address! [yeah] It's on the GOTM submission page. I'll ask him if he'd like to send it to me.

I've made a few tweaks:
- After submission the link "Back" goes to the list you submitted for, not only DDPP.
- The iframe, where you can see the text file, is bigger.
- I've put the date in front, so that people may put as much text in the the textbox as possible, though I think 255 characters is maximum. It'll all stay in one line though too, but this way date & username (which don't vary in length) are always visible and neatly in line.

Markstar
13-08-2004, 12:59
Cool! [goodjob]

Matrix
14-08-2004, 23:49
Here are a couple of e-mails...
quote:From: Matrix
To: ainwood
13-08-2004 13:00 GMT

Hi, ainwood!

We've made a sort of turn tracker for PBEM's, so that we can keep each other
up to date as to where the savegame is if it concerns more than two players.
But we're trying to extend it's usefulness and like to send savegames to the
next player with it. Therefore I was wondering if you'd like to send me the
submission page of the GOTM, because we don't know how to manage attachments
of e-mails by PHP.

The turn tracker (in case you're interested):
http://www.straland.com/turntracker/

Kind regards,
Matrix
quote:From: ainwood
To: Matrix, AlanH
14-08-2004 05:11 GMT

Matrix,

I would, but its not really mine to give away! Also, it doesn't actually
send e-mail attachments, so it probably isn't much use, because its more
about getting players scores etc out.

I've copied Alan on this, because he's our php guru (I don't know anythng
about php at all) - he might be able to help you. Also, the SGOTM upload
form might be more useful for you (it records latest saves etc), and
that's Alans baby. Otherwise, try Aeson, who wrote the original upload
scripts.

Cheers,
ainwood
quote:From: Matrix
To: ainwood
14-08-2004 10:35 GMT

Ok, thanks.

Matrix
quote:From: AlanH
To: Matrix
14-08-2004 22:05 GMT

Hi Matrix

As Ainwood says, the GOTM submission mechanism doesn't use email for
file transmission in either direction. I could probably figure out how
to do that if you like, but our Succession Game of the Month (SGOTM)
system may be worth looking at as an alternative approach. It would not
be a PBEM system any more - maybe PVWS (Play Via Web Site) - but I
think it's a better system anyway, as email was never intended to be
used for binary file transfers and does it rather inefficiently.

If your tracker web server can run PHP scripts and a MySQL database
then we could set something up to work like the SGOTM system. Have a
look at what we've done ...

The SGOTM file upload form is at
http://gotm.civfanatics.net/submit/sgotm.php. This would require slight
changes for you as we extract the SGOTM game identity from the save
file. The status list of the games with their current downloads is at
http://gotm.civfanatics.net/submit/sgotm_submission_list.php. This is
more complex than you need, as it scores the games and provides
comparative graphical and listing information across competing games.
This system has now handled over 700 files in five months, all of which
are still available for download using the status page.

You could further adapt the system to prompt the next player after a
file is uploaded, by sending an automatic email. The email could
contain the download link for the file.

Let me know what you think.

-- AlanH
quote:From: Matrix
To: AlanH
14-08-2004 23:39 GMT

It's very interesting! But I do think everyone will prefer the games to be
e-mailed. Even if e-mailing is not intended to send binary files, it works,
and it won't use extra precious server space.

So can a .php file tell from the savegame what date it is?!?

Anyway, ideally, a player should go to the turn tracker site, choose what
game he's playing, choose his nickname and upload the savegame which belongs
to the next player. The site should then e-mail the savegame to the next
player, and update an online file which then says he just submitted the game
at in-game date and the real date.

Since you don't have a .php file to send e-mails with attachments, I'll have
to trust on smalltalk, the one who made our current turn tracker, to find
one that does. So the only thing I would need from you is to know how you
can get the date of the game from a savegame, if that's possible. Perhaps
you could send the .php file (or a simplified one) that does that? Or is it
confidential?

Thanks for your help so far, Alan. It's much appreciated! :-D

Kind regards,
Matrix

Matrix
15-08-2004, 11:13
quote:> > So can a .php file tell from the savegame what date it is?!?
>
> Yes. we extract a lot of information from the save file at upload time,
> including date, score, Jason score, game status -
> incomplete/victory/defeat, victory condition, winning civ, player civ,
> game ID ... you see some of this when you upload a file to the GOTM
> page.

That's amazing. You're a real pro, Alan. My compliments!

> > Anyway, ideally, a player should go to the turn tracker site, choose what
> > game he's playing, choose his nickname and upload the savegame which belongs
> > to the next player. The site should then e-mail the savegame to the next
> > player, and update an online file which then says he just submitted the game
> > at in-game date and the real date.
>
> I notice that the sequence of entries in the list on your site does not
> match the player sequence in the popup menu. How is the next player
> chosen?
> Where would you store the game and player names, file dates, email
> addresses etc? Writing to text files directly from a PHP script will be
> a problem if the web server is set up in safe mode, which it should be.
> I can't write to text files on the GOTM server for this reason, and we
> use mysql to save all dynamic information.

Not everyone submits an entry after (s)he played the game. Currently it's an extra handling.

The first drop-down menu are links to different .php files.
The second drop-down menu is made manually by me.
The text box is straight forward.
When hitting submit, a file called "append.php" appends the current date, the player's name and what is filled in in the text box to the appropriate file. (When it's submitted from ddpp.php, then it's added to ddpp.txt.)

So apparently the security level of my server is smaller. Besides, I can only have one MySQL database, unless I want to pay more! (Or can that be overcome by suffixes or something?)

> > Since you don't have a .php file to send e-mails with attachments, I'll have
> > to trust on smalltalk, the one who made our current turn tracker, to find
> > one that does.
>
> That's not difficult, it's an hour or two of coding and testing. You
> would use the mail() PHP command and give it the uploaded file data in
> base64_encode format, with a set of headers to identify it as an
> attached file.

Ok. I'll pass it on to smalltalk. If he doesn't find it - but I'm sure he can - I'll get back to you.

> > So the only thing I would need from you is to know how you
> > can get the date of the game from a savegame, if that's possible. Perhaps
> > you could send the .php file (or a simplified one) that does that? Or is it
> > confidential?
>
> Extracting that information takes quite some time, particularly with
> C3C files. I don't think it's worth putting all that code into your
> application just to extract the date. The player can easily enter it as
> is done at the moment. If you use ZIP files my code won't work anyway.

Ok. Well, in that case I guess that's it. I'll send you the two .php files, so you can see exactly how it works, in case you're interested. But for now I think we won't need anything from you anymore. Still, thanks for your time and the co-brainstorming.

Kind regards,
Maarten "Matrix"

Smalltalk, I guess it's your move.

smalltalk
15-08-2004, 17:56
Bookmarked a few scripts last week. Two looked quite promising, one short and simple, the other with lots of features, but heavily wrapped in html.

ProPain
16-08-2004, 08:25
If needed I can provide a MySql database for free. We have several and are not using all atm.

smalltalk
19-08-2004, 17:24
The attachment-function seems to work, except for some error-handling tweaks.

Have a look at http://212.227.42.12/turntrack/

Matrix, maybe you could mail/PM me your changed files, so I can merge the stuff sometime next week. :)

About MySQL: a database approach would offer much more flexibility - but for the task at hand, I'm not sure if it is a bit of an overkill. The only immedate advantages I see are:

- if turns.txt gets longer and longer, one will have to scroll down quite a long file, while with SQL you could only display say the last 20 submitts.
- different games could be handled with one script - no need to set up different directories.

[ponder]

Matrix
19-08-2004, 19:10
It works! [yeah]

I PM'ed the changes to you. Will you combine them?

I too have the feeling a MySQL database would be an overkill.

smalltalk
19-08-2004, 19:47
Maybe it would be best to have the mail modul as a seperate include-file, so it does not have to be copy/pasted in every Game-File.

Oh, and perhaps there should also be a forced redirect to the submitting page in case of success? Is there still a need to refresh the page after submitting?

Matrix
19-08-2004, 21:11
quote:Originally posted by smalltalk

Maybe it would be best to have the mail modul as a seperate include-file, so it does not have to be copy/pasted in every Game-File.
Be my guest. How?
quote:Originally posted by smalltalk

Oh, and perhaps there should also be a forced redirect to the submitting page in case of success?
Good idea!
quote:Originally posted by smalltalk

Is there still a need to refresh the page after submitting?Yes. Any idea how to prevend that?

Pastorius
19-08-2004, 22:40
Ahem...over at gogf.tk we are also working on setting up something similar to the turn tracker
Dunno if we will use php or perl, but we wont go into such complex features as you use here, we would stick to something similar to the first version smalltalk made. (This may be because we cant seem to get any pbem playing done over there...)
if we get it right, we ll use it to handle succession games and contest submissions there...at least that is what we are discussing at the moment

vbraun is making the stuff, I think. Dont know how much knowledge he has of cgi languages, but he is the only one with programming skills I think.

I just wanted to say thanks for the good idea.

Matrix
20-08-2004, 10:51
Good luck! :)

smalltalk
26-08-2004, 21:15
Managed to merge the text-file writing and the mailing stuff - but introduced some new errors due to general clumsiness.

Expect more next week.

Matrix
26-08-2004, 23:34
Sure. I don't have time until monday anyway. ;)
And I'm already very grateful you're taking this up in the first place. [goodjob]

smalltalk
27-08-2004, 11:34
It's working again. [^]

smalltalk
02-09-2004, 17:26
The stuff can be seen at:

http://212.227.42.12/turntrack/game1.php

Please note, that the target address is one of my e-mail accounts, so you'll never get a reply.


Here are the files:
icon_paperclip.gif files.zip (http://www.civ3duelzone.com/forum/uploaded/smalltalk/200492172242_files.zip)
7.33KB


game1.php, game2.php

- Replace the name of the files with the actual game names like in the games-dropdown.
- The player nicks and the email adress of the next player in queue has to be entered in the player drop-down like:

quote:
<option value="Player1;player2@server.com">Player #1</option>


- I introduced a table to align the various elements, and added a CSS-class called std ('Standard') so that no font tags are needed in the table cells.
- added some meta-tags to enforce a reloading of the page, ignoring local and proxy-cache.



game1.txt, game2.txt

hold the submitted messages



append.php

- currently, the script exits, when sending an e-mail failed. You might want to delete this -
it shouldn't be mandatory to upload a file. (Or maybe there should be a checkbox to disable the file upload?)

- added a meta-tag to automatically redirect back to the submitting page after 5 seconds.
- game name is now part of e-mail subject.


send_attachment.php

- this does the e-mail-sending stuff


config.php

- contains some constants like maximum upload file size, max. script time, sender e-mail-adress
and a list of file-extensions not allowed to upload.


****


One strange thing: the reload works when I run the page locally, but it doesn't work on the web.

Please report how it behaves for you/with your browser.
I guess, there is a possiblity to include the turns-file with php and not in an iframe, which should avoid any caching problems.

Matrix
03-09-2004, 23:57
Thanks again, smalltalk. :)

Unfortunately now I am aquite busy lately, so please don't expect me to update everything soon. I'll do so as soon as possible...

smalltalk
05-09-2004, 19:03
(I surly won't be the one nagging you. [mischief])

In fact I think, I should have another look at the stuff and make the upload optional and try to get the reload working.

smalltalk
16-09-2004, 19:25
- added a check box to make the upload optional
- game.txt now gets included in the game.php file, so there is no caching problem. (Left the original iframe-tag inplace.)

I guess, that's about it. Contact me, if you find any errors.



Download Attachment: icon_paperclip.gif turntrack.zip (http://www.civ3duelzone.com/forum/uploaded/smalltalk/2004916192436_turntrack.zip)
6.34KB

Matrix
18-10-2004, 20:10
I admit that it took too long, but I've updated the turn tracker. :)

One only has to go to the turn tracker to send and log the next turn. [yeah]

I've removed Tiny Chaos II and added Tiny Chaos III.

http://www.straland.com/turntracker/

Matrix
18-10-2004, 20:13
I don't have the e-mail addresses of kryszcztov, Banzai and Eldakkar. This means, in Swimming Pool, that Beam, Arghis and Eldakkar can't send the savegame with the Turn Tracker yet.

akots
18-10-2004, 20:34
Looks intriguing. So how it is supposed to work?
OK, never mind, I just tried it and it has sent TC3 turn to Digger.

Banzai
19-10-2004, 10:48
Matrix... you have mail :)

btw.. is it possible to sort the logs in reverse order? Now we have to scroll down to see who used it last...

digger760
19-10-2004, 13:17
quote:Originally posted by akots

Looks intriguing. So how it is supposed to work?
OK, never mind, I just tried it and it has sent TC3 turn to Digger.


I got it to....thought for a minute that ghost [at] server [dot] com was a virus

smalltalk
19-10-2004, 20:42
quote:Originally posted by Matrix

I admit that it took too long, but I've updated the turn tracker. :)
I guess, entering all the 540 turn-dates takes its time.
quote:Banzai
is it possible to sort the logs in reverse order?
maybe I'll have a look at this some day.

Matrix
19-10-2004, 21:13
quote:Originally posted by smalltalk

I guess, entering all the 540 turn-dates takes its time.
No, it didn't. You just need to do it smart. ;)
I used Excel for it. That part was done in about 15 minutes I think. Far less then the pages themselves.

digger760
20-10-2004, 13:14
I did'nt notice the turn number drop down list when i used it yesterday.

One small observation that could cause confustion for TC3

we started the game in 3950BC (in fact i think all custom made multi PBEM's do) so for our game turn was was infact 3950BC. I noticed akots uses the turn number to name the sav...so even though i posted turn 7 as being sent out we are on turn 6 according to the turn tracker.

infact come later turns I can't see myself looking for the correct turn number in that list...it is just too long for a drop down list.

Matrix
20-10-2004, 15:03
Yea, just noticed it myself. I've shifted the turn counter one down. ;)

Matrix
20-10-2004, 16:20
One growing pain found and eliminated: Hotmail rejects e-mails from "ghost@server.com". So I changed it to my address.

The e-mail address is filled in with this line:
$email_from="e-mail@address.com";
E-mail headers note it as:
From: <e-mail@address.com>

What should I fill in in the first line if I want to give the from address a name, like "Turn tracker"? Cos when doing something like that it should arrive as:
From: "Turn tracker" <e-mail@address.com>
It's not very important, so don't bother if you don't know.

digger760
20-10-2004, 16:57
would the following work?

$email_from = "Turn Tracker<email@address.com>"

Matrix
20-10-2004, 20:33
I don't think so, since those angle brackets ('<' and '>') aren't there in the PHP script now. So this will probably result in:
From: <Turn tracker<e-mail@address.com>>

smalltalk
20-10-2004, 21:55
For me, diggers suggestion works fine.

$email_from="Turn Tracker <sender@host.com>";

******************

If you want the submits in reverse order:

In gameX.php - exchange the line:
quote:<pre> <?php include 'game1.txt' ?></pre>
with this:
quote:
<pre>
<?php
$lines = file('game1.txt');
$lines = array_reverse($lines);
$n = count($lines);
for ($i=1;$i<=$n ; $i++) {echo $lines[$i-1]; }
?>
</pre>

If you replace $n with a number, say 20, only the last 20 submits will show.

Matrix
20-10-2004, 22:09
Yea, you're right, it works too. [yeah]
Both things work. ;)

akots
21-10-2004, 23:13
Is it possible please to set a longer lag on the report page. My browser just swallows it in a fraction of second and I cannot see where did the mail go just to make sure. But it is a great utility!

Matrix
21-10-2004, 23:20
You can click on 'stop' on your browser. Then you won't be forwarded automatically...

akots
22-10-2004, 00:43
lol, I'll try but it would be hard. Similar like the squares game. I don't think I actually noticed anything at all on that page. It just flashed and went away.

Matrix
22-10-2004, 13:08
Weird. The page should be there for a full five seconds...

digger760
23-11-2004, 13:30
Matrix...i just noticed that i can view the source of the turn-tracker and it has out email addresses in there.

Is it possible for web-bots to find this and use our email address for product promotions (viagra, enlargment, financial prosperity and other such promotions)?

Plux
23-11-2004, 14:30
Why you ask. You need some? ;)

Matrix
23-11-2004, 15:07
[lol]

Digger, I actually don't know. I guess so. [sad] But I don't think that webbots won't find that page easily. Only a few people visit it...

Banzai
23-11-2004, 15:38
Well.. the strange thing is that my company used Websense to block access to the turn tracker because it was identified as a game site, while it did not block access to this site...

smalltalk
27-11-2004, 14:37
If this is a problem, then the email adresses could be changed into like "address_at_host.com" and then be further processed at run-time.

Or the adresses could reside in the php-script, and thus be completely invisible to the user.

smalltalk
29-06-2005, 22:53
Updated the turn tracker to deal with multiple recipients.

Multiple recipients can now be entered like this:
<option value="Player1; member1@host.com; member2@anotherhost.com; member3@cdz.com">Player #1</option>
Seperating character is the semicolon.

The number of recipients is not limited. Please note, that the turntracker will not be updated, if sending the emails fails.


You have to add everything after //new in append.php
quote:
// Split name of player and of next player in queue
// Change the ; if you want another split-character

$players = explode(";",$_POST['player']);

// New
$number_of_recipients = count($players)-1;

// note that $player_ from now actually holds party_from
$player_from = $players[0];

for ($i = 1; $i <= $number_of_recipients; $i++) {
$player_to[$i] = $players[$i];
}



also you have to change:

quote:
if ($do_upload == 'true')
{
// send the email

//new
for ($i = 1; $i <= $number_of_recipients; $i++) {

$OK = send_attachment ($player_to[$i],
$subject,
"",
$_FILES['upfile']['name'],
$_FILES['upfile']['type'],
$_FILES['upfile']['size'])
or $OK;
}

// Do not add a newline to textfile, if there's an email error
// $upload = ($_POST['upload'] == 'true');
if (!($OK)) { exit; }
}




You also might want to change this line in send_attachment.php
quote:print("<p><br></p><p><b>Attachment status</b><p>");into print("<p><b>Attachment status</b><p>");
to make the output more readable.

Contact me, if I'm talking gibberish.