Hi, I need to create a website for a friend of mine. They have created a small book, that they want put on the internet, and i'm not sure which is the best way to do it. Basically they want it to so there is a link on the front page of the website to the first page of the book, and then on that page, at the bottom you would have pagination, showing "previous, 2,3,4,5, next" but none of the CMS's I've looked at seem to offer something as simple as that. It has to be integrated into the website as well, not just a .pdf download. any ideas?? thanks. FlashCulture.
Sure, why bother with content management? If you know how many pages / chapters you want, just do it yourself in HTML. It'll take you half an hour and be way less hassle.
Well I don't know anything about html , and it's the pagination which has me stumped, I wouldn't have a clue how to program that with html/php, and there's design etc, so if it can be done with a CMS that's what I would prefer.
Haha! That's me told. Sorry. I always right my own CMS, so I can't really recommend you anything... Hope it ends up ok though!
Well, this is a quick PHP code that would do it (drafting by hand): <?php $page[ 1] = "PAGE 1 TEXT HERE"; $page[ 2] = "PAGE 2 TEXT HERE"; $page[ 3] = "PAGE 3 TEXT HERE"; //and so on... //Don't edit below here ;) function loadpage($pagenum) { global $page; echo($page[ $pagenum]); $prev = $pagenum - 1; $next = $pagenum + 1; echo("<a href='story.php?page=$prev'>Previous</a> | <a href='story.php?page=$next'> Next</a>"); } if(isset($_GET['page']) == 1) { if($_GET['page'] == 0) { loadpage(1); } loadpage($_GET[ 'page']); } else { loadpage(1); } ?> PHP: Just save it as story.php Then the URL would be yourserver.tld/story.php? And you could choose a page by changing it to: yourserver.tld/storyphp?page=2 For example. I have included links to do this. I tested it and it works BTW the variables $page[ x] can contain HTML or whatever you want them to
hmm maybe I should of posted this in the CMS section, but if I post it there as well theres a good chance one of the moderators will get bent out of shape!
Yeah, you can add as many pages as you like BTW, just add them like the others; this for example: $page[ 4] = "Page 4 Text"; PHP:
Using Rory M script i made this for a preview, i added some style http://www.lime-designs.net/story.php my code: (NOTICE ON PAGE 4 I USE ' ' INSTEAD OF " ") <style type="text/css"> <!-- body { background-color: #FFFF99; } body,td,th { font-family: Tahoma; font-size: 12px; color: #000000; } a { font-family: Tahoma; font-size: 12px; color: #000000; } a:link { text-decoration: none; color: #666666; } a:visited { text-decoration: none; color: #666666; } a:hover { text-decoration: underline; color: #666666; } a:active { text-decoration: none; color: #666666; } --> </style> <table width="534" height="314" border="1" align="center" bordercolor="#000000"> <tr> <td bgcolor="#FFFFFF"> <center><?php $page[ 1] = "all dis text hurts my head</br>"; $page[ 2] = "so use pages instead</br>"; $page[ 3] = "pain has gone woooo</br>"; $page[ 4] = 'OOOOO a Snowflake :)</br> <img src="snowflake.gif" alt="SnowFlake"></br>'; //and so on... //Don't edit below here ;) function loadpage($pagenum) { global $page; echo($page[ $pagenum]); $prev = $pagenum - 1; $next = $pagenum + 1; echo("<a href='story.php?page=$prev'>Previous Page</a> | <a href='story.php?page=$next'> Next Page</a>"); } if(isset($_GET['page']) == 1) { if($_GET['page'] == 0) { loadpage(1); } loadpage($_GET[ 'page']); }else{ loadpage(1); } ?></center></td> </tr> </table> Code (markup):
LOL "oooh a snowflake!". I was looking through that page, and saw that and literally laughed out loud.
ha, thanks for all the code , ok so everyone thinks I'm better off using php to create something myself rather then using a CMS? bare in mind I will some kind of design in there, along with allow the book author an easy way to put all the pages into the site. Would it be a good idea to store the pages on a mysql database? and pull them into the site that way?
Hello, Go to Google Book >http://books.google.com.my/bkshp?hl=en&tab=wp and follow instructions. Google will scan the whole book and market it for you FREE in the Internet. Good Luck! www.publiclistednotices.com