SocialEngine Blog

SocialEngine is the best way to create a unique community website. Let your friends, fans or customers geek out about anything you want.

ASK JOHN

Are you a developer wondering what might be possible with the SE framework?

For all of those burning questions about SE code, we present to you the most noteworthy of SocialEngine knowledge databases ever:

Our Engineer, JOHN. The Chief Architect of SE4.

We’re working to expand our Knowledgebase to make sure that you, our clients and third-party developers, have got information available to you when you need it. ASK JOHN will help you have a voice in that process.

Submit your questions here, and every few weeks we will feature a new article based on the best ones, along with remarks from our most remarkable of Johns.

Note: Support/Sales questions will not be answered here. This feature is designed to help you learn about SocialEngine’s nitty gritty insides. If you have a support question, please use the client area to submit a support ticket.

53 Comments

  1. Steve
    Posted February 1, 2011 at 12:37 am | Permalink

    Great. I'll start with two topic ideas.

    1. Search. How does Search code work and how can devs plug into the code to extend to 3rd party plugins and/or custom mods? Also, are there any expected changes to the Search code that may help improve its application/performance?

    2. CDN usage. What is possible with upcoming SE releases and what are best practices when delivering files via CDNs?

  2. David
    Posted February 1, 2011 at 1:47 am | Permalink

    Another great topic would be how to gracefully modify SE core code without breaking the system when the next upgrade is released. In an ideal world it would be best if the core code were never touched, but in reality this is often not possible. It would be great if there were a way to more easily extend core classes (then utilize those classes), or a mechanism like a "user" directory (that mimiced the core files directory structure) that could be used to hold "replacement" files for core files. Just possible ideas, but maybe you already have other ideas or ways to minimize breaking the upgradability of SE4. Thanks!

  3. Steve J.
    Posted February 1, 2011 at 2:54 am | Permalink

    Ok… there is one feature I am BEGGING you to incorporate into SE. I want to allow a group's moderator (or even an admin if need be) to be able to place a block of unique content on a group profile page. Essentially, it would be an html block that appears ONLY on that specific group's profile page – not universally across all group profile pages.

    Pretty please?

    Now, while you have me begging, there is one other thing I'd like to see. Rather than having members type in a name of a network (North America, South America, etc…) they would like to join, wouldn't it be SO much better if they were given either a dropdown selector or a checkbox list from which to choose?? Why must a user have psychic powers in order to have a clue what networks are available to join??

  4. Posted February 1, 2011 at 3:29 am | Permalink

    Hello John,

    On facebook, one can post a picture and use that thread on which the picture is posted to hold a lengthy discussion for days, even months, with no end to the thread. I run a group on facebook and I will be migrating that group over to the new social network community I just launched using SocialEngine software. Is it possible for SE to make that feature available the next upgrade?

  5. Charlotte
    Posted February 1, 2011 at 4:17 am | Permalink

    @Steve, @Trevor – This isn't meant to be a feature request forum – this is a space where developers can ask John technical questions about the code so that they can more effectively create useful plugins. The goal is to foster growth within the third-party developer community so they can create even more powerful tools for SocialEngine in the future.

  6. Posted February 1, 2011 at 4:52 am | Permalink

    This great initiative and thank you that. I have two question for now that want to how to do that:
    1. In the whats new text box there is option for add video,link,music , photo , i want to add another button for local virtual keyboard, by clicking that icon user will able to write status in their own language ( in our case it is "bangla"). I have java script to do that how can i place it below the status text box. please suggest

    2. while sending message to other user , i would like to give option for adding attachment from their computer (with file browse button), how can i do that?

    Please advise.

  7. Glenn Norvic
    Posted February 1, 2011 at 7:59 am | Permalink

    Hi John

    Is there a way to extract SE data (ex. display name, profile pic) and have them displayed from an external site (lets say a Joomla or WordPress site) – would PHP includes work, if so where could we start on those?

    Glenn

  8. Ian
    Posted February 1, 2011 at 10:40 am | Permalink

    A set of simple "How to basic's" would be hugely beneficial. Start simple for the 'junior developers' (such as I!)

    – Something that covers the use of Zend Framework, access database variables, initiate db connection
    – How to create a widget – what files are needed, what does each file do
    – How to create a module – what files are needed, what does each file do
    – Structure of the database – what's each table & field used for

    Then maybe some articles on the existing modules and widgets – how they work, what each file does/contains – so that anyone wanting to make modifications know's which files to edit!

  9. Carlos
    Posted February 1, 2011 at 1:03 pm | Permalink

    SE is so easy to use out of the box I rarely look at the code although I have lots of ideas.

    I would like to recommend something as a customer and user of SE.

    PLEASE, require 3rd party developers to meet a minimum quality standard of development, description of functionality, list price and delivery so that plugins can be cleanly integrated.

    Thanks

  10. Chris Moos
    Posted February 1, 2011 at 3:24 pm | Permalink

    @Stever R – Great questions. I really appreciate it since these are 2 of my main issues.

    I would like to ask about DB tuning, especially defragging and tuning tables.

  11. Rich
    Posted February 1, 2011 at 3:33 pm | Permalink

    Dear John,

    What IDE do you recommend for SE development and how do you recommend setting it up? Also, what's your preferred work flow for developing and deploying?
    I'd like to get away from hacking away at .php and .tpl files in a text editor and step up to a more robust development environment.

    Thanks,
    Rich

  12. Jeremy
    Posted February 1, 2011 at 5:52 pm | Permalink

    What is the best method for extending core features of SE without losing upgrade-ability.

  13. Paula
    Posted February 1, 2011 at 7:02 pm | Permalink

    Is there an API or integration to Magento, Volusion or another robust shopping cart?

  14. Posted February 1, 2011 at 7:08 pm | Permalink

    I would like to echo Jeremy M's comment about extending core without losing upgrade-ability.

  15. George
    Posted February 2, 2011 at 12:05 am | Permalink

    How does work the task "Clean Up" for orphaned files ? I noticed that orphaned files/photos still in the server and never are deleted.

    Thanks.

  16. Posted February 2, 2011 at 9:33 am | Permalink

    SE has been built in the best Object Oriented way possible, however this makes it very hard for us developers to modify core functionality without breaking the ability to upgrade.

    We developers want our clients to be happy after we are done, rather than being called by a stressed-out sysadmin who "broke" the SE install by updating.

    OO has been made for cleaner code, with a dedicated file for every action, but without the proper API documentation (and ZEND documentation) it is very hard for an experience PHP (and JAVA) Developer to know what is where, and what to change (or extend) in order to override some things.

    I've been trying to work on a plugin but the amount of searching (taking the Classifieds plugin as a base to learn from) in order to get things done is so difficult.

    Questions:

    1) What IDE is the SE team using and how are you performing tests (Zend server, or manual testing) ?
    2) Your code is documented properly (comments etc), why not have API documentation so you destroy the monopoly of knowing what goes where?
    3) WHy not use an "override" folder with core modifications.

    if (!empty("/application/override/overridefile")) {
    // inclde that file
    }

    This is the way that CodeIgniter does it, and you can easily upgrade packages without breaking core :)

    Thank you

  17. Ed
    Posted February 2, 2011 at 11:24 am | Permalink

    I would also like to echo Jeremy M's comments

  18. Posted February 2, 2011 at 2:13 pm | Permalink

    I would favor the point 'about extending the core without losing upgrade-ability.

    And second one most important tutorial (knowledge base article) could be "How to install third party software in subdirectory of SE4" like midiawiki, wordpress, forums or others.

    Or could be " How to integrate third party software (wiki, wordpress, blogs software, forums software) with SE4).

  19. Brian
    Posted February 2, 2011 at 4:06 pm | Permalink

    We are currently experiencing some growing pains that are directly related to our database instances. Socialengine by default does not let you split up the database reads from the writes. Is there something that maybe I am over looking that might allow someone to quickly point all writes to one host and all reads to another (or cluster)?

  20. Paula
    Posted February 2, 2011 at 5:30 pm | Permalink

    Is there an interface to PayPal Pro? How can we get this developed ?

  21. Danny f.
    Posted February 3, 2011 at 2:30 am | Permalink

    I would like to know if the current Tinymce editor can be changed to CKEditor? I know where the Tinymce main folder is but I need to know what files need to be modified in order for this to work.

  22. Posted February 3, 2011 at 11:23 am | Permalink

    hi what ecryption does socialengine use for passwords?

  23. Posted February 3, 2011 at 1:12 pm | Permalink

    I would like to know if Social Engine can be integrated with Janrain Engage platform. A native integration would have enormous value on Social Engine member acquisition and login/signup process.

    http://janrain.com

  24. Posted February 3, 2011 at 1:37 pm | Permalink

    I agree to Erik's comment. there should be a way to modify the core too but still keep the upgrade available to the client.

  25. SocialEngineHacks
    Posted February 3, 2011 at 10:27 pm | Permalink

    does socialengine has support for nginx server? do it perform well? Please elaborate and fill us up with more infos .. Thanks !

  26. Matt
    Posted February 4, 2011 at 7:02 am | Permalink

    How do you use hooks? I specially want to continue the sign up for with my own custom form. The form i have to create does a lot of stuff and i want to make it a separate plugin. Thanks.

  27. Simon H.
    Posted February 4, 2011 at 4:12 pm | Permalink

    I would also like to see a proper api documentation and some tutorials in how to create modules for socialengine.

    I.e. For Restful-Webservices

  28. Jon
    Posted February 4, 2011 at 9:21 pm | Permalink

    @Brian W.
    I believe a MSQL Cluster is what you are looking for.

    But, you could create duplicate databases and have random reads from those two or three Read-only databases. (Writing to the main database of course.)

    (On a smaller scale – would writing to two different mysql databases at the same time cause any problems/ slowdowns?)

  29. Posted February 8, 2011 at 8:44 pm | Permalink

    I have an internal service that generates XML files in a folder on our server.
    I need SE somehow to scan this folder in a pre-defined interval and send emails with the content inside the XML file.

    We have full control of the XML contents and structures.

    Please advise how can i do that?

  30. Rob Curry
    Posted February 17, 2011 at 9:53 pm | Permalink

    Hi John. Where in the code do you specify whether a module should use the code in an index.tpl file as opposed to a "layout editor" controlled page? I am tearing my hair out trying to find out where it is set!

  31. Jason
    Posted February 19, 2011 at 4:38 pm | Permalink

    I imagine quiet a large proportion of the SE community are not developers by trade and are starting up their site on limited resources. I would like to know how to set up SE4 for an 'entry level CDN'. When I say entry I refer to simply using subdomains to serve all static content including theme files, javascript, user uploads on separate subs. To summarise:
    How can I utilise separate subdomains for static content
    How can I expand that by actually hosting those files on another server

    References:
    http://www.riyaz.net/blog/how-to-setup-your-own-cdn-in-30-minutes/technology/890/

    Hope you help answer this!

  32. Donovan
    Posted February 22, 2011 at 6:29 pm | Permalink

    I was wondering if it was possible to have "patch" files instead of these upgrades that make my site go nuts. A set of files for the problem instead of doing the upgrade. I would have have a mod or small set of files to install say to fix the "mark as read" error instead of a large upgrade when installed I still do not know what the exact problem files is or error is really located in the files.

    The biggest options I would like to see on Social Engine 4 is an actual add rotation systems not the by click feature. If I could have a actual banner rotation and something that is possibly to add to all pages in layout editor would enhance my sites and allow me to sell banner advertisement. In my opinion no one wants to hear your banner ad will show for 10 clicks, etc.

    I also want my site to be public, but not allow the public to post anonymous on my sites. I do not know if this has been fixed by social engine 4 but this was such a headache when my sites where social engine 3.

    I used the import for social engine 4 from social engine 3 and it worked alright, but when I upgraded from SE 4.0.5 to Se 4.11 the upgrade killed my site. I would rather reinstall the software with upgrade as a fresh install on separate domain to make sure everything works then be able to import my site from the previous version of SE4

    Also I would like to edit my footer template, in SE3 we had the footer template, where is this located in SE4. I see the knowledge base has all sorts of ways to edit thru layout editor, but are there more tutorials that provide information like this to customize our sites. I like the layout editor, but my sites need to be something unique and this is hard to do when limited by the layout editor.

    Thank you for your time
    Donovan D. Denholm
    donovandenholm@aol.com

  33. Saad
    Posted February 27, 2011 at 5:48 pm | Permalink

    Dear JOHN,

    With respect i would like to ask you that can you please guide us how we can photo-album plugin and video plugin through into Amazon S3 CDN? as you claim that SE4 have some hidden CDN features please guide us and share some easy codes so we can implement in the files and utilized.

    I understand for the moment its very difficult for you to move everything
    on CDN via control panel but atleast these two big sections
    we can move and free our application to serve FAST and handle other large requests?

    Not only serving 200mb video file to user or 1900×1900 pixal photos

    Best Regards,
    SAH

  34. Posted March 2, 2011 at 8:38 pm | Permalink

    Please help me i really need help to solve this issue The problem is that i have lost all of my files on server , but i got back up of them so I'm trying to reinstall and use the same database information, but every time i try to type the database information it overriding the database, and i don't want that to happen i want use the same files on the database can you help to fix this issue please? and how can stop it from doing that?

  35. Donovan Denholm
    Posted March 18, 2011 at 5:20 am | Permalink

    John, Has anyone else been experiencing pop up boxes that collapse into either a crammed version of the current page or your profile. I had a member sign up and this happened along with a few other places on my site. Is there a setting I am missing, is there to have this open in a new page and not a pop up.

  36. Fedor
    Posted March 21, 2011 at 6:49 am | Permalink

    Hi, John! Please describe how to plugin can be completely uninstalled in SE4 (it can be disabled in admin panel, but not uninstalled). Thanks!

  37. Brian
    Posted March 23, 2011 at 4:16 pm | Permalink

    Hi John,

    I am sure that it is possible to access and interact with multiple tables in a module. I just cannot figure out where.

    So my question is….

    How would I open, select from and insert into a non module specific database table using the same values that are sent to the module specific table?

    example: if I join a network, it also automatically places me in the group that shares the same title as that network.

    Is that something that you can answer on here?

  38. Posted March 28, 2011 at 5:11 pm | Permalink

    @John:
    I am not sure if others have similar experience; I notice the site statistics is not the same as google analytic. the site stats will show more pages view than google analytic. Could you please explain such discrepancy?

  39. Larry
    Posted May 18, 2011 at 1:36 pm | Permalink

    John,
    My question is what is the structure of the User Directory under Public when users starts using the site.
    In V3 it took the form "/users/1000000/1000/username" but i am struggling to see the logic in V4, as teh structure seems "random" and by that i mean "/users/random letter".
    Can you clarify please

  40. Posted June 5, 2011 at 1:16 pm | Permalink

    Hi John,

    I would like to know 2 things:

    1. How do i get tinymc to work in the Message text area of V4.x
    2. I have bought the ImageManager plugin for Tinymc so that i can upload pics from my PC on the pages when usign groups etc….my question is how easy or hard is it to integrate them.

    A response will be greatly appreciated

  41. Michael
    Posted June 14, 2011 at 6:16 am | Permalink

    HelloJohn,

    With respect I would like to ask you that can you please guide me how to change file uploading path to Amazone EC2/ any other location except default location. Browse last days for a solution but nothing helps :-(

  42. luke
    Posted June 22, 2011 at 8:28 pm | Permalink

    what echo code prints the users profile url as im making a widget and want to wrap profile link around image this is for widget thanks

  43. Mara
    Posted June 23, 2011 at 12:47 am | Permalink

    @Michael Version 4.1.6 will include support for external storage such as Amazon S3. This version is due for release later today.

  44. Mara
    Posted June 23, 2011 at 12:51 am | Permalink

    @Luke:

    $userObject->getHref() if it's internally in the site, 'http://' . $_SERVER['HTTP_HOST'] . $userObject->getHref() if it's outside the site

    You can get a user object by ID with Engine_Api::_()->getItem('user', $user_id);

    You can get a user on its profile page with Engine_Api::_()->core()->getSubject();
    publish

  45. Blinky
    Posted September 9, 2011 at 1:42 am | Permalink

    Hello John,

    I've been trying to render the ad-campaign widget using code such as this:

    echo Engine_Api::_()->content()->renderWidget('core.ad-campaign', array('adcampaign_id' => 16));

    So far I've been unable to get it to output anything. I tried variations on this but nothing's working.
    There must be some basic aspect of MVC programming I'm missing here.

    Sure would appreciate it if you could point me in the right direction. Thanks.

  46. Mark
    Posted September 26, 2011 at 11:56 pm | Permalink

    Hi John,

    Once I've created a subdomain – images.domain.com.

    Which file (if possible) do i modify to change the directory path for any image uploads?

    Thanks,
    Mark

  47. dalip singh
    Posted October 7, 2011 at 2:40 pm | Permalink

    Hi John,

    In social engine 4 all the content is accessible to guests , even without login, they can see photos and videos , which is quite good. But when if import social engine 3 to social engine 4 , then all this content needs login or sign up to view them. i want photos videos and all other content to be visible even without login, and after importing social engine 3 . how can i fix this?

    thanks.

  48. Victor
    Posted July 25, 2012 at 5:33 am | Permalink

    Hi John,

    I have created an extra field for mobile phone numbers during sign up, but I now need to change the sign up database query to include these changes. Which module or file is responsible for handling the Social Engine database queries. Thanks.

  49. Mnaoj
    Posted August 19, 2012 at 11:59 pm | Permalink

    Hi John,

    I am a developer and working for my client, my client want to show updates which is showing on header, he want to show i left-side, plz suggest me that How can be possible to show updates without toggal in left side.

    thanks
    Manoj
    soyaljpr@gmail.com

  50. Sohail Ansari
    Posted December 7, 2015 at 9:50 pm | Permalink

    Hello,

    I am making plugin for Social Engine 4.8.9 and I want to add script and link tag inside tag, How can I do that and where should I write the code. And also provide me with method for executing database query.

  51. Shivani
    Posted December 8, 2015 at 1:11 am | Permalink

    Hi Sohail, if you want to add a script under head tag, you can simply do that from Admin > Settings > General Settings > ‘Head Scripts/Styles’ field. If you want to append any meta tags under then you can do that in your template file (.tpl) in the same way as we’ve appended description and keywords tags at line no. 68 in file “/application/modules/Core/layouts/scripts/default.tpl”.
    For executing database queries, we use Zend based functions in our modules. You can explore our core modules to see different functions used there and work accordingly. Hope that helps! Thanks.

  52. Sohail Ansari
    Posted December 8, 2015 at 3:11 am | Permalink

    Hi Shivani,

    Thanks for your reply, as I am making plugin so I want it done by the code. So can you please explain how can I do that from code and in which file can I write to achieve that?
    Thanks in advance!

  53. Shivani
    Posted December 8, 2015 at 3:39 am | Permalink

    Hi Sohail,
    You can use below code in the .tpl file to append a script under tag where SCRIPT_CODE is the actual code of the script that you want to be include:

    $this->view->headScript()->appendScript(“SCRIPT_CODE”);

    If you need any further assistance, please try filing a support ticket and contact our support team. Thanks!

Post a Comment

Your email is kept private. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>