Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0

    Wikipedia-like CMS


    Hi!

    I would like to ask if someone can give some guidelines about, what is the source code of a wikipedia cms.
    Actually I would like to create web site that has the form that resembles wikipedia. Namely, when drawing text from mysql table, how is it possible to format it with html tags. For example how can I draw something like this from a mysql text field:

    <h1> A title </h1>

    <p> Some text </p>

    <img src="some image" />

    <p> Some another text </p>

    and so on...

    If the answer is just to write those tags in the text field, than my next question is how can I filter which tags a user can use. Since the web portal is meant to be public portal. I have seen web sites where it stands: "... you can use this and this and this... tags...", but I don't have that knowledge of php to do it myself.
    If someone can offer some tutorial or link where I can find that I'd be grateful.

    Thanks...
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Mediawiki is open source, just download it and go.

    The answer to your HTML question is to invent a new kind of markup language like wikimarkup (or BBCode or RedditMarkup or whatever). Strip any HTML tags from the user input then match your own custom tags and translate them properly into their HTML equivalent.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    Originally Posted by ManiacDan
    Mediawiki is open source, just download it and go.

    The answer to your HTML question is to invent a new kind of markup language like wikimarkup (or BBCode or RedditMarkup or whatever). Strip any HTML tags from the user input then match your own custom tags and translate them properly into their HTML equivalent.
    OK, that's too much... What about something like this...

    http://www.kurir.mk/makedonija/vesti/143079-Noviot-klinicki-centar-%E2%80%93-kapitalen-proekt-za-cela-Makedonija

    I don't know how to split the text that I draw from Mysql... and in between insert pictures. In other words

    text...

    picture...

    text...

    picture...


    and so on.
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Have you read ManiacDan's answer? You don't split anything. You use a simpified markup language and then transform it into HTML.

    If you can't understand how that works, I suggest you postpone the CMS and start with an easier project. A CMS has many security implications, so you need to know what you're doing.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Alternatively, read the first part of my answer: THE SOFTWARE THAT POWERS WIKIPEDIA IS FREE
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    Originally Posted by ManiacDan
    Alternatively, read the first part of my answer: THE SOFTWARE THAT POWERS WIKIPEDIA IS FREE
    OK Thanks a lot!!!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    I started using BBCode. It offers great possibilities for formatting. But, still I have a problem. I can use only the basic tags, like [b]. I've read some tuts about how to enable other tags, but the code does not work. Will you please help on that issue?
    There's a .ini file mentioned in the tuts, but don't know what to do with it.
  14. #8
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Look, we don't have access to your computer, we haven't participated in your project, and we can't read your thoughts. We know nothing about your problem -- except that you wanna add custom tags to some unknown BBCode parser.

    If you want us to help you, we need info. What code are you using? What tutorials have you tried?
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    OK...

    So, I installed Pear on my local machine... Inside pear framework there are some classes that I use... So, first I started with HTML_BBCodeParser() class... and everything worked well... By the way I used tutorial from this link

    http://www.sitepoint.com/bb-code-php-application/

    This is the code:

    PHP Code:
    <?php 
        
    include('includes/title.inc.php');    
        include(
    'includes/connection.inc.php');
        include(
    'includes/init.inc.php');
        
        
        require_once(
    'HTML/BBCodeParser.php');
        
        
        
    $options parse_ini_file('BBCodeParser.ini');  
        
    $parser = new HTML_BBCodeParser($options); 
         
        
        
        
    //connect to MySql -- here comes the rest of the code that is not connected with this issue
    that is part of my code, where the reference to the class is made...

    But when I use this code I get this error message

    Warning: parse_ini_file(BBCodeParser.ini) [<a href='function.parse-ini-file'>function.parse-ini-file</a>]: failed to open stream: No such file or directory in C:\wamp\www\frequency+\article.php on line 10


    and


    Warning: Invalid argument supplied for foreach() in C:\wamp\bin\php\php5.3.13\pear\HTML\BBCodeParser.php on line 178


    When I use this code:


    PHP Code:
    <?php 
        
    include('includes/title.inc.php');    
        include(
    'includes/connection.inc.php');
        include(
    'includes/init.inc.php');
        
        
        require_once(
    'HTML/BBCodeParser.php');
        
        
         
        
    $parser = new HTML_BBCodeParser(); 
         
        
        
        
    //connect to MySql -- here comes the rest of the code that is not connected with this issue
    the text field that I am formatting is getting parsed...

    I think that's enough info... Or...

    By the way I am using WAMP 2.2 if that is important to say...
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,969
    Rep Power
    374
    error 1 is quite clear, its in ENGLISH "No such file or directory in C:\wamp\www\frequency+\article.php on line 10"..

    in your folder where this file is, do you have 'BBCodeParser.ini'?

    the second way you are using. i think


    $parser = new HTML_BBCodeParser(); line either takes in a path to the ini file or accepts some options as array.. you will have to read teh docs/code line BBCodeParser.php line 178 and figure it out since I dont have that package
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    Originally Posted by paulh1983
    error 1 is quite clear, its in ENGLISH "No such file or directory in C:\wamp\www\frequency+\article.php on line 10"..

    in your folder where this file is, do you have 'BBCodeParser.ini'?

    the second way you are using. i think


    $parser = new HTML_BBCodeParser(); line either takes in a path to the ini file or accepts some options as array.. you will have to read teh docs/code line BBCodeParser.php line 178 and figure it out since I dont have that package

    But I've tried with every possible location for the file... And same again...
  22. #12
  23. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,111
    Rep Power
    487
    remove the +
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    25
    Rep Power
    0
    Originally Posted by badger_fruit
    remove the +
    But that's the code name of my website frequency+, why would I remove it?
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0
    Originally Posted by viktorjano
    But that's the code name of my website frequency+, why would I remove it?
    This is the question I want to ask him!
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0
    There is no "Wikipedia CMS" but there are some nice scripts that will fit your needs.
    You can use WikiBlog, WackoWiki, or wodrpress wiki.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo