Tag Archives: jquery

SimpleBlog Work Post

10:29am- I finally have internet at the cafe I’m working at. I’ve been working for about a half hour aready, working on the login function JavaScript. I’m about to make some modifications to the php login function to stop code insertion.

11:44am- I’ve been working quite a while and haven’t tested anything. I’m sure something will go wrong with this code, and debugging it is going to be a pain. I’m still working on the login function. Right now I’m working on the part where it shows the hidden logged in options bar and hides the login form.

12:13pm- Now I’ve got it so that if there’s a session ID cookie it displays as if you’re logged in. It’s getting close to test time.

12:20pm- Test time! Also lunch time. I’ll be debugging until my food gets here. I’ve got my first bug too. The login form is nolonger displaying to the right of the page with the CSS Formatting.

1:14pm- Well I got the javascript errors cleared out, but now it’s throwing ajax errors displaying the entries. Unfortunately I’ve hit my limit, it’s hard to keep my eyes open. I need a nap, so this is where I’m calling it for now.

Tagged , , , , ,

SimpleBlog Work Post

Well I’ve finally found time to work on my SimpleBlog project again. Well, this isn’t the only time. Last time I worked on it, I didn’t save my notes, so I’ll summarize here.

I added a CheckLogin function to model_SimpleBlog to check the login data, and removed the checkLogin function from controller_SimpleBlog.php because its unneccesary now. The web app will know it’s logged in because it’ll have a session id, or it won’t. Checking the login data will happen on login.

9:51am- Getting started. The work I did last time has got the groundwork done for logging in and returning a Session ID. Now I need to make the login form work and make the system check for a cookie with a session id. I’ll start with the latter part.

10:47am- Okay it now checks for a session ID in the cookie when the page loads, and if it finds one it assumes the user is logged in. Next I need to make the login form work, but that’ll have to wait for next time. I just remembered something I had to do at home.

Tagged , , , ,

Progress Update

MyFirstChatroom is coming along. I’ve decided to start by getting the hand-entered entries from the database onto the chatroom box to make sure my pipeline is working, before moving on to live updates and posting entries.

It’s been a while so I’ve got to refresh my memory on how to have two PHP scripts talk to eachother. Looks like the only way is to have the controller contain an instance of the model.

The model has an array that the controller needs to access in a variety of ways but I don’t want to make it public, so I’ll have to make a variety of accessor functions next. For now, I’m out of time.

Tagged , , , ,

Designing MyFirstChatroom

So to start with I’m making a chatroom. I’m calling the project MyFirstChatroom since it kind of is, and it’s simple.

There’ll be an AJAX/JQuery View, a PHP Script Controller and Model covering a MySQL Database. For this version of the chatroom I’ll be recording a log of the last, let’s say two hundred things said on the chatroom. When I convert it to a MUCK I’ll probably just fill the user’s view with whatever is posted in their vicinity instead, so that they can carry it with them room to room.

I’ve hit my first problem with the design. I’ll be keeping a database of previous paragraphs up to two hundred. But, as they pass that and are deleted, the id of the stored paragraphs will keep going up, eventually running out. So, I’ll have to set it up to recycle ids after it gets to two hundred.

Hmm… If I’m going to be saving chat lines, that’ll be seperate from the chatroom itself, and eventually the users. So, I’ll have to make a model for chat paragraphs as well.

The way I’m thinking about it now, I’m pretty sure I’m violating database rules. Maybe 1st Normal Form…

I talked about it with my brother some, and he thinks I should be good to just make the model an array of entries representing the one table. So I’ll give that a go.

Tagged , , , , , ,

WebMUCK

Well Ludum Dare didn’t go so well, I spent the whole weekend trying to get my tools to work. Hopefully I’ll be better prepared next time.

I’m starting a new project today, something I should be able to put proudly into my portfolio. I’m going to make a Web based MUCK. MUCK stands for Multi User Chat Kingdom. They’ve been around since the internet stone age and haven’t changed much since then. In form, they’re like a series of linked, themed chatrooms representing a virtual space. Unfortunately they’re so old that you have to connect to them with a dedicated client, and interact with people using arcane text commands.

I’ve decided to make a web based MUCK system. Linked chatrooms should be simple enough to do quickly and complex enough to show my skills, I hope.

To begin with, I’ll make a simple chatroom. Then I’ll add in the account system, and finally set up connections. I can build other MUCK features on top of that; they usually have programmable objects in MUCKs that say or do things when you interact with them. Though, I might just expose the client interface, so that people can make chatbots to do that with whatever they’re familiar with. But one step at a time.

My first chatroom will be done MVC Style. The Model and Controller will be PHP classes while the view will be done with JQuery and AJAX.

I’ll post more on here when I hit a stumbling block but for now I’m just setting up the basics.

Tagged , , , , , , ,

JavaScript and Jquery Experiments

So, last time I read up on JavaScript and found that the syntax is pretty much the same as ActionScript except in a couple places. However, I got burned out before I could actually try anything, so I’m going to do that now.

I’d say the primary thing I want to try is making a context menu like I planned to make in Flash. I’d also like to have non-standard scrollbars, so that I can focus on style, but that can probably be a later development.

So, for now, I want to make it so that when the user clicks on a specially formatted anchor tag, they’ll pop up a tree of selection blocks.

*tinker tinker tinker* Well, I’ve got it making a fixed position div when I click on a tag, that’s a start. I kind of hope there’s an easier way than the silly looking code I just wrote to do it, though. Next I need to make it appear where the click was, and close if the user drags their mouse pointer off of it. First I’mma take a break though ’cause the sun in here is driving me nuts and I have a bag of chips.

*break break break* Ahh that’s better, I’ve broken for a little while and now the sun has decended behind the mall, so no more annoying beams. It’s kind of nuts that it’s already so late. It seems like I’ve been barely up at all! I guess I spent a long time playing Legend of Grimrock.

*experiment experiment jquery jquery*

Hmm… Okay so the onclick DOM event won’t give you the xy position of the element that was clicked.

I can use the jquery css position method to get the position of a span inside of a p, though, so that should do what I need.

*work work work work work*

Okey dokey, there we go. I now have a box that appears when you click certain text in a line, and disappears if your mouse leaves the box. I can expand on that to make a nice context menu tree. ^.^

Now that I’m sure I can do that, I want to be sure I can do the other things. So, my next test will be creating data objects for the world simulation. But, I’ll do that later. I’ve been at this for a while and I need another break.

Tagged , , , , ,