/    Sign up×
Community /Pin to ProfileBookmark

Multipage article system.

Ok – I’m trying to make a multi page article system. I’m looking at several ways to implement it.

GUI Side
1.) Have a page that has a button that say add page that would make a another form element appear.

2.) Figure out how to create a plug in for FCKEditor to add in [page title=””] in to the text box.

[CODE]<html>
<head>
<script type=”text/javascript”>
function newpage()
{
var page=prompt(“Page Name”,”Page “+document.form1.pagenum.value)
if(page!=null && page!=””)
{
document.form1.txtbox.value = document.form1.txtbox.value+”[[Page=” +page+ “]]”;
++document.form1.pagenum.value;
}
}
</script>
</head>
<body>
<form name=”form1″ id=”form1″>
<input type=”button” onclick=”newpage()” value=”Display a prompt box” />
<input type=”hidden” name =”pagenum” id=”pagenum” value=”1″ />
<textarea name=”txtbox” id=”txtbox” /></textarea>
</form>
</body>
</html>[/CODE]

Depending on the how the back will be done – depends on what would tax the server more… Hey I’m trying to do it as efficiently as possible.

Back end:
1.) Have a table with the main stuff of the article then another for the pages of the article.

2.) Have it all in one table with the [page title=””] tags left intact.

I know that on the back end stuff – 1 would be more MySQL intensive and 2 would be more PHP intensive. 1 I would think would be harder to do updates to the pages.

What would you forumners do? Am I thinking that doing the preg_split stuff is more taxing than it really is? How I’m seeing it has I would have to store the whole thing into a variable and if you have 50 page article – that could be quite a bit of memory usage…

[code=php]<?php
$pattern = ‘/[page title=”.*?”]/’;
$content = ‘blah[page title=”monkey”]Blah blah[page title=”doggy”]asdf[page title=”monkey1″]’;
$pages = preg_split($pattern, $content);
echo ‘<pre>’;
print_r($pages);
echo ‘</pre>’;
?>[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @ellisgl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...