LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-05-2005, 03:14 PM   #1
mifan
Member
 
Registered: Apr 2004
Distribution: mandrake
Posts: 116

Rep: Reputation: 15
database or xls doc?


I am trying to reorganize a website that has a lot of texts. I would like to be able to insert the text into a database or perhaps a large text file, and when a visitor clicks on the link, the correct paragraph(s) would be automatically displayed.

is there a way to do this? or do I need to create an html page for each part? what is best to do this, asp, php, flash, or other method?
 
Old 09-05-2005, 03:34 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Most sites that do this use a database, mysql and php would probably be the simplest for your needs, you don't need to create a real page for each virtual page. The easiest way to do this is using a local rewrite rule in apache.
 
Old 09-05-2005, 03:47 PM   #3
mifan
Member
 
Registered: Apr 2004
Distribution: mandrake
Posts: 116

Original Poster
Rep: Reputation: 15
ok,

i'm not a whiz at programming, but here's what I'm thinking:

for sql database

I'd create a table for each section:
table 1=section a

1 | Title | Paragraph 1 | Paragraph 2 | etc.
2 | Title | Paragraph 1 | Paragraph 2 | etc.
3 | Title | Paragraph 1 | Paragraph 2 | etc.
4 | Title | Paragraph 1 | Paragraph 2 | etc.
5 | Title | Paragraph 1 | Paragraph 2 | etc.

table 2=section b, and so on.

so, I think if a user clicks a link to create a page for section 1, story 1 I could arrange the paragraphs via html tables.

But there are a few things I don't know how I should do, for example, all parts have a different number of paragraphs, so how can I arrange the paragraph formatting? before I used css files and <p align=justified style:text-indent=.3in class=bodytext></p> but if I put all those paragraph place holders like this:

<p align=justified style:text-indent=.3in>DATA from SQL here</p>
<p align=justified style:text-indent=.3in>DATA from SQL here</p>
<p align=justified style:text-indent=.3in>DATA from SQL here</p>

would it cause problems if there was no data for a given paragraph? or is it possible to create this dynamically also?

And how would I arrange a next/previous link dynamically? I'd like the link to be active if there is a section before or after the page the viewer is looking at.

I know this might be quite a bit i'm asking, so i'm looking into an online tutorial about how to use php and sql, but I sure would appreciate help from the guys here :-)
 
Old 09-05-2005, 03:54 PM   #4
mifan
Member
 
Registered: Apr 2004
Distribution: mandrake
Posts: 116

Original Poster
Rep: Reputation: 15
just found out, that sql is english only, it can't handle east asian text :-(

any way to still arrange as database/data driven and allow use of east asian texts in the database?
 
Old 09-05-2005, 04:06 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
I'm not sure where you got the idea that it is english only. Maybe some specific databases are but MySQL certainlys isn't. Take a look at all the wikipedia sites that use MySQL:
http://wikipedia.org/

You may actually want to consider using an existing cms system or wiki if you aren't keen to program something yourself.
 
Old 09-05-2005, 04:18 PM   #6
mifan
Member
 
Registered: Apr 2004
Distribution: mandrake
Posts: 116

Original Poster
Rep: Reputation: 15
i searched my webhost's forum and there it was said that SQL was english only...

is it that they have an english only version then?

taking a look at the source from the link you gave me:

<a href="http://zh.wikipedia.org/wiki/%E9%A6%96%E9%A1%B5" lang="zh" xml:lang="zh" title="Zhōngwn">中文</a> 

this link is generated by a database then?

While its true that I'm not great at creating code from scratch, I'd like to do better, only way I know is to see someone else's code and learn from them, or ask them why it works that way if I don't understand.
 
Old 09-05-2005, 04:22 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Pretty much all of the text appart from html tags is stored in the mediawiki databases. If you take a look at the code you'll see.

If you do want to compare existing cms products then look at:
http://www.opensourcecms.com/

Even if you don't use them they will probably give you a few ideas.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble finding policy doc as pdf in doc mirrors stardotstar Debian 2 05-12-2005 10:56 PM
Script to check Doc-BBB against Doc-AAA for inconsistence satimis Programming 2 11-09-2004 01:43 AM
sql to xls j.vilon Linux - Newbie 20 11-04-2004 12:08 PM
Just read DOC and XLS file formats! SmallTalker Linux - Software 5 09-23-2004 06:12 AM
.doc, .xls & .jpg became 0kb paeng16 General 1 07-30-2004 08:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration