Pragmatism in Code

Michael Percy AKA DeeEmm - Waxing lyrical about life the universe and everything software related...

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that has been used in the blog.
  • Login
Subscribe to this list via RSS Blog posts tagged in Joomla
This tag contains 9 private blog which isn't listed here.

I have recently migrated a site from Dolphin to JomSocial and needed to modify the way that the activity stream was displayed to visitors. By default the replies and likes of activity stream posts are only displayed to friends of the original poster. This means that the comments are very limited in their reach.

The overall effect of hiding activity stream comments and likes from guests is that this valuable activity is wasted. I wanted to show this activity to guest visitors so that they could see how active the site is. This in turn encourages them to join and hopefully encourages them to comment. 

Of course, this may not be suitable for all sites, but in the case of this site, there was no activity that is 'secret' or 'private'; the activity stream is public viewable, and so should be the comments.

The modification you need to do this is pretty straightforward, it simply involves removing or commenting out two lines of code. 

Modification Instructions

open the following file...

components/com_community/templates/YOUR_TEMPLATE/activities.index.php

Look for the following line of code at around line 223

<?php if( $allowComment ) { ?>

Replace it with the following

<?php //if( $allowComment ) { ?>

Next look for the following line of code at about line 263

<?php } ?>

Replace it with the following

<?php //} ?>

 

This simply comments out the lines. You can also opt to delete them completely if you wish.

Now your activity stream will display comments and likes to visitors as well as all members. The only caveat to this is is that if you are logged in it will display the 'reply' link but will not allow you to actually reply unless you are a friend of the original poster. What happens when you are not a friend of the original poster and you try to post a reply is that you will simply see a popup message box saying 'permission denied'. There are two ways that you can deal with this. These are as follows.

1. Change the message.

To change the message to something a little more meaningful you can do the following...

Edit the file components/com_community/controllers/system.php

At around line 1460 look for the following code...

$objResponse->addAlert('Permission denied');

Simply change this message to something else - for example...

$objResponse->addAlert('Only friends can reply');

 

2. Allow non-friends to post.

If you want to let anyone be able to post to the Activity stream you can do the following...

The easy way...

Enable the following setting in the admin panel

components > jomsocial > configuration > site >  activity > allow everyone to comment

 

The hard way...

Find the same line mentioned above, but this time replace it with the following code...

			$table =& JTable::getInstance('Wall', 'CTable');
			$table->type 		= $act->comment_type;
			$table->contentid 	= $act->comment_id;
			$table->post_by 	= $my->id;
			$table->comment 	= $comment;
			$table->store();

			$cache	= CFactory::getFastCache();
			$cache->clean(array('activities'));

			$comment = CWall::formatComment($table);
			$objResponse->addScriptCall('joms.miniwall.insert', $actid, $comment);

			CFactory::load( 'libraries' , 'notification' );
			$params		= new CParameter( '' );
			$params->set( 'message' , $table->comment );
			$url			= 'index.php?option=com_community&view=profile&userid=' . $act->actor.'&actid='.$actid;
			$params->set( 'url' , $url );
			$params->set( 'stream' , JText::_('COM_COMMUNITY_SINGULAR_STREAM') );
			$params->set( 'stream_url' , $url );


			CNotificationLibrary::add( 'profile_activity_add_comment' , $my->id , $act->actor , JText::sprintf('COM_COMMUNITY_ACITIVY_WALL_EMAIL_SUBJECT' ) , '' , 'profile.activitycomment' , $params );

Now anyone can reply to any post in the activity stream. Additionally anyone can also post directly to another users profile page. cool huh?!?

 

NOTE

 

Well I guess that this modification will not be for everybody, but if like me you have a community site this might just increase your activity.

/DM

Hits: 5145
Rate this blog entry:
0
Continue reading 2 Comments

After restarting work on the migration script a few weeks back I have made great progress on getting it finished. I have gone through a few revisions and am now on version 0.10. The bugs are slowly getting addressed and the end is nearing.

The current version 0.10 is still in progress. I'm currently working on migrating the group forum posts into the discussion section of each group, but this is proving to be harder than originally anticipated. Still to go before I release the next version are to migrate articles, navigation structure and IBDW Spywall entries. I finally decided to migrate Spywall posts as the user profile pages look very bare. Plus the transition from old to new will be a lot smoother for members.

One major change is that I decided to flip the way that the migration is carried out. Originally I opted to install JomSocial and copy the Boonex files into a sub directory. However, after some thought I decided that it would be better to do the opposite. Now the migration is carried out by installing JomSocial into a sub directory. This means that you can get the whole migration up and running before going live. It also allows you to easily retain or switch between both sites by using htaccess rules.

The other major change is to move away from the corePHP Wordpress plugin and use EasyBlog. EasyBlog is much more user friendly and comparable with Wordpress on a basic level. OK so it doesn't have the plethora of plugins available to Wordpress, but on a community site this is probably a good thing. I do Have one JomSocial site that uses the corePHP Wordpress plugin, and whilst it works well, it is generally too complex for most users to get their heads around. If anyone really wants / needs a specific blogging platform I would be happy to write a custom script, although I would not do this for free.

I have addressed most of the issues with the previous release including the video and photo sections. All videos, both embedded and uploaded are now supported. Groups are migrated as are events, forums and groups. I have also added messages to the migrator. Although my own site does not really utilise the messaging function, there would be plenty that do. 

One nagging issue that I have not been able to fix relates to the forums. There is a bug that means a small amount of posts are not being converted from HTML into the BBcode that the forum uses. This means that the HTML tags display in the posts. I've stared at this particular issue for so long that I now have code blindness. It only happens to longer posts and almost seems to be an issue related to REGEX or database limitations. For the time being I've decided to focus on the outstanding issues, and leave this issue until later.

Once the basic migration script has been finished I will then look towards writing some code to allow htaccess redirects for the moved content. This is really important for SEO and retaining any rankings that you may have already amassed. The redirect script will utilise both htaccess rules and a custom php script to lookup the new data and return the correct link with a 301 (permanent) redirect. This will also allow any hot linked images or videos to still work.

At the moment I'm throwing all of the time that I can at getting the script finished as I want to migrate my remaining Dolphin site to JomSocial. Timeframe for the finished article including redirect script is probably still at least a month away, although a fully functional migration script will hopefully be closer.

Anyhows, Here's the changelog...

/DM

 

Version 0.10 (so far)

21.06.12
- Improved forum migration
- Kunena setup (categories to be enabled - add viewing permissions) 
- Fixed group avatars 
-

Version 0.9
20.06.12
- Fixed Video migration

Version 0.8
08.06.12
- Improved video migration
- Updated Photo migration
- Reformatted script to work from subfolder of dolphin installation
- Added groups migration
- Added easyblog integration
- Improved Forum migration
- Added Message migration
- Added Sites migration

Hits: 4815
Rate this blog entry:
0
Continue reading 2 Comments

First steps

Posted by on in General

If you are one of those visitors who is expectantly waiting for the release of the Dolphin to Joomla migration script, you will be happy to know that things are moving along nicely and the script will be released before the end of the month. In preparation for this imminent release I have started to prepare the documentation for the installation, including the scope of operation and the requirements for getting it up and running.

The documentation will be provided in a series of articles in the tutorials section which will walk you through the whole process in a step by step manner. It will also cover the setting up of Joomla and Jomsocial, as well as providing installation help for the required third party modules.

The first of these articles is now available to view and is an introduction that covers what you can expect from the migration. To view the article visit...

http://www.deeemm.com/resources/tutorials/60-dolphin-to-joomla-migration.html

Long time dolphin frustratee's will be pleased to learn that the migration utilises the excellent Wordpress script for the blogging component, and includes the world class forum script 'Kunena'. Photo's videos, events, messaging, profile customisation including widgets and the mandatory activity wall are all standard core components in JomSocial. Mix this up with a few free modules from the Joomla Extensions Directory and you have a site to be reckoned with.

So if are getting impatient, why not take a read through the first article, and maybe even install a test installation of Joomla and Jomsocial to have a play about and familiarise yourself with how it works.

/DM

Hits: 1553
Rate this blog entry:
0
Continue reading 0 Comments

Give a man a fish and he will eat for a day

Posted by on in Latest News

It's very nearly here. The Dolphin 'Fish Script' to JomSocial migration script is just around the corner.

To continue on with the theme so affectionately adopted by Boonex, I have decided to give the script a nautical name. So with respect to Jules Vernes Twenty thousand leagues under the sea I have named it the Nautilus.

For those of you who have been patiently awaiting me to pull my finger out and get the script written, you will be happy to learn that I only have a few more tables to migrate and it will be finished (after testing of course).

So, just to raise the tension a little, and build the anticipation (in the best Boonex style - LOL)

Watch this space...

Hits: 997
Rate this blog entry:
0
Continue reading 8 Comments

Dolphin to Joomla (JomSocial) migration

Posted by on in General

It's been a while since I've finished the Geeklog to Joomla (JomSocial) migration, and with a new update released by Boonex, I've decided that it is about time to look at migrating my sites away from the Dolphin platform.

With even a mildly modified site, Dolphin updates are usually a nightmare. It is rare that something does not break, or mess up in some manner, so I've decided that instead of wasting time updating third party addons to work with the new Dolphin core, it is much more cost and time effective to write a migration script.

The target platform will be Joomla, running the JomSocial component. This is a comparative product for those who are using Dolphin as a community site, and pretty much, all standard modules have an equivalent Joomla component.

At the moment the project is at the drawing board stage, but the basic outline is complete.

The migration script will be available as either a stand alone component that you upload to your WSP, or potentially as a Dolphin module. In either case it will be driven via a web interface, allowing you to tailor it to suit your own needs.

Migration will be provided for standard Dolphin modules, and also some of the major third party modules, such as the IBDW Wall module.

One small issue relates to password migration. As previously discussed in THIS THREAD the password handling in Dolphin is a little different to Joomla, and due to the encryption used, it is not possible to perform a direct migration of password fields. This is something that can be handled in several ways...

Mass password reset.
Forced account reactiviation
Modification of Joomla core to use Dolphin encryption
Auto password creation based on existing Dolphin data.

Of the above methods, the last method is something that I am currently looking into. In essence, when the user logs in, the password is checked against the values stored in the Dolphin database, if it matches, then the password is added to the Joomla database in the correct format. This process is transparent to the user, who simply uses the logon process as normal.

To adopt this method correctly I need to create a Joomla authentication module, so that the passwords can be verified. However, this means that the module needs to be installed for it to work, and additionally the Dolphin database needs to be available.

Ultimately, whatever method is used for password migration or re-creation, there will be a compromise to be made.

The project will be developed in stages, this is simply due to time availability. The results will then be released in one package, allowing migration to be carried out in one step.

Hits: 3218
Rate this blog entry:
Continue reading 12 Comments

Migrating from Geeklog to Joomla

Posted by on in General

[UPDATED!]

Now that the New Year is under way, I've turned my focus back to the Joomla project that i have been working on. This is the migration of an existing Geeklog site over to the Joomla (JomSocial) platform. The basic site design and functionality has now been finalised, and the next stage is to start migrating the existing data across.

The migration away from Geeklog is due to the lack of development on both the Geeklog and GLFusion platforms. Although there have been releases in recent times, these have been little more than security updates. GLFusion promised to take Geeklog into the current Web 2 age, but after over a year, it has failed to really pick up any momentum, plus, with many features missing from the core and requiring non-existant third party plugins, the decision was made to migrate away from Geeklog, to the better supported Joomla.

Unfortunately, it does not appear that many (any) have trodden this path before, and so i was not able to turn up any suitable info from the usual Google, search. This meant a bit of DIY hacking to get the data migrated. I did manage to find enough info on user authentication to be able to figure out how to migrate the users across without needing to get users to change passwords, which is a boon for a site like this one, which has some 1600 odd members.

I've now completed the migration process, and decided to document what I have done, to assist those who may want to do the same. I will release this in several tutorials, each dealing with a separate aspect of the migration, which is basically how I have tackled the job.

User migration (Geeklog to Joomla / JomSocial)

Forums migration (Geeklog to Kunena)

Gallery migration (MediaGallery to JomSocial)

Blog migration (GL Journal to MyBlog)

Stories migration (Geeklog to Joomla)

The Geeklog site is version 1.5.2, but I believe the process will work the same for the current 1.7 version and also the spin off GLFusion port. The Geeklog set up uses the MediaGallery plugin (MG), which is now an integrated part of GLFusion. We had previously migrated from 4Images to MediaGallery, so the same upgrade path is available for those wishing to migrate image info. Other plugins that we are running are GL Journal, a blogging plugin, and the standard GL forums, which have been migrated to Kunena.

First tutorial, is migration of the user data. Once performed, your users will be able to log into the Joomla / JomSocial site with their existing Geeklog credentials. You can find the article in the tutorials section or by clicking the following link

http://www.deeemm.com/resources/tutorials/53-joomla-how-tos/201-joomla--jomsocial-import-users-from-geeklog--glfusion.html

Second tutorial is migration of the Geeklog forums into Kunena.

http://www.deeemm.com/resources/tutorials/53-joomla-how-tos/203-joomla--jomsocial-import-forum-from-geeklog--glfusion-into-kunena.html

Third tutorial is migration of media gallery

http://www.deeemm.com/resources/tutorials/53-joomla-how-tos/204-joomla--jomsocial-import-user-galleries-from-geeklog--glfusion-media-gallery-mg.html

The final tutorial covers how to convert Geeklog stories into Joomla articles

http://www.deeemm.com/resources/tutorials/53-joomla-how-tos/205-joomla--jomsocial-import-stories-from-geeklog--glfusion.html

Tagged in: Geeklog Joomla Migrate
Hits: 2796
Rate this blog entry:
0
Continue reading 0 Comments

Joomla 1.5.18 Released

Posted by on in Latest News

XSS Vulnerability addressed.

Joomla 1.5.18 has recently been released and includes a security update to fix a core XSS vulnerability. All Joomla users are advised to upgrade. More details about the vulnerabilty can be found on Joomla's developers board HERE.  If you wish to stay abreast of the latest security announcements and updates for Joomla, you are advised to keep a check on the Joomla Developer Vulnerability News Feed.

 

More information on the 1.5.18 release, including the downloads can be found on the product release page - HERE

/DM

Tagged in: 1.5.18 Joomla Released
Hits: 1153
Rate this blog entry:
0
Continue reading 0 Comments

Times a Changing

Posted by on in General

The site migration is pretty much finished, with just a few small odds and ends to fix up. One of the things that I have left to do is to add in some re-directions for the old content. When moving content it is always a good idea to redirect visitors to the new location with a 403 error response to the users browser. This will in turn be trawled by the web crawlers and your new location duly noted. As the old content locations followed the navigation structure of the old site code, I can add in one or two rules in my htaccess file using mod_rewrite and regex to redirect users from specific areas of the old site.

You may have noticed that the new site no longer runs from DMCMS, and whilst I do feel more than a little guilty about this, I simply did not have the time to integrate shopping carts, trouble ticket systems, forums and user handling into the DMCMS core. It was much quicker and easier to use existing products. Plus, the idea with DMCMS is that it is a simple and easy to use CMS, so integration of additional third party software does not fit with the idea behind it.

The online store is now up and running, although there is currently only one product (DMCMS) this is just for testing purposes. I will add in the premium mods as I develop them. All mods are instantly downloadable on checkout. There are one or two mods for Dolphin 7 already in the works, with more planned to come.Purchasers of premium mods also get access to the helpdesk system for dedicated support.

There are free mods available from the Resources > Tutorial section, this is basically the 'How To' section from the old site, that has now been categorized, I will add hints and tips here as I get time. There are a bunch of mods I developed for Dolphin 6 that I need to convert into proper mod format. My ultimate idea is to strike a balance between free mods and paid mods.

Long term visitors will remember that we used to run PHPBB forums here a few years back, but these were closed down due to spammers (there were more spammers than users - lol). Well, we now have new forums, both for the support of DMCMS, and also for supporting the mod community and the products and services we offer here on deeemm.com. If you would like to see a particular category considered, just let me know.

One of the best new features, and the main feature for DMCMS version 8, is comments. If you check below this post, you now have the ability to leave me a reply, this is something that I should have added to the site years ago, as my ramblings would probably have been made a little more interesting with the input of others. So, don't be shy - leave a reply ;)

There's still other stuff to do, the demo site still needs to be put back up and running and the links pages need to be transferred, which I will hopefully be tackling over the next few days. If there are any articles missing, or info that you cannot find, please let me know and i will track them down for you.

DM

Hits: 1330
Rate this blog entry:
0
Continue reading 0 Comments