DeeEmm

Pragmatism in code

Pragmatism in code

Waxing lyrical about life the universe and everything software related since lunchtime 2006.
DeeEmm AKA Michael Percy is an industrial software engineer specialising in language based programming. A long time supporter and contributor to the open source community, he can mostly be found tinkering about creating web sites and writing code for various CMS platforms as well as maintaining several websites of his own.

Dolphin - Hide Menu Bar from Guests

If you would like to completely hide the menu bar from non-members, then this is the mod for you.

Edit

templates/base/scripts/BxBaseMenu.php

Find

Continue reading
  9429 Hits
  5 Comments
9429 Hits
5 Comments

Dolphin - Redirect users after editing profile

If you would like to redirect users to a different page after editing their profiles, then make the following changes.

Edit

pedit.php

Find...

Continue reading
  6548 Hits
  0 Comments
6548 Hits
0 Comments

Dolphin - Auto membership level on join

If you would like to automatically apply membership levels to new members, then this mod is for you.

This can also be useful when wanting to differentiate between different member groups - ie - making all female members of a female only member group. Both methods are shown below.

in profile_activate.php

Find

Continue reading
  4808 Hits
  4 Comments
4808 Hits
4 Comments

Syntax highlighting code in TinyMCE

After a recent tutorial a member mailed me to let me know that the code snippets were not displaying correctly. A quick look told me that this was due to my use of the pre tag, which prevented the text from breaking when it reached the bounds of it's containing element.

The fix was relatively easy - add the following hacks to force the text to wrap for pre formatted text...

word-wrap: break-word; /* Internet Explorer 5.5+ */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: pre-wrap; /* css-3 */

But this got me thinking, and jarred my memory to something I was working on a little while back.

I had previously taken a look at syntax highlighting for WYSIWYG editors, this was for use in the DMCMS project where i wanted to allow full editing of template files from within the Admin panel. This is something that I had implemented on an earlier development version but had then abandoned. (For some reason that i can no longer remember)

Continue reading
  7101 Hits
  0 Comments
7101 Hits
0 Comments

Dolphin - Show Group / Events latest forum posts

If you would like to add a block to your Group or Events home pages that displays the latest forum posts , or maybe add a block to the home page for your site, you will need to do the following.

Go to

Builders > Pages Blocks > Groups Home

or Main Events Page for the events page

Continue reading
  8201 Hits
  0 Comments
8201 Hits
0 Comments

Dolphin - Add search by country to Groups

To add an extra search field to your groups - for example 'Country' do the following.

Edit

/modules/boonex/groups/classes/BxGroupsFormSearch.php

Find

Continue reading
  3758 Hits
  0 Comments
3758 Hits
0 Comments

Dolphin - Hide custom pages from non-members

Dolphin is not very good with permissions, as a result it is impossible to assign permissions to individual pages. So if you have created some custom pages for your site that you only want to display to logged in members, you will need the following hack...

Edit

viewPage.php

Find

Continue reading
  3268 Hits
  0 Comments
3268 Hits
0 Comments

Dolphin - Record user Name and ID with IP address

You can (fairly) easily record the userid along with the ip address by adding an extra field to the database table and modifying member.phpHere's how...Add the following fields to the sys_ip_members_visits table in database

ALTER TABLE `sys_ip_members_visits` ADD `UserID` INT( 10 ) NOT NULL

ALTER TABLE `sys_ip_members_visits` ADD `UserName` VARCHAR( 30 ) NOT NULL

 

Continue reading
  6252 Hits
  11 Comments
6252 Hits
11 Comments

Dolphin - Change landing page after login

If you want to direct members to a page other than the standard dashboard page (member.php) after they log in, then follow these simply steps.

Edit member.php

Find the following code

if(!$sUrlRelocate = $_REQUEST['relocate'] or $_REQUEST['relocate'] == $site['url'] or basename( $_REQUEST['relocate'] ) == 'join.php' ) $sUrlRelocate = $_SERVER['PHP_SELF'];

Change it to...

Continue reading
  7419 Hits
  0 Comments
7419 Hits
0 Comments

Dolphin - Remove 'unregister' Links

To disabled the un-register buttons on your site - go to admin > builders > navigation builder and un-check both member and guest check boxes from the unregister link. This will prevent it from being displayed in the top menu and the quick links menu.You will then need to also get rid of the link from the members menu too.To do this you will need to edit your database - look in the sys_menu_member table for the entry named Dashboard - Then you will need to edit the PopupMenu field - simply remove the following text, leaving the rest intact

    'unregister' => array(        'url'     => 'unregister.php',        'icon'    => 'memeber_menu_sub_unregister.png',        'caption' => _t( '_Unregister' ),    ),

Then delete all files in cache folder except for the .htaccess file.

Refresh and enjoy.

/DM

  6225 Hits
  2 Comments
6225 Hits
2 Comments

FREE RMS Service

For those of you who have been using Dolphin for a while, you will remember that Boonex used to offer a free RMS hosting service for it's free licenses. This service has long since been discontinued, leaving users to either ensure that they find a combined Web / RMS hosting package, or look for a third party RMS host.

Smoge over at ModMySite, has recently introduced a free RMS hosting package on their own servers, for small low bandwidth sites. There are also a variety of paid packages that should support all sizes of sites from small to large.

ModMySite, are a long time Dolphin support site that has been around since the original days of AEDating, way back in 2003, so they certainly know their stuff.

If you're interested in ModMySites RMS services, click HERE

Continue reading
  3997 Hits
  0 Comments
3997 Hits
0 Comments

Add Youtube video button to TinyMCE

Not strictly a Dolphin modification, as it applies to TinyMCE in general, but I will outline it here for Dolphin 7. It's a pretty easy modification to do, just two files to edit.

The functionality for this is already in TinyMCE, but for some reason it is not enabled. I've tested this out on version 7.0.2 with no issues.

To enable YouTube /flash video button in the forums

Edit

Continue reading
  13098 Hits
  4 Comments
13098 Hits
4 Comments

Dolphin - Remove big join button from promo

There are a few different ways of removing the join button from the promo banner. The method you use will vary depending on your requirements. You can even change the location that it navigates to.

Here's a few different methods.

 

Remove (hide) button via CSS

Continue reading
  6060 Hits
  0 Comments
6060 Hits
0 Comments

Dolphin - Remove checkboxes from keyword search page

If, like me, you do not like the massive long list of checkboxes at the top of the keyword search page, removing them is pretty simple.

Edit the following file...

searchKeyword.php

At about line 97 look for the following text...

Continue reading
  4677 Hits
  0 Comments
4677 Hits
0 Comments

Boonex Blogs Gone

Well, maybe the title is not strictly true, but for all intents and purposes, the user blogs over at Boonex Unity are now dead. Andrew Boon, in his infinite wisdom, has decided to remove the user blogs from displaying in the blog index, leaving this solely for Boonex team posts. Whilst there is (some) merit in this, from a commercial perspective, it leaves the user blogs with no index, and no way of knowing if there is a new post.

So whilst the blogs still exist, you now have to navigate to each blog individually, via each members user profile to view them. Needless to say, I cannot imagine anyone bothering to post any more.

It's ironic that the focus on the community at Boonex has always centered around their core philosophy of 'Unity', it seems that this is far from uniting people, in fact I woud go as far as to say that it has the opposite effect.

If I were to be blatantly honest, I think that it is Andrews way of dealing with opinions that do not agree with his. I am probably one of the contributing factors in this respect, as i have often made very pointed statements in the Blogs, but if you do not want people to have opinions, why have blogs in the first place? I guess that is what has now happened.

Continue reading
  3180 Hits
  1 Comment
Tags:
3180 Hits
1 Comment

Increasing server memory limit

If you are experiencing memory issues with scripts, it may be necessary to increase the memory available to the script.

If you have access to your servers php.ini file, this is relatively straightforward -  simply increase the value of the memory_limit directive to 128M then restart apache. However, I'm guessing that if you're reading this post, looking for a solution to memory issues, then the last sentence probably made little sense, and chances are that you do not have access to your servers php.ini file - this is true for most shared servers.

If you do not have access, all is not lost - you can override the value in either a custom php.ini file, or via the htaccess file - the method needed depends on the following:

If PHP is compiled to run as a cgi script then you will need to use a custom php.ini, but if it is compiled to run as a module then you will need to use htaccess. (tip - you can view your servers php_info() to find out which one)

Continue reading
  3210 Hits
  0 Comments
3210 Hits
0 Comments

Dolphin 7 - Increase text size in comments box

If you have the tinymce editor enabled for comments boxes, and you wish to increase the size of the text, then you will need to do the following.

To alter the size of the text in the comments area - if you have tinymce enabled for comments.

Edit /tinymce/themes/advanced/skins/default/content.css

look for the following element

Continue reading
  5104 Hits
  0 Comments
5104 Hits
0 Comments

Dolphin Tag Converter

If like me, you used the migration tool to transfer your Dolphin 6 based site over to Dolphin 7, you will notice that there are some things that need a little tweaking. One of these things for me was the tags.

On D6 tags could use a space as a delimiter, but on Dolphin 7 the space is ignored, this is to allow multi word tags. What this effectively does is create massive long 'tag words' out of those tags that were entered without using a comma as a delimiter in D6.

The following code reads the tags and splits them up if more than one word is detected. it then deletes the original entry and creates a new entry for each word detected using the original data. Single word tags are ignored

$sql_query = mysql_query("SELECT * FROM `sys_tags`");

Continue reading
  3846 Hits
  1 Comment
3846 Hits
1 Comment

Boonex Dolphin Security Vulnerability

It seems like this week is a bit of a strange one so far. Not only is it National Cyber Security Awareness Week here in Australia, but first the Boonex site suffered a massive DDOS attack and then my own dolphin site suffered a similar fate. I believe that the two events are probably coincidental, as the attack on my site was not particularly well formed, and was easily defeated - most likely just some kiddie with a script. I managed to get the service that the attack was coming from terminated due to a violation of the providers TOS - they're probably in big trouble with mom and dad now. The attack on the Boonex site continued over the weekend, and there are still some services out of action.

I believe that the main source of the attack on my site was to take advantage of the exploit recently published on Boonex's site, and reported about here on DeeEmm.com in an earlier news article - http://www.deeemm.com/news/154-dolphin-7-security-vulnerability-exposed.html Whilst the noise about this issue seems to have been muted a little, after the attack on my site I am pretty convinced that the solution given by Boonex is no solution at all.

The main crux of the problem was claimed to be the DB_FULL_VISUAL_PROCESSING or DB_FULL_DEBUG_MODE settings, which caused the debug backtrace to be echoed directly to the browser in the event of a fault. Boonex's comments were simply that these were disabled by default and so the issue was a non-issue. This glaring oversight caused an obvious embarrassment to those who made the claims that the issue was with the DB_FULL_VISUAL_PROCESSING setting, this then caused them to promptly back off a little.

Whilst Boonex's solution has seemingly pacified the masses, it does not address the initial issue - that the debug back-trace is getting echoed to the browser in some error situations. The fact is that the issue has been reported by many, and until now no one had been sure of a definite cause, unfortunately the DB_FULL_VISUAL_PROCESSING setting was little more than a red herring, and whilst easily dismissed by Boonex, their solution does not actually fix the issue.

Continue reading
  5128 Hits
  0 Comments
5128 Hits
0 Comments

Dolphin Forum - Show Expanded Categories

Here's a quick hack to get the forum categories to display as expanded by default on the forum home page.

Edit modules/boonex/forum/classes/Forum.php

Search for the following...

            if (( isset($p['cat']) && $p['cat'] == $r['cat_uri'] ) /*|| 1 == $r['cat_id'] */)            {                $this->setTitle ($r['cat_name']);                $c .= ''.$this->getForumsXML ($r['cat_uri'], 0) . '';            }

Comment the following lines

Continue reading
  5412 Hits
  0 Comments
5412 Hits
0 Comments