How to put a "book" onto a website?

Discussion in 'HTML & Website Design' started by flashculture, Jul 13, 2008.

  1. #1
    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.
     
    flashculture, Jul 13, 2008 IP
  2. iamben

    iamben Active Member

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #2
    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.
     
    iamben, Jul 13, 2008 IP
  3. flashculture

    flashculture Peon

    Messages:
    256
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    flashculture, Jul 13, 2008 IP
  4. iamben

    iamben Active Member

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #4

    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!
     
    iamben, Jul 13, 2008 IP
  5. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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 :D BTW the variables $page[ x] can contain HTML or whatever you want them to
     
    Rory M, Jul 13, 2008 IP
  6. flashculture

    flashculture Peon

    Messages:
    256
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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!
     
    flashculture, Jul 13, 2008 IP
  7. flashculture

    flashculture Peon

    Messages:
    256
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    oh ok cool, thanks. I'm thinking of learning html so maybe this would be a good start :).
     
    flashculture, Jul 13, 2008 IP
  8. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #8
    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:
     
    Rory M, Jul 13, 2008 IP
  9. Lime-Designs

    Lime-Designs Active Member

    Messages:
    357
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #9
    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):
     
    Lime-Designs, Jul 13, 2008 IP
  10. yankzilla

    yankzilla Peon

    Messages:
    159
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #10
    LOL "oooh a snowflake!".

    I was looking through that page, and saw that and literally laughed out loud.
     
    yankzilla, Jul 13, 2008 IP
  11. flashculture

    flashculture Peon

    Messages:
    256
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    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?
     
    flashculture, Jul 13, 2008 IP
  12. Lime-Designs

    Lime-Designs Active Member

    Messages:
    357
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #12
    I think you can use a form so he can create a page and add it that will require more coding though
     
    Lime-Designs, Jul 14, 2008 IP
  13. RamonK

    RamonK Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    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
     
    RamonK, Jul 14, 2008 IP