Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating a Chaos CMS, tips needed.

Status
Not open for further replies.

Olavxxx

Programmer
Sep 21, 2004
1,134
NO
Hi,

I wish to generate a Chaos CMS, so I need tips.
This will work kind of simple...

The CMS will have no menus!
Upon entry of the page, a frontpage is shown, with some text/pictures. Some words will then be hyperlinked to other pages, which are relevant to those words.

This is where the chaos comes in.
The general idea here, is that from A-B, there can be C-Z

eg. You might start reading about a city, which then moves you on to something completely different.

How should I generate this?

There will be a local webserver (on the client), which will be dedicated to the webpage, so I guess it can handle some resources.

I guess it's very bad to explode the entire content and run queries on different words.

eg. should the words be linked up manually, or are there some good ways to find references to words, in other content?

SELECT ... FROM .... WHERE content_text LIKE '%$word%'?

Does anyone know of any projects like this?

remember: No menus on the CMS!

Olav Alexander Mjelde
Admin & Webmaster
 
I thought of one idea now:
If I define a title for each content, I can then run a query and generate an array with the content title and id.

Then, I can do almost like smiley scripts, replace words with hyperlinks to content with same title as word.

I dont know how performance would be.
Maybe I should limit the query to unique hits and ORDER BY RAND? So the array will be random, if there are more than one content with the same title?

eg. if there are two contents which deal with "fire", then only one of them, randomly chosen, would enter the array?

then, if any content has the word %fire%, the %fire% would be replaced with a hyperlink to that content?

Is this an o.k. way to do it?
As I said above, the server will be dedicated to this webpage! (RUN LOCALLY).

I will set it up with mysql, php and apache, running under Windows 2K PRO.

I guess this would "kill" a public server, if there are many hits,but the page will only be accessed thru the one client, which also is running the server software.

Specs of the server is yet unknown, but I've asked the people to gather the HW ASAP, as I only have 2 weeks to make this project up and running.

I hope someone has comments or input, ideas, or whatnot.

Olav Alexander Mjelde
Admin & Webmaster
 
I see there where no replies, but I have now made a beta version of the chaos-cms.

It's quite easy actually.
The CMS is currently based on one table.

I then have three php files:
db.php <- connection information, as well as some functions for escaping strings
_genChaos.php <- Generates the chaos
index.php <- retrieves the webpages

The genChaos() has two parameters: Input and Exclude
When the index has loaded a page, it does:
echo genChaos($content, $exclude);

$exclude is the ID of the content which is currently active.
The genChaos then queries the table and retrieves the ID's and the keywords for the pages and then replaces the content keys with the currents.

eg. it works like a smiley-script.
This way, you dont make any hyperlinks in the content. You only specify which words that should hyperlink to that page.

eg. If a page has a keyword: orange
Then, on a webpage, you write:
I have an orange car.

The CMS then automagically hyperlinks to the page about orange.

The exclude, is for excluding the active page.
eg. If the page about orange mentions orange (which is should), it will nok link to it self!

I have not yet thought about what to do, if there are more than one page with one keyword.

The general idea from my pow, is that each page should in theory have a unique keyword. (As if it where a menu).
The only menu, will be the one in the content, where the content words gets replaced with hyperlinks on the keywords, as I mentioned above.

It only took me 40 minutes to make this beta, and it works great! By adding three pages (three rows in the mysql db), one keyword on each, the pages are all linked.

The more pages are added in the db, the more words are hyperlinked in the text/content.

One genious thing about this, is that if you delete one page, you dont have to look for dead hyperlinks, as there will be no dead ones.

It will give some system stress, but no more than a regular smiley-script, as it works in the same way.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top