Jump to content

GuruMeditation

Members
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by GuruMeditation

  1. Hey, steady on, tiger, let's give it a try.

    I just installed the module on a fresh 2.7.2 install (Basic profile) and followed the instructions in the repo and everything installed beautifully. I also created rough root, forum and topic pages, just for testing.

    The first thing puzzling me is that I also added a new PW role 'member', expecting to give that role 'create topic' and suchlike privileges, but, to me, the config options in the backend aren't coming up where I'd expect them (at subforum level), but at topic level. And there's no sign of my 'member' role being offered the chance to do anything. Is there something I have done wrong?

    I would like to spend some time giving whatever help I can to help make this work.

    Hi DaveP,

    Firstly, it's worth noting that I have changed the module slightly, including the names of some fields etc, so this version will be incompatible. It will be released as LiteBB rather than HermodBB, hence the reason I requested for this thread to be deleted. However, thanks for your feedback. I would assume that your problem is related to the incorrect template being used for your sub-forum? What template is your sub-forum page using? It should be using HBB Forum (hbb_forum).

    What I will do is release the code for updated version which is more or less the same, but doesn't include the code for the replies or comments as this will most likely be released as a separate module, or you can use Ryan's Comments module if preferred.

  2. Does anyone else consider polls to be a good idea for future PW development suggestions?

    My idea would be for a moderator to open a topic for a month or so, allowing all forum members to make suggestions regarding which features they'd like to see in PW. All suggestions would then be added to a poll, allowing the votes to begin. Then the data from the votes could be passed on to Ryan to give him an idea of what people need, or want on a majority-vote basis.

    I know it's down to Ryan at the end of the day, but surely if there was a majority vote from the users of PW and this forum, it would be logical to take the votes and figures into consideration?

    Just a thought.

  3. Hi all, as some of you will know I have been working on a forum solution. My initial code wasn't really talked about so I decided to split the code into two - code for the BB and code for the page-based comments module.

    I have been working on a page-based comments module over the last day or so, but I wanted to know if anyone else is interested? If so, what data would you want to store? So far I have the following:

    ip
    user_agent
    comment_content
    votes
    stars
    likes

    If you're wondering why I would want to create a page-based comments module when we already have Ryan's FieldType, then the answer is simple. A page-based module makes it a lot easier to extend to the novice. If you want to use CKeditor, then it's easy enough to achieve with a page-based version.
     

    • Like 1
  4. I thought I'd list a few suggestions that I feel could be useful additions to the comments field. I know most of this can be done via the API, but these additions would make it easier :)
     
    Moderation:
     
    It would be nice if we could have role-based moderation settings. In other words, the ability to set up stricter moderation settings for less trusted user roles (roles created for new members etc), and more lenient settings for trusted members (moderators, editors). The same could be applied to the spam settings. That way comments made by trusted user roles could be automatically posted, while other roles could be checked for spam etc.
     
    Text Formatters and Inputfield Types
     
    Although I'm aware of the security implications, it would be nice to have the option to choose text formatters and the type of field, i.e plain text area or CKEditor etc for the text field.

    Again this could also be based on role-based settings - trusted users could use CKEditor while untrusted users could be limited to the standard plain text editor.
     
    Comments form
     
    Easier form customisation, i.e to be able to choose which fields are displayed. If members are logged in, do we need the e-mail address field showing? A simple comment box and submit button would be fine.
     
    Also, the additions made to FormBuilder regarding CSS Frameworks were great, and I'd love to see it extended to the comments form.

    // prepare a form for output
    $form = $forms->render('comments');
    
    // in your document <head>
    echo $form->styles;
    echo $form->scripts;
    
    // somewhere in your document <body>
    echo $form;

    And voila, a UIKit comment form.

    • Like 2
  5. The best way I've found to understand it all (apart from asking questions on here) is to create a test site, create a few pages, templates and fields and then to have a look at the database structure via phpMyAdmin. You will quickly understand what a page, field etc actually is, and you will also realise how simple and efficient PW is behind the scenes.

    • Like 1
  6. I was thinking about splitting this into two modules. One that's responsible for the forum setup and topics and another for the comments. The comments module would be a page-based comments module. This would then give the option to use either Ryan's Comments Fieldtype, or this page-based version with the main forum module for topic replies.

    Edit: Since I released the source code, there's not been any feedback, so I assume my code is bad. For that reason, I'm going to commence with my above suggestion and split the module into two manageable pieces of code, starting with the comments module. This thread can now be deleted as I will no longer be releasing it as HermodBB.

    • Like 2
  7. Can't you just do this?

    $selector = ("page=$page, sort=-created, start=$start"); // Comment selector
    $comments = FieldtypeComments::findComments("comments", $selector); //comments is the name of the field
    
    foreach($comments as $c){
      // Only output those with 5 stars
      if($c->stars == 5) {
        echo "Stars = " . $c->stars .
             "<p> By: " . $c->createdUser->name . "</p>".
             "<p> Comment: " . $c->text . "</p>";
    }
    
    • Like 1
  8. I'm making a page-based comments module which will have the same sort of flexibility as the rest of ProcessWire, though it'll be a bit before I've got it finished (and some projects have to come first). But this page-based comments module should support nearly anything you could want to do with it, without having to modify its core code.

    Just out of curiosity, did you finish the page-based comments module? It sounds really interesting.

  9. Ok, after a quick crash course with Github, I managed to upload the module for testing. I've included my test templates which should give an idea of how to use the module. I use UIkit for testing, so that's the markup you'll find in the templates.

    Obviously this is early code and has only been tested by me, so don't use it for anything other than testing. The module does NOT sanitize, so you need to ensure you have sanitized your message before you use the topicSave() or commentSave() methods. Documentation is nonexistent, but the module is fairly straight forward and I can help where needed.

    So, thoughts, issues, insults? Does it have potential? and if anyone wants to add to it etc, please let me know.

    Link removed - HermodBB is now discontinued and is now being developed as LiteBB. I will update the thread with further information.

    • Like 3
  10. For me, this looks good. If this is a module and it creates all the required fields and templates and handles data / pages, what is missing?

    This is a lot! ^-^

    If you have the possibility to upload this into a GitHub repo, this would be a good start to test, if someone will laugh, :)

    I don't think so. But maybe others start to use it and contribute a bit here and a piece there. Who knows?

    ^-^

    I will upload it to Github this week for people to try. I'm just cleaning up the coding errors I decided to implement while drunk over Xmas :-X  Also I'm not totally familiar with Github, but I should be able to get something useful up before the weekend.

    • Like 4
  11. My approach works with a page "tags" (or categories... as you want, also sub categories are possible) and a page "topics". All children of tags are used to build the forum structure (page reference) and replies are saved as children pages of the topic page. So forum structure is  separated from the forum contents (topics and replies) which was important for me. And all contents (topics and also replies are just pages (do you use the comment module or also pages for replies?).

    The idea is to have no dependencies, so a fresh install of PW would provide everything needed. Replies are stored as pages under a sub-page called "Comments". I've followed along the route of topics and comments so that comments (or replies) can also be used for other pages throughout a site.

    This image explains it more:

    Tree.jpg

    The module installs all the required fields and templates expected for a basic forum, it's then up to the user in regards to the markup and how to sanitize the data etc. It doesn't really do much more than that, other than to obviously save the data through custom methods.

    I have some code as stated previously, but I'm afraid people will laugh at it, as I know a lot of people on here could easily do a better job.

    • Like 3
  12. Ii is kind of hard to answer such a broad question. Maybe we should narrow it down to something managable?

    And of course this "already have been asked and answered" a number of times.

    pwFoo seems to be persistent in building modules related to this problem.

    It has indeed, and I have read most of the threads, and I commend pwFoo for his efforts with the modules. This was more about a resource of links and general info for the convenience of front-end developers.

    In my opinion the biggest hurdle here is building the forms and processing their inputs. There are various tools trying to solve that part, but personally they've never fit my workflow to stick. Also, while processwire does have a forms api, it's not meant to be used in the frontend and therefore does only solve this issue partly.

    I couldn't agree more. I'd love to see it expanded further in the future to make it easier for newer users.

    I have to say that the form API works pretty well in the frontend. I have several sites where I use it without issues. Once you get the hang of it, it is actually quite nice to interact with.

    Only thing I am missing is a more easy way than the current to get more control over the rendered markup. Formbuilder comes to the rescue here. If I remember correctly, when UI framework support was introduced to formbuilder, Ryan stated that the core functionality was altered to easier support UI frameworks.

    But I never found any hints on how to easily alter rendering of form markup (especially field wrapper's markup and attributes) other than through hooks.

    Nevertheless, I agree that it would be nice to have a docs section dedicated to this topic. Or at least have a link collection to relevant forum posts that deal with frontend forms, processing and saving of input values.

    Links I can come up with quickly:

    https://processwire.com/talk/topic/2089-create-simple-forms-using-api/

    and, of course, Soma's great gists (big kudos)

    https://gist.github.com/somatonic/5011926 (build and process generic forms from page templates)

    https://gist.github.com/somatonic/4027908 (build and process forms manually with API)

    https://gist.github.com/somatonic/4150974 (upload images)

    https://gist.github.com/somatonic/5415646 (form with fields in table)

    https://gist.github.com/somatonic/5233338 (manual form markup with file upload handling)

    Thanks for that, I'll add the links to the OP if that's ok? I did purchase the Form Builder module mainly to support Ryan, but haven't really spent a lot of time with it.

  13. I think PHP Trends gets its data from github. So if we get some significant grow in likes in the latter, we will get to PHP Trends mainpage.

    I had no idea. I do however know it's a nice simple and clean resource for finding new scripts and software. I've found a lot of handy tools on there that I knew nothing about previously. I like unbiased sites.

  14. A collection of links and information for front-end development.

    Front-end forms

    Create simple forms using the API

    https://processwire.com/talk/topic/2089-create-simple-forms-using-api/

    Gist code for the above link

    https://gist.github.com/somatonic/4027908

    Build and process generic forms from page templates
    https://gist.github.com/somatonic/5011926

    Build and process forms manually with the API
    https://gist.github.com/somatonic/4027908

    Upload images
    https://gist.github.com/somatonic/4150974

    Form with fields rendered in a table
    https://gist.github.com/somatonic/5415646

    Manual form markup with file upload handling
    https://gist.github.com/somatonic/5233338

    Form Builder (module)

    Building front-end forms on your website has never been so simple. ProcessWire Form Builder lets you create, edit and publish forms with no development necessary.

    http://modules.processwire.com/modules/form-builder/

    Front-end member management

    FrontendUser: login, logout and register users / members (module)

    https://processwire.com/talk/topic/9811-frontenduser-login-logout-and-register-users-members/

    Member login, logout, password reset

    https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919

    Popular front-end UI frameworks

    UIkit

    http://getuikit.com/

    Semantic UI

    http://semantic-ui.com/

    Foundation

    http://foundation.zurb.com/

    Bootstrap

    https://getbootstrap.com/

    Materialize

    http://materializecss.com/

    Skeleton

    http://getskeleton.com/

    Original post

    I'm just wondering if anyone is willing to help out with a resource/tutorial page for front-end development? By this I mean a resource for those wishing to develop sites that only allow their users to access the front-end.

    My first topic would be to talk about the pros and cons of PW in regards to front-end development. I'm not referring to the API, I'm referring to front-end login forms, front-end page creation etc and how the process could be made simpler? The front-end edit addition to PW 3 is a great start, but I'd love to see it extended to easy front-end page creation based on back-end pages. 

    Thoughts? ideas? I'd like to create a page or thread that contains an up-to-date resource with code snippets etc.

    • Like 8
  15. Sorry for being extremely stupid, but does anyone know what .....

    'list' => "<div {attrs}>{out}</div>"

    .....equates to in regards to UIKit? This is the list components for UIkit, but I'm confused as to how that converts to the above. Is there any further documentation on this?
     
    As for sanitizing, as I now understand, the code you posted checks that the form input values are valid, i.e username must be a certain length etc, but we then have to sanitize it with $sanitizer->name($value) before saving etc?

×
×
  • Create New...