SitePoint Sponsor

User Tag List

View Poll Results: Your views on this Thread.

Voters
13. You may not vote on this poll
  • Yes! This thread is useful for me.

    6 46.15%
  • Yes! This thread helps me to develop a new script.

    1 7.69%
  • Yes! This thread helps me to further develop my new script.

    1 7.69%
  • Yes! This thread allow me to learn another Language.

    1 7.69%
  • No! This thread did not help me at all.

    2 15.38%
  • No! This thread is just about another Content Management System in SitepointForums.

    2 15.38%
Page 2 of 2 FirstFirst 12
Results 26 to 40 of 40
  1. #26
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Padders,

    That is exactly what I have done for my content management system, but I thought to myself that it is very confusing to someone that doesn't know how to use my CMS.

    I was thinking to myself a while back, that I'll make my CMS compatible with most systems and then sell it or give it away for free. Why? Because, you wouldn't believe the amount of people that actually pm me asking for my script. Some people in email want me to make them one based on mine, and actually one person already does use it: http://www.visupoint.com and including me (http://www.codingclick.com) that is 2. There was going to be another, but pulled out...

    I can give this thread tips on making a CMS if you want to!

    Peter

  2. #27
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pete, that is one of the projects i am working on now. I hope to have it finished in about two weeks or so. It should be flexible enough to handle just about anything with any fields you want, template driven blah de blah.

  3. #28
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pete, out of interest, how did you do the chapter names for the drop down box.

    The easy way would be just to have an extra field and do intro to php * what is mysql * arrays and variables

    sort of thing, make an array from that with a mysql call, and assume that the first one is for page 1, the 2nd for apge 2 etc.

    A harder way might be doing something like

    *page break - PAGE TITLE - page break* sort of thing and doing a more complicated regex on this to get the page title out.

    what do you think?

  4. #29
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I have a complicated way of titles:

    [PAGEBREAK]TITLE HERE|TEXT HERE

    And this is the code (Thanks freddy):

    EDIT: Doesn't want to add the code?!?!

    -Peter

  5. #30
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    clever. what did you do for the first page? or does that one have no title.

    does it work if you miss out the title, for example if one section has 4 pages?

  6. #31
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    The first page is like:

    TITLE|TEXT
    [PAGEBREAK] TITLE|TEXT

    That is actually two pages there.

    And if I leave out the title, then the text is thte title unless:

    [PAGEBREAK]|Text
    The title, will be blank here.

    -Peter

  7. #32
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also use the pagebreak|title|text format. I think it's better to do it this way than to have a column in the database for each page.

    The only problem I have with my cms, is that sometimes the "<" character is processed as html and I have to put in the html code (lt) for it, other times it's fine and I don't have to change it. If anyone else experiences this, and knows a solution I'd be interested.

    I recommend that everyone that hasn't, try to setup php on their home computer, because it's much easier testing code offline than the hassle involved in uploading, testing then uploading again when the code doesn't work. I tried several times and was sucessful when php4.04pl1 came out for windows.

  8. #33
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Mine, all HTML is processed because this is how my CMS works.

    However, to show > and < I always use the code. Although, I could use a tag like:

    HTML Code:
     <html> stuff
    Which would work in changing it to or from html.

    -Peter

  9. #34
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pete, can you try posted that code freedy gave you again? would be really helpful.

  10. #35
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php

    // SPLIT PAGES UP AND DISPLAY SECTIONS


    $data = explode("[PAGEBREAK]",$text);

    foreach($data as $key => $val) {
    $tmp = explode("|", $val);
    $textarray[] = array ("title" => $tmp[0],
    "text" => $tmp[1]
    );
    }

    echo "<P><font size='2'><b><font color='#0066CC'>".$textarray[$page]["title"]."/font></b></font></p>";
    echo( "<font size='2'><P>".$textarray[$page]["text"]."</p></font>" );

    // PRINT PREVIOUS PAGE LINK
    ?>
    <table width=100% border=0>
    <tr><td width=50% align=left>
    <?

    if (count($textarray) > 1) {

    // SELECT BOX
    reset($textarray);
    printf('<form action="%s" method="GET" name="theform">', $SCRIPT_NAME);
    print "\n";
    print "<select name=\"page\" onChange=\"document.theform.submit(); \">";
    print "\n";
    foreach($textarray as $key => $value) {




    if ($page == $key) {
    printf('<option value="%s" selected>%s', $key, $textarray[$key]["title"]);
    print "\n";
    }
    else {
    printf('<option value="%s">%s', $key, $textarray[$key]["title"]);
    print "\n";
    }


    }
    print "</select>";
    print "\n";
    printf('<input type="hidden" name="aid" value="%s">', $aid);
    print "\n";
    print '</form>';
    print "\n";
    //END SELECT BOX
    }
    ?>

  11. #36
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool, thanks

  12. #37
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i see you do two explodes. I was sort of hoping it would be possible to do it in one but see why you can't now. I think something a bit different to a | might be needed as you might need that in an article? either way, thank you.

  13. #38
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some day, I'll change my page break to something like:

    [### [TITLE] ###]

    THen you won't have to worry about the |, but in articles when I need a | i use '|' , I then use a:

    $text = str_replace("'|'", "|", $text);

    And it all works out perfectly. It isn't very efficient, but until i work out how to do the [### [Title] ###] it'll have to stay like that. Plus, a problem is that, for that method, how would I make sure that there is not page break on the first page causing a compelte error.

    Peter

  14. #39
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i do like the idea of [### [TITLE] ###] but as you say the first page might be a problem, an extra field for the first page title in the article column possibility but that probably makes more work than how it currently is.

  15. #40
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Yup, I know it'll be more work, but I think, there must be a way to ignore it or something...I've started a thread on it, to try an work it out.

    -Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •