We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34022 ☆ A M B ☆
    • 91 Posts
    Hi everyone,

    I am still new to the forums and MODx, and this will be my first released addon, so I would appreciate any help and advice. I am working on a social networking website that will have a message and profile system similar to MySpace, Facebook, and Twitter. I couldn’t find anything like this that existed, and I saw other forum posts of people looking for something similar. I got something going that works great in MODx Revolution, so I want to release it as an addon.

    I don’t really know the process for getting the code up to snuff and released. Am I in the right place? What process should I follow to get the code released in a manner that other people can improve it if they want to? Since I use a lot of existing snippets, should I just release the new plugin and snippets and create a tutorial for piecing everything together? Or should I use PackMan to pack everything together as dependencies?

    Here’s the basic structure of the site:

    The friendly URL profile pages: (e.g. site.com/john, site.com/becky, site.com/john/messages, etc...)

    • Uses the existing Login and Peoples packages to register users, create lists of users, and handle all of the profile info.
    • Created a friendly URL plugin (loosely based on the Archive FURL plugin) that activates on page not found. www.sitename.com/username is the main user page, although any custom field can be used instead of the username. The plugin looks up the user and redirects to the resource ID specified in the system settings. www.sitename.com/username/action-name allows an unlimited number of actions, such as john/messages, john/profile, etc.... . All of the actions can be specified in a single comma-separated system setting. For instance: 123:messages,124:profile means that resource 123 is used when the URL username/messages is entered. The plugin also passes the action name if there is one, userid, and username to the resource as GET parameters.
    • On the actual user pages, I use the existing getUrlParam addon to get the username (or whatever is used to fetch the friendly URL) and action name and use these to generate breadcrumbs, canonical, and other links, since [tt][[*id]][/tt] doesn’t work. It would also be a piece of cake to make a snippet that generates the link instead.
    • I also use getUrlParam to get the userid as passed by the plugin. Coupled with the profile snippet from the Login addon (or the userinfo output filter), this fetches any information I need about the user.
    The message wall: (uses MODx’s default message system).
    MODx comes with a message table that already includes from, to, subject, message, date, and private. I just reused the existing system, with "public" messages showing up on the profile pages as a "message wall" and private messages only showing up as private communication between members.

    • I made a getMessages snippet that outputs messages. Optional parameters include recipient, sender, private (default: no), and sent (default: no). It is fully templatable with an output chunk (with message fields as placeholders). When used on the profile page, by default it outputs only the public messages sent to the profile owner (as "profile comments" by other people). If "sent" is marked as yes, it outputs messages sent by the sender. When the "private" parameter is marked yes, the snippet will only show the messages if the logged-in viewer is the recipient (for received messages) or sender (for sent messages). It also supports permissions settings.
    • I also made a formIt hook called formit2message. It creates a new message from the "subject" and "message" fields with the logged-in user’s userid as the sender, and (by default) the profile owner’s userid as the recipient. An optional private parameter specifies whether the message is a public post (default) or private message. At the end, it refreshes the page to view the new message.

    I will be adding more functionality as well, including automated notification sending, editing and deleting messages, and a bunch of user-specific settings, etc..., but some of that may require "extending" with custom database tables to avoid overusing the extended user fields already provided with MODx. How do I go about seeing if anyone is interested in developing this snippet with me? Where do I go from here?

    Thanks for any feedback!

    - Oleg
      WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area
      • 34022 ☆ A M B ☆
      • 91 Posts
      Anyone?
        WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area
        • 5956
        • 1 Posts
        Sounds really cool! Cant wait until it is ready for download!
        Have you already in use it ??
          • 31037
          • 358 Posts
          It’s a bit strange you don’t get any replys to such an interesting project. Sorry to say, I don’t have any good answers to give, but I would love to test your solution. Perhaps I could come up with some feedback. If packed with packman or just the source files in a zip file isn’t important for me at this time.

          I really hope some more experienced ppl give you some advise, your project would be a great addon to Revo.
            • 34022 ☆ A M B ☆
            • 91 Posts
            Awesome, thanks for replying! It has a lot of different parts, but I’ll try to clean it up a bit, pack it with PackMan, and write a small tutorial for the required pages and two required system setting (don’t know how to get those packed!). Should have something ready in the next few days.

            It is definitely working in its basic form on my in-development site, but it probably shouldn’t be used live just yet.
              WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              An example site / download would really spark a lot of replies. wink

              The theory looks great - would love to see how you put it in practice!
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 34022 ☆ A M B ☆
                • 91 Posts
                OK, here we go: I called it NetworkIt for now, since it depends on FormIt for a key function. I have attached a PackMan transport package to this post (completely untested though - let me know if it doesn’t work). I also wrote a set-up tutorial (must read) at http://websitezen.com/networkit.

                Again, I got it straight from the development site, and it has never been tested on any other site.This is definitely not ready to be used on a live site. And of course, there is still a huge to-do list. That said, you should get basic friendly URL functionality for user profiles and being able to post messages Facebook-style. If you don’t, please let me know, and I’ll repack it.

                I already told the client I would build a social networking website, which means I’m committed to seeing it through to a fully functioning component. I am still getting familiar with the more advanced features of MODx, though, and I will definitely need future help, particularly in scalability/caching and getting in nicely packed and extended. If anyone wants to add in some code, advice, comments, or bug reports, I would definitely appreciate it smiley.

                - Oleg
                  WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area
                  • 22840
                  • 1,572 Posts
                  This sounds fantastic, is there a working demo available ??
                    • 34022 ☆ A M B ☆
                    • 91 Posts
                    Can’t put up my current site until the site is released to the public. But I’ll put something up as soon as I get a chance on a separate site.

                    Also, I forgot to mention in the tutorial that there are two new permissions used by the component, one of which is required to send messages in the default configuration. Just added that to the tutorial.
                      WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area
                      • 34022 ☆ A M B ☆
                      • 91 Posts
                      OK, just set it up on a fresh install. Thanks for making me do it, because I found a few bugs in the tutorial. I’m going to repackage it in an cleaner package with page content packed in chunks, and I’ll re-write the tutorial.

                      In the meantime, here is the test url: flamebird.com. The login (usn, then pw) is:

                      modx
                      modxtest

                      Go ahead and log in and post messages. There are only two users on the site right now, and only one action (messages). Note: still a few bugs, as I set it up really fast. Will work them out soon. Everything seems to be working now on the test site. Let me know what you think.
                        WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area