Charas-Project

Off-Topic => Really Old Stuff => Archive => PHP => Topic started by: Alex on July 30, 2003, 05:09:06 PM

Title: Multiverse Oneliner creation
Post by: Alex on July 30, 2003, 05:09:06 PM
We began talking about this  here (http://charas-project.net/forum/showthread.php?threadid=870&forumid=12&catid=6).
And so, time to make it fun and useful!!!!

So, i begin with some notes:

where you have:
$content = str_replace ("\\", "\", $content);
$content = str_replace ("<", "<", $content);
$content = str_replace (">", ">", $content);

there is some nice funcions to do this better with  this function (http://it3.php.net/manual/en/function.htmlentities.php).
Just do this:
$content = htmlentities($content );
And all html troubles will be avoided forever!

Oh, and add the ";" at te end of line 60 ;)

After this, what can be done?
Simple, a multifile version!
Example imaging we have oneliner.txt and oneliner2.txt
Just define an index file (ex: index.txt) with a "filename space description" for each line.
So, simply

oneliner.txt You know your crazy in the Charas project when...
oneliner2.txt You know your bored in the Charas project when...


This tells you something?
Yes, each line contains the $openfile and $onelinetitle vars.
So, in the main php file, you kust need to specify the index file name.
Then, check if $openfile and $onelinetitle exists:
If yes, then use the $openfile and $onelinetitle you have as you did now.
It not, show the available $openfile reading them from the index:
Just read each rows and split it using the first space as reference.
Then, you'll have a 2 indexes array:
$yourarray[0] as $openfile
$yourarray[0] as $onelinetitle
So it's easy to create a select box or a list of hrefs to recall your script passing to it also these vars.
And so, the choosen file will be viewed ;)

Ok, this are just base steps. But after this, you can add an "index.txt" editor to add new files and other useful stuffs.

Let me know what you think, and if you'd like to try creating this!
Title:
Post by: GaryCXJk on July 30, 2003, 07:29:31 PM
Aha...

For some reason, this makes sense to me. Hell, why didn't I think about it? Also, I have an idea for an admin page. BUT it isn't really hacker proof. Actually, it can be. Meh, I'll just start with the multifile thingy.

THIS IS FUN!!!

EDIT:

I've thought of something more challenging. What if I added something like list or nonlist?

And they need to be seperated by a special command, like ||BUYAKA|| or something... I think I stick to ||
Title:
Post by: Alex on July 30, 2003, 08:01:15 PM
Well, now i think you've enough material and ideas to try.
If you want some more proof, then you should think on placing arrays indexes within the txt file. This will make you simple to eventually add new "fields" on it.
Namely, a text file with index in it is called "text database".

But better to proceed step by step: i think that to realize what i told before and the index admin panel is ok, right now.
You know: better less WORKING things that tons of bugged ones ;)

Just one addon: txt files now means new "discussions".
So the ability of creating new files should be given to everyone (simply a "create new discussion" link).
And so, a password protected mod panel is a must, to eventually delete unuseful files and comments...
And deleting one line in the middle of a text file, making all the other to come "up one line" is not that easy... :D
Title:
Post by: GaryCXJk on July 31, 2003, 07:11:58 AM
Well, before I had the chance to read this, I already made version 1.2!!! Anyways, I'll try to make that. Wouldn't be that hard tho.
Title:
Post by: Alex on July 31, 2003, 10:25:10 AM
Not bad!
It's surely just a beta, but ok to work on.
Now i'll wait for the next version ;)
Title:
Post by: GaryCXJk on July 31, 2003, 10:51:48 PM
This is the most badass creation I've ever made... for now. Anyways, here it is.

Also made put up an example for the people who actually think: "What the hell are they talking about?"

http://members.lycos.nl/garycxjk/mvtest/index.php

I actually need bugcheckers. So if you find a bug, please tell me.

Ow, and Alex, change this forum so that the / me tag only works at the beginning of the line. It's annoying if the url is members.lycos.nl.

Example is above.

http://members.lycos.nl/garycxjk/mvtest/index.php

EDIT2:

Found bug!!!

It seems you'll have to post first before you can see the entries.
Title:
Post by: GaryCXJk on August 01, 2003, 03:48:06 PM
I fixed it, so here's version 1.3.1
Title:
Post by: GaryCXJk on August 03, 2003, 01:39:51 PM
And I've added a forbidden words system, so here's version 1.3.2!

Next step: MySQL!!!
Title:
Post by: Alex on August 03, 2003, 01:48:16 PM
I gave a look at it fastly. Will se more deep what i'll find more time ;)

Anyhow, i have 2 fast notes:
1)
list($strid,$sopenfile,$slisted,$stitle) = split(" ~ ",$filearray[$x]);
This is dangerous. What will happens if someone use ~ as a character in the name of the board?
Simple solution: when creating, do a replce for ~ to something else (- should be ok).
You have to be sure that your splitting char will be ONLY present as a splitting char

2)
In the admin page, just for look: better to place the three buttons aligned under the input fields. You'll use less space and make it more readable.
Title:
Post by: Alex on August 03, 2003, 02:22:34 PM
But not for the "Create your own oneliner file!" part.
There is no control for that.
And so, just try to enter "test ~ bissss".
And the index.txt file reports:

oneliner ~ oneliner.txt ~ listed ~ Oneliners are fun, because:
movies ~ movies.txt ~ nonlisted ~ Movie quotes
guest2 ~ guest2.txt ~ listed ~ test ~ bissss

This is what i was talking about: now i have a new board named just "test", not "test ~ bissss".

;)
Title:
Post by: GaryCXJk on August 03, 2003, 07:41:33 PM
Fixed.