Log in

View Full Version : Forum scrabble game, not sure waht to do?



JRR
11-24-2013, 12:37 PM
We play a game over on my forum that we call scrabble though it's not really a scrabble game.

http://www.thescooterprofessor.proboards.com/thread/2942/new-scrabble-game?page=58

It's actually a change a word to a new word game. The rules are simple:

We use 6 letter words but can change to any amount we want.
Only words in the English language are used.
No proper names or capitalized words.
We change one letter ONLY to make a new word.
Words cannot be repeated.

Sound simple enough and it actually is except for the fact that as you can see with the link above the game is now on it's 58th page and after a spell it's hard to remember if a word has been used in the current game that is going on. The goal is to see if someone can finally put up a word that cannot be changed again because all words have already been used. So if you're not sure you have to just put the word up and if someone says it's already been used then change it or scroll through page after page to check. It's kind of run a lot of people off who did like to play earlier.


What I was wondering is there a game code like this anywhere that someone knows of (and I have looked a lot on the net) that I could install on my forum that could b e like a data base or something that could have a drop down listing all the words that have been used on the previous pages or a drop down that could be put in that would search to see if the word has already been used? I can put this game on a total separate thread , category or board if need be. I even looked at game codes here too.

I may be asking for something that is totally undoable but I'm hoping that the good people here can help.

Thanks

djr33
11-24-2013, 07:14 PM
Would you be interested in writing an extension to your forum on your own? That is, the best way to do this might be completely independently of the forum but integrated with the user login system. I've done things like this. It's not a small project, but it is possible. Often the forum software will have an API (or you can create one yourself with some work). Depending on how fast you need this and whether you want to take that on, you could either do it yourself or hire someone to do it (see the paid work requests forum here, or look elsewhere-- this could be a big project).
And there are many levels of complexity you could decide-- do you want something that is just the basics, or would you want something more complicated like, for example, adding in graphics? That's up to you.

This reply is, I know, somewhat vague, but maybe it'll help you get started and thinking about what direction you'd like to go in.

JRR
11-25-2013, 04:48 AM
Thanks so much for your reply. I know nothing about this kind of thing, that's why I came to this great forum to start with. I'm wanting just something that's basic IMO.

I would like it to keep track of the words used or if a word has been used before send out a message like "Oops that word has been used already, choose again" and the word not allowed to be posted.

The ability to choose the length of the word or the amount of letters if you will. We might want to use a 6 letter word one time and a 8 letter word the next round.

Limit the words to the English dictionary and be able to reset the game to start again if it is agreed by all that a new word can't be found.

If possible eliminate proper names of people, places and things.

That's basically it. I know nothing as far as how to do this but I sure would like to see if it could be done. How does your pay service go for such things? A flat fee, bids, etc.

The ability

djr33
11-25-2013, 06:12 AM
"Basic" in programming isn't always the most obvious. In this case, I'm not certain that it would be easier to modify the forum to "just add a few things" rather than rewriting this entirely on your own plus user integration from the forum. Forum software is (and I've personally become familiar with maybe 3-4 of the systems out there) always very hard to work with especially if you're just starting out. It takes a very long time just to decode what is located where in the code (there are probably around 100 different PHP files running your forum at the moment!), and then sometimes it takes very complicated code to properly modify the forum in a way that won't be destroyed by updates and isn't just a cheap (soon-to-be-problematic) patch.

Either way is possible, of course, but just be aware that it's not obviously easier to modify the forum.

----

Actually, there is a HUGE problem here: you simply cannot do this (it's hosted by Proboards) without moving the entire forum to your own server where you have access to the code. These thing's aren't just Javascript you'd add-- you'd need to modify the database and serverside code running the forum.
So, if you want to do this you can move the forum to a new server (personally I would-- I like having the access and control over my websites). But: 1) that's a lot of work (and perhaps not necessary for you); and 2) it might be a violation of the TOS at Proboards to take your forum data (posts, members, etc.) with you, so you'd need to start over-- or they might just not give you access to that-- check their website for info on that-- it's important.
Correct me if I'm wrong though-- I don't use Proboards. Do they give you access to the code?

----


I would like it to keep track of the words used or if a word has been used before send out a message like "Oops that word has been used already, choose again" and the word not allowed to be posted.

The ability to choose the length of the word or the amount of letters if you will. We might want to use a 6 letter word one time and a 8 letter word the next round.Technically these things aren't very hard. The hard part is integrating them into (or parallel to) the forum.


Limit the words to the English dictionary and be able to reset the game to start again if it is agreed by all that a new word can't be found.

If possible eliminate proper names of people, places and things.Possible, but would require the use of a dictionary to look things up. You could use the official Scrabble dictionary, but that could also limit flexibility if you wanted to allow creative words that aren't yet in the dictionary. (Personally I'd find that more interesting, not that just anything should count.) There are English dictionaries out there that might work-- I'm thinking of the ones used in spell-check programs, for example.


That's basically it. I know nothing as far as how to do this but I sure would like to see if it could be done.Yes, but it's complicated if you don't know where to start. It's possible. But it may not be possible with your current forum hosting!


How does your pay service go for such things? A flat fee, bids, etc. It's generally informal. DD is generally for free help and discussions about web design. In the case of instead wanting to pay for help, we also have a paid work requests forum where you can post your project and see if anyone is interested. You can decide your price (or negotiate-- best off the forum, by email, etc.) and requirements. To be honest, this is just an extra part of the forum here, which can be useful, but there are much larger freelancing websites out there so you can consider both options. Think of it as "free help plus".

jscheuer1
11-27-2013, 03:17 PM
That's actually a five letter word, not a six letter one as indicated in your post you link to. Still a pretty fun looking game.

The PHP part of a game like this would be fairly easy and a text file could be used to store the results (the words and possibly who proffered them). Javascript using AJAX could verify both that only one letter was changed and that the word had not already been used, before allowing it to be added. A select element could show all previous words (and who entered each of them if this is tracked). A text input could accept the next word someone wants to offer.

There would have to be some way to challenge whether something were actually a word or not. Not sure how to work that part. A database of acceptable words could be used, like a scrabble dictionary, or something else could be worked out.

As far as integrating it, never having done anything like that before I wouldn't know exactly how. If you can find out what the SESSION variables look like for a logged in user (I would assume this would be for logged in users only) and they contain the username, then that could be used to track/credit who gave what word and to ensure (with varying degrees of certainty, depending upon what the SESSION vars look like) that someone is logged in before displaying the page/allowing it to be played. It would no longer be a thread though.

If there is some sort of API and/or template for integrating things like this (widgets, games, etc.) that probably would be helpful.

The more I think about this though, it actually seems more fun as a thread, just the way you are doing it. What with user's policing it and some other limited interaction, it's more social than it would be if it were simply a game with stats where it's impossible to make an illegal/wrong play. Administrating it would be easy though, no work at all probably, so there is that.

JRR
11-27-2013, 09:59 PM
Ok John some us your questions I can answer and some I need help on what you mean. First of all my forum is done in two ways and I can control how users post, read etc. For instance to post one has to be a member and logged in so that's easy. Guests can read all boards, threads etc. except for boards that I choose for them not to, ex. my tech section which is members only. I control this with the forum's software choice or by code like {if $[current_user.is_member]}

This game can be viewed by guests which I want which may attract some to join in to play but can be played only if you're a member and again logged in.

Yes I do know widgets can be added via template modifications as in this example of one in the PB template library:

http://support.proboards.com/thread/473346/imageshack-uploader-create-thread-page

Here is a thesaurus with a template mod and it would be a good thing to have on all pages but I can see if it can be isolated to a single thread?

http://support.proboards.com/thread/456474/template-thesaurus-bottom-create-thread



Also here is maybe something that could be used to add a button for a dictionary or grammar checker, forgot about this one?

http://support.proboards.com/thread/473378/image-upload-buttons-create-thread

I have some buttons already so putting a grammar check/dictionary should be easy enough and a scrabble game type dictionary for this game would even be neater, any suggestions? Also we can modify the rules to make any word in the chosen dictionary acceptable as long as it fits the other rules that we choose to use. I've got buttons that link to Yahoo, gmail etc. But having a widget type thing that one could immediately use or put a word in would be nicer.

http://www.thescooterprofessor.proboards.com/post/new/2942



As you can see this person added a image uploader using a widget. It's possible that I could add some widget and isolate it to the very thread we play on? In fact if I can do what I'm wanting here then I'll probably just start a whole new thread and new game with these changes. If I can's isolate it to a single thread I'm betting I can to a single board. I've made lots of template changes on my forum to add or improve things, it's in lots of cases easier than the plugin system. Even though PB is trying to get away from the old header and footer codes that was used a lot on the old V4 software one can still use then somewhat, ex. the falling images code that you helped Baller and myself with.

Ajax requests are not allowed by PB, just confirmed it. They have a thread going right now asking for API input which includes javascript discussion:

http://support.proboards.com/thread/487474/proboards-javascript-api

I'm sure you know exactly what they are talking about, myself it's vague to me?


BTW I know the thread started with 5 letter words but we changed it to 6.

So basically if I could somehow figure out how to make a system to search for already used words on all the pages of the thread that the game is being played on then it would make the game faster and easier. I could post the rules on a separate thread and tell all members to post only the single word that they changed so that a search function wouldn't look in replies from members that are lengthy and then come back and list the word as already used. Oh BTW this function would have to have a way for a staff member to reset it if it came to a final point of saying all words on this game session have been used and winner is.....

Again John when this game started it had a lot of players and the policing it got old with people who had to go through page after page to try to solve disputes as in this word has already been used. Having a game dictionary only would solve the it's not in this dictionary thing.

I sure would appreciate any help on this and I can always find out if something will or will not work with PB support.

John I just had someone mention to me about a function that might work with this?

http://support.proboards.com/thread/433198/all-plugin-keys

Oh BTW it is a fun thread and I also have a test forum that I can use to test with.


Thanks

jscheuer1
11-28-2013, 03:02 PM
In order to get you thinking a little more like what I'm thinking. What I'm proposing would no longer be a thread. It would be a page where you went to play. The current word would be there. There would also be a select element that would show all of the previous words if you dropped it down and scrolled through it. There would be a text input and a submit button for playing the next word.

Since PHP is behind the board, the SESSION should be available to this page (this might not be workable though, due to security measures of the board). Using that you should be able to allow non-members to see but not play, and to allow members to play and be able to record who played which word. This page wouldn't actually be a part of the board though, so it could use AJAX. This page could be linked to from the board, and have a link back to it. The game would have its own records and dictionary(ies). Stats could even be generated for it - how many plays for each person, how many misplays, points could be assigned to letters, anything you can think of that could be tracked could be used to generate statistics.

It could not be slapped onto the existing game unless someone wanted to take all of the previous plays and enter them into the record for this new page. If someone did that, play could continue on from there on this page I'm talking about.

Again, it would be a single page, not a thread and would stand alone. It's only relation to the board is that it would use the SESSION of the board to determine who (if anyone) was playing.

That's how I'm thinking about this. I may even go ahead and try making something like it (if I'm not busy, because I like the idea). But if that's not what you want or can't live with it that way, I don't think I want to get into doing as a thread at this time. Someone else might be interested.

djr33
11-28-2013, 07:32 PM
JRR, so are you saying that you have access to PHP on the Proboards server? If so, this is possible. If not, it will probably be impossible. Having access just to templating MIGHT work, but it would be a lot of effort to integrate it when all you have to work with is that information. (Actually I don't see how it would work, since you'd need to store these in the database somehow-- perhaps you could use an external database additionally, via AJAX or something, but that ends up with many of its own problems.)
If you have access, then let's see what can be done.

I'm pretty busy at the moment so I don't have time to work through this in detail but I can try to point you in the right direction.


As far as integrating it, never having done anything like that before I wouldn't know exactly how. If you can find out what the SESSION variables look like for a logged in user (I would assume this would be for logged in users only) and they contain the username, then that could be used to track/credit who gave what word and to ensure (with varying degrees of certainty, depending upon what the SESSION vars look like) that someone is logged in before displaying the page/allowing it to be played. It would no longer be a thread though.

If there is some sort of API and/or template for integrating things like this (widgets, games, etc.) that probably would be helpful.John, I'll be happy to help you get started.
There are about four ways to integrate with a forum:
1. Use an API. That's by far the easiest.
2. Create a pseudo-API. Basically extract the login/session check part of the forum code and copy that skeleton of the forum onto a new page called something like "external-verify-user.php".
3. Rewrite everything yourself based on session variables, cookies, etc., trying to piggyback on the existing system but NOT working directly with it. I avoid not doing this-- (2) is easier.
4. Completely skip everything about the forum's code and login, but create a parallel system that only checks the username and password via the database. This is about the same amount of work and the results are bad-- logins aren't timed up (so you must login once to the forum and once to the extra page). There's no reason to do this unless you're running two domain names. (I did do this once, for a website with two domains-- thewebsite.com and thewebsiteforums.com.)

My recommendation: Option 1 or 2:
Step 1: Check if there is an API [if so skip to Step 4]. Assuming not:
Step 2: Go through the PHP files running the forum and track down what part does the login. It may involve several layers.
Step 3: Decide if you want to cut-and-paste or use include(). Try include() first to see if you can just borrow existing code; if it turns out that too much extra stuff is dragged along with the login, then cut-and-paste the login algorithm (eg, password salt, etc.) into a new page.
Step 4: Add the new login code to your new page(s) as needed and you're ready to go.

Another complication would be adding a custom login-- assuming you don't want this, just add a link to the forum's default login page if the user isn't logged in. That'll work fine.

JRR
11-29-2013, 04:03 AM
Ok even though I know nothing about API I feel certain PB has a API?

http://www.proboards.com/developer/js

As far as the PHB files, how do I retrieve them as far as the login goes?

djr33
11-29-2013, 05:03 AM
You'd need a PHP API, not a JS API. (I suppose you could try to do this using JS, but it would be indirect and a lot of work.)

JRR
11-30-2013, 02:18 AM
djr33

I was told this when I asked about doing this as PHP:

external storage would indeed require something written in PHP or python or a similar language. its possible to do because a script tag would just call the PHP from wherever it is hosted, but you are at the mercy of finding someone who can and will code in those particular languages. at least you have your own space for storage, so that adds a barter chip in your favor.

I do indeed have a FTP host with godaddy that I store files, pdfs, and images on.

djr33
11-30-2013, 05:18 AM
Hm. So can you use PHP on the forum server, or would it all need to be on the other one? This would be very tricky because you couldn't connect to user accounts. I'm not sure what would work best then.
(It's remotely possible to work across two domains but without serverside communication between them it would be very difficult and require advanced knowledge of both JS and PHP. And it wouldn't work well at all compared to just doing it serverside.)

Short answer: this doesn't seem possible on your current host, unfortunately.
Longer answer: if you have time, you can play with some options, but honestly the easiest one will be to get a new host (GoDaddy would be fine). Move the forum, then work on this project.

JRR
11-30-2013, 04:23 PM
djr33 what about this possibility? I have had a person who helped me with this crawler code from here say this can be done with a plugin and they will be back after the holidays to help. But here's the problem with using a PB plugin, to store the words (info) they would use keys and they provide 10 free ones and the words would be stored on PB server. So you say what's wrong with this? A key holds about 4000bytes of info and my fear is with a long drawn out game like this 10 keys aren't enough? They will sell you keys but what if before the game ended one needed 50 keys?

Back to this crawler code, look at the photos moving from left to right at the top of my forum:

http://thescooterprofessor.proboards.com/

This is a plugin that the same member that said they could help me with a plugin for this game helped me make with this crawler code:

www.dynamicdrive.com/dynamicindex2/crawler/index.htm


Now before we converted to the new V5 software this is how I used it on the old forum V4.

I put this code in my header:


<script type="text/javascript" src="http://www.jr-richscooterdoc.com/crawler.js">

/* Text and/or Image Crawler Script v1.53 (c)2009-2011 John Davenport Scheuer
as first seen in www.dynamicdrive.com/forums/
username: jscheuer1 - This Notice Must Remain for Legal Use
*/
</script>


I downloaded the JS crawler to my godaddy host:

www.dynamicdrive.com/dynamicindex2/crawler/crawler.js

This was how I added my photos and also the padding, size, speed color, etc.



<center><div class="marquee" id="Scooter">

<a href="http://picturepush.com/public/12769653"><img src="http://www5.picturepush.com/photo/a/12769653/640/12769653.jpg" border="0" alt="Image Hosted by PicturePush - Photo Sharing" /></a>

<a href="http://picturepush.com/public/12769670" target="_blank"><img src="http://www2.picturepush.com/photo/a/12769670/220/12769670.jpg" border="0" alt="Image Hosted by PicturePush - Photo Sharing" /></a>

<a href="http://picturepush.com/public/12769682"><img src="http://www4.picturepush.com/photo/a/12769682/640/12769682.jpg" border="0" alt="Image Hosted by PicturePush - Photo Sharing" /></a>

<a href="http://picturepush.com/public/12769688" target="_blank"><img src="http://www5.picturepush.com/photo/a/12769688/220/12769688.jpg" border="0" alt="Image Hosted by PicturePush - Photo Sharing" /></a>

</div></center>

<script type="text/javascript">
marqueeInit({
uniqueid: 'Scooter',
style: {
'padding': '5px',
'width': '450px',
'background': 'lightyellow',
'border': '1px solid #CC3300'
},
inc: 5, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 150,
persist: true,
savedirection: true
});
</script>



So could we not figure out how to make the game on the forum and store the words on my other server? I'm not going to move my forum to another server, first of all it's against the TOS of Proboards, second I've spent too many hours building what I have and don't want to start over. If I can't make this work any other way except the proposed plugin from PB so be it but I sure would like to if I can.

Thanks for listening.

djr33
12-01-2013, 02:48 AM
I'm not going to move my forum to another server, first of all it's against the TOS of Proboards, second I've spent too many hours building what I have and don't want to start over.I was in that situation a number of years ago, and I just created a new forum elsewhere, told everyone about it, and left the old one behind. The benefit of hosted forums is that it's almost no work for you, it's free, and you get support as needed. The problem is that you have no control. You should do whatever is best in your situation, of course! But you will be sacrificing control if you continue as you are. And that might be perfectly fine-- I'm just offering information about what is and what isn't possible, not making any specific suggestions for you. (I can tell you, however, if you want X then you may need to do Y.)

I don't know exactly what a "key" is. Yes, certainly, that would help. But I don't see how that would fix everything. Javascript cannot ever be secure, and you can't edit the PHP code (which is secure). This means you cannot rely on logins. This would be possible (not necessarily easy) if you didn't mind allow anyone in the world (without logging in to the forum or being associated with their personal account) to modify the information. Would you want that? I've been assuming you don't.

There is simply no way I can see to integrate this with your existing database of users-- usernames and passwords are off limits if you can't modify/extend the PHP code for the forum.

Another option would be to simply create a second website for the game. But again I've been assuming that isn't your goal with this. (For the record, that would be VERY easy to do-- you could just add it in an iframe, assuming you could modify the template or use Javascript to add it in there, but then you'd just be displaying a completely independent website that would, for example, require its own login system with new accounts.)

In short, the easiest answer for this is to move your forum (or just recreate it) on a new website where you have control over the code. That will actually be less work for you than any of the possible options with your current set up, and none of those options seem particularly functional at the moment.



The only thing I can think of is the following:
You could use a second server to watch (="crawl") your forum and look for new posts. Then you could write PHP code that would take that information and change it as required and generate statistics. Then you could display that second website (in an iframe, etc. -- even a dynamically generated image!) in your forum.
But this would require a fairly advanced knowledge of PHP and an ability to extract content from posts, using a cron job to make it run continuously, and figuring out how to integrate it. This actually is, in fact, possible. But it would not be easy (much harder than moving/recreating the forum).
Basically, this of is an external automated hand counting things for you. This wouldn't require direct access to the user accounts because it would be automated-- any post on the forum would be assumed valid (it is, of course) rather than allowing users (or guests) to directly manipulate any content.

JRR
12-01-2013, 01:40 PM
djr33

Plugin keys are the only acceptable form of Ajax that Proboards allows on their forum at this point:

http://support.proboards.com/thread/431718/plugin-keys

One can make a special request for Ajax permission but in a thread that I asked if Ajax was still off limits I was told that a plugin could be made for this game and that I could use a key for storage of the words. Please read this:

http://support.proboards.com/thread/491994/ajax-requests-allowed

Now I have a person who says they can create a plugin for this game which is what is used for a lot of things on PB.

http://support.proboards.com/thread/491590/game-plugin-request

They have a concern about storage too but hopefully the way it was explained to me it won't be an issue? Lots of plugins and I mean lots of them use javascript coding just like the crawler plugin I mentioned earlier. In fact if you turn javascript off on your computer for any reason you'll find yourself in trouble on a PB forum.

I'm going to wait for Todge to build the plugin, he has done many for people and hope for the best on storage and even ask if he can somehow make the plugin use my godaddy server for storage instead of the storage keys like was suggested, that's why I asked all you great people here first if this could be done.

Thanks

JRR
12-01-2013, 02:56 PM
djr33

I just had this told to me by one of the coder/moderators at PB, maybe this makes a difference?

AJAX concerns are only valid if you are trying to get stuff from proboards servers. if you are getting stuff from somewhere else it wouldnt be a TOS violation. what you want to do is perfectly valid, but as I said, you will need to find someone who can write the interface code in PHP to query the database on your server and supply the results back to the plugin. the concept isnt hard, you just have a database of stored words in a mySQL or whatever database, a PHP function to query that list, and return a true or false if it already exists. a second function would add a word to the database if the word wasnt already there.

djr33
12-01-2013, 07:03 PM
I guess I just don't understand enough about these plugins/keys to know whether it would work. If using a "key" means you can access serverside code in one way or another (even indirectly), then this will work. But as I've said, unless you can somehow modify the code on the server (and a "key" might allow that), then you can't integrate this with user accounts.

I'd recommend hiring someone from proboards who knows this system well. It's not anything more general that users here would be familiar with.


AJAX concerns are only valid if you are trying to get stuff from proboards servers. if you are getting stuff from somewhere else it wouldnt be a TOS violation. what you want to do is perfectly valid, but as I said, you will need to find someone who can write the interface code in PHP to query the database on your server and supply the results back to the plugin. the concept isnt hard, you just have a database of stored words in a mySQL or whatever database, a PHP function to query that list, and return a true or false if it already exists. a second function would add a word to the database if the word wasnt already there. The bold sections require access to serverside code.
The underlined sections suggest this is on a second server.
Now I'm still very confused about how you would be able to integrate this with your user accounts.

As I said above-- if this is all on a second server (via AJAX) then you can't integrate user accounts securely. Anyone would be able to do anything in the game. Perhaps you don't mind.



You (or someone else at proboards) should write up a very clear step-by-step numbered outline of how to design this and/or the requirements of what must be included. For example, exactly what actions triggers this new script? And do you need it integrated with the forum's user accounts?