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 D7
This tag contains 4 private blog which isn't listed here.

Sitemap Generator Updated

Posted by on in Latest News

The DeeEmm Dolphin 7 Sitemap generator has just been updated. The update addresses an issue where multiple URLS are included within the sitemap.

Some configuration parameters have also been added to make it easier to customise the output.

Links from each module can now be easily enabled / disabled from appearing in the sitemap.

Updating is simply a case of overwriting your old sitemap.php file.

You can download the sitemap generator for free from our store - http://www.deeemm.com/store.html?page=shop.product_details&flypage=flypage_no_button.tpl&product_id=20&category_id=5

/DM

Hits: 1854
Rate this blog entry:
0
Continue reading 4 Comments

Dolphin 7.0.3 on the horizon | More free MODs

Posted by on in Latest News

A new blog post by Andrew Boon over at Boonex, has finally announced the upcoming release of 7.0.3. Whilst there is still no commitment to a date, it is scheduled for the beginning of August. This is great news, as for a moment it almost looked like Boonex had forgotten about Dolphin, I was almost certain that the next announcement from them was going to be the release of Trident.

It's good to see Boonex continuing to follow their promise of more regular updates, and whilst I may be very vocal over at Boonex.com about a monthly release cycle, the truth is, anything is better then the year waited for D7, especially when you consider the failure that it was bug wise. As with any of these interim releases, bugs have to be prioritised, so not everyone will get what they want, but give it time and all bugs will eventually get fixed.

It will be interesting to see what kind of balance between bugs and features there are. I personally think that the bugs should have a higher priority than features, but I guess that Boonex policy differs form this, as there are generally some new features released with every update.

New Improved Orca

Of interest to me is the promised updated Orca, I'm keen to find out what updates have been made to the code. The Blog announcement states...

...in 7.0.3 you're going to see a seriously improved Forum. We removed unnessesary AJAX effects, streamlined the UI, added moderation features and some basic forum features.

Hopefully the code should have now been updated to follow the new module format, as it's the only module that currently does not integrate into the core correctly (it is more of a tacked on bit of code than a true module).

At present my own Orca project (codenamed FRED) is on hold until the updated version is released. if there are still features missing, i will integrate the current mods into the new Orca core and continue with development.

More Free MODs

On a different note, I have decided to release the remainder of my premium mods for free. This means that the TinyMCE Browser mod is now available for download, for both D6 and D7 versions. If you have yet to try this, it's a very worthwhile MOD as it allows users to directly upload images and files for use within blog and forum posts.

With the release of my other mods a short time ago, there are now quite a few useful MODs to augment your Dolphin install. I will continue to release other modifications as I write them, generally I now release them as tutorials, as packaging them up as full mods takes up too much time.

In the pipeline...

Many of you will know that the MODs I write are generally developed for use on my own sites and then released for the benefit of all. As I still have a few things that I want to develop for my own sites, such as SEO optimisation and a mail handler to allow users accounts to send and receive eternal emails (I already have a basic test version of this running), there are still a few things in the pipeline.

The SEO MOD will take the form of an additional special 'invisible' block that can be added to any page via the page builder. This will allow extra meta data to be added to any page. Hopefully the use of this coupled with my sitemap block will help improve SEO rankings.

The Mail handler MOD allows users to utilise a This email address is being protected from spambots. You need JavaScript enabled to view it. type email adress, by redirecting a catchall for subdomain emails to a script. This script then decodes the received emails and delivers them to the users inbox. At the moment this is very much an experimental feature that i am still evaluating. I have the code set up on one of my test sites, which works perfectly. My plans are to expand this to allow users to post photos and videos, directly to their account via email.

At this stage I am not sure whether to allow the posting of messages to external email addresses. This is a great feature if not abused, but the possibility that users can use the feature for purposes such as spam, and other less than welcome uses is something that I need to weigh up. I will keep you posted of the progress.

/DM

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

If you do not want a new window opening when you click on links in RSS feeds - such as the forum feed, you will need to do the following.

Edit

/inc/js/jquery.dolRSSFeed.js

find two instanced of

target="_blank"

replace them with

target="_top"

/DM

Tagged in: D7 Dolphin 7 RSS
Hits: 2143
Rate this blog entry:
0
Continue reading 0 Comments

If you want to hide advertising banners from non members - do this...

Edit

/inc/banners.inc.php

Search for

return $out;

Replace it with

if (islogged()){
   return $out;
}

Thats it!

/DM

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

The sites module in Dolphin sometiumes does not create the thumbnail, often refreshing the page fixes this. To display a simple tip to your members about this do the following...

Edit

/modules/sites/classes/BxSitesFormAdd.php

find

 

            'inputs' => array(
                'url' => array(
                    'type' => 'text',
                    'name' => 'url',
                    'caption' => _t('_bx_sites_form_url'),
                    'required' => true,
                    'checker' => array (
                        'func' => 'length',
                        'params' => array(1,100),
                        'error' => _t('_bx_sites_form_field_err'),
                    ),
                    'db' => array(
                        'pass' => 'Xss'
                    ),
                    'display' => true,
                )

change it to

 

             'inputs' => array(
                'url' => array(
                    'type' => 'text',
                    'name' => 'url',
                    'caption' => _t('_bx_sites_form_url'),
                    'required' => true,
                    'checker' => array (
                        'func' => 'length',
                        'params' => array(1,100),
                        'error' => _t('_bx_sites_form_field_err'),
                    ),
                    'db' => array(
                        'pass' => 'Xss'
                    ),
                    'display' => true,
                ),                
           'Tip' => array(
'type' => 'value',
'caption' => 'Tip',
'value' => 'After you hit submit, a thumbnail should automatically be created.
If you do not see it - refresh your browser.',
)

/DM

 

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

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

return $this->sCode;

Change it to...

if (islogged()){
return $this->sCode;

All Done!

 

If you also want to hide the stripe that the menu bar resided in - you might want to also add this to your template...

div.sys_top_menu {
min-height:0px !important;
}

Of course YMMV depending on template etc.

 

/DM

Hits: 3904
Rate this blog entry:
0
Continue reading 6 Comments

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

Edit

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

Find

$aCategories = $oCategories->getCategoriesList('bx_groups', (int)$iProfileId, true);

Add After

$aCountries = $oProfileFields->convertValues4Input('#!Country');        
$oProfileFields = new BxDolProfileFields(0);

Find

'inputs' => array(
'Keyword' => array(
'type' => 'text',
'name' => 'Keyword',
'caption' => _t('_bx_events_caption_keyword'),
'required' => true,
'checker' => array (
'func' => 'length',
'params' => array(3,100),
'error' => _t ('_bx_events_err_keyword'),
),
'db' => array (
'pass' => 'Xss',
),
),

Add After

'Country' => array(
'type' => 'select_box',
'name' => 'Country',
'caption' => _t('_bx_groups_caption_country'),
'values' => $aCountries,
'required' => true,
'checker' => array (
'func' => 'preg',
'params' => array('/^[a-zA-Z]{0,2}$/'),
'error' => _t ('_bx_groups_err_country'),
),
'db' => array (
'pass' => 'Preg',
'params' => array('/([a-zA-Z]{0,2})/'),
),
),

Add the following language keys -

_bx_groups_caption_country -> 'Country'

_bx_groups_err_country -> 'please specify country'

The same principle applies to any predefined lists, but an additional modification will need to be made to BxEventSearchResults.php to process the new search field.

/DM

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

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

$sPageName = process_pass_data( $_GET['ID'] );

Add underneath

(be sure to change YOURPAGE to the name of your page!!)

 

if ($sPageName == 'YOURPAGE' && !isMember()){
$oSysTemplate->displayAccessDenied ();
}else{

Find

} else {
   $oSysTemplate->displayPageNotFound();
}

Add Underneath

}

That's it.

 

 

Enjoy

/DM

 

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

You can (fairly) easily record the userid along with the ip address by adding an extra field to the database table and modifying member.php

Here'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

 

Then search for following line in member.php

$sInsertSQL = "INSERT INTO `sys_ip_members_visits` SET `From`='{$sCurLongIP}', `DateTime`=NOW()";

Replace it with

$aMemberInfo = getProfileInfoDirect($member['ID']);
$sUserName = $aMemberInfo['NickName'];

$sInsertSQL = "INSERT INTO `sys_ip_members_visits` SET `From`='{$sCurLongIP}', `DateTime`=NOW(), `UserID`='{$sUserID}', `UserName`='{$sUserName}'";


Now edit inc/classes/BxDolAdminIPBlocklist.php

Find

{$sFromC}{$sDatatimeC}

Change it to

IDUserName{$sFromC}{$sDatatimeC}


Find

$sLastDT = $aIPList['DateTime'];


Add After

$sUserID = $aIPList['UserID'];
$sUserName = $aIPList['UserName'];


Find

$sTableRes .= "{$sFrom}{$sLastDT}";

Replace it with

$sTableRes .= "{$sUserID}{$sUserName}{$sFrom}{$sLastDT}";

All Done!!

Now the userid will be recorded with the ip address and displayed in the table on the admin page.


Hits: 3602
Rate this blog entry:
0
Continue reading 22 Comments

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...

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

Where profile.php is the page to redirect to.

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

Dolphin Tag Converter

Posted by on in Dolphin 7.0.x Modifications

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`");

while($sql_result = mysql_fetch_array($sql_query))

{

$sTag = $sql_result['Tag'];

$sObjID = $sql_result['ObjID'];

$sType = $sql_result['Type'];

$aTag = explode(" ", $sTag);

if (count($aTag) > 1){

mysql_query("DELETE FROM `sys_tags` WHERE `Tag` = '{$sql_result['Tag']}'");

foreach($aTag as $sNewTag) {

mysql_query("INSERT INTO `sys_tags` (`Tag`, `ObjID`, `Type`, `Date`) VALUES ('$sNewTag', '$sObjID', '$sType', '{$sql_result['Date']}') ") or die(mysql_error());

echo 'new tag ' . $sNewTag . ' created
';

}

}

}

You will need to decide how you deploy the code - I downloaded the sys_tags table from my site and created a test database on my local test server with it, then I simply added a database connection to the above code it and ran it locally. I then uploaded the resultant table back to my sites database.

Please make sure you make a backup before running this script, as once the values have been modified there is no way to go back.

/DM

 

 

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

Dolphin 7 Security Vulnerability Exposed

Posted by on in Latest News

It would seem that this weekend has been an active time in the CMS community for security vulnerabilities, first Joomla issue a patch for a potential XSS issue, and now Boonex's Dolphin package has been raising some eyebrows with, an as yet unresolved security issue that exposes the database name, username and password, in plain text to the browser via a verbose error report. This report is triggered by any number of bugs, and could easily be used to compromise a website or server.

The security 'hole' had previously been reported and raised as an issue with the Dolphin developers, who's response was that it had been addressed. Amusingly this seems not to have been the case, with the latest attention being that the bug has now been witnessed on the Boonex admin test site, and the resulting full error report published. - http://www.boonex.com/unity/forums/topic/Hey-BoonEx-Notice-Something-.htm There is some further discussion in the blogs as well - Major Security Risk: Information and Temporary Solution

The community were quick to act, with a couple of suggested workarounds published on modmysite - http://www.modmysite.com/general-issues-comments-questions/10491-db_full_visual_processing.html#post39764 as well as on the Boonex site, but there has been no official response.

As of the time of this post, some three days after the original post, Boonex have still yet to comment, and there has been no official patch available to address the issue.

The security flaw raises the question of the validity of the security audits that were supposedly conducted on Dolphin 7 and 7.01 prior to release, and certainly brings into disrepute those that conducted it.

If you are currently running Dolphin 6 or 7 use the following instructions to address the issue (fix courtesy of Smoge at modmysite)

Below are instructions including what file to check, 
and what to change, to avoid this situation.
Dolphin 7.0.x (inc/classes/BxDolDb.php)
Dolphin 6.0.x and 6.1.x (inc/db.inc.php)

Look for the value, near the top of the file, like:

define( 'DB_FULL_VISUAL_PROCESSING', true );

It should be set to:
define( 'DB_FULL_VISUAL_PROCESSING', false );
Making this change will prevent users from seeing debug
information (some sensitive) in the event your site has
a database error.

/DM

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

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

            //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) . '';
            //}

Now go to the forum home page and compile the language by clicking the compile link.

All done...

Enjoy

/DM

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

Dophin 7 TinyMCE Browser MOD updated

Posted by on in Latest News

The DeeEmm Dolphin Tiny MCE Browser modification has now been updated to work with the new Dolphin 7.0.1 release.

This release is a compatibility update, There are no additional features or bugfixes included.

If you have previously purchased the 7.0.0 version, you will be pleased to know that you are entitled to a free update. If you would like a copy of the updated files, please email me and i will send a copy out to you.

As usual, support for purchasers of our premium modifications are all entitled to access to the help-desk for priority 1-on-1 support. General support, bug reports, and feature requests can be posted to the forums.

/DM

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

Dolphin 7.0.1 and beyond

Posted by on in General

The latest release to Boonex's CMS system - Dolphin 7, has now been out on the wild for some time. Released at Christmas, the much anticipated Dolphin 7 was to be heralded as the latest in web tech, offering an advanced platform for social networking sites that was far ahead of the competition. With several public beta releases, the anticipation was fueled by the glimpses offered in each release, building up the expectations to a massive level. Also adding fuel to this fire, was the long overdue update and bugfix release due for Dolphin 6. As a result, Dolphin 7 had a lot to deliver.

With the release of Dolphin 7 finally made a year later than expected, it was unleashed into the public with a massive amount of issues, over 300 bugs to be precise. This left the Dolphin community a little abashed, with many users having stuck with Dolphin, through the extended development period, now feeling disappointed. Lots of these users had put development plans on hold, with the expectation that the promised release would be the answer to their needs.

It is now a further 5 months down the line, and the recent update release 7.0.1 has addressed many of the problems that plagued version 7. The problems are not completely fixed however, and there are still many issues surrounding how development and releases are handled, but it seems that Boonex are moving in the right direction with a shorter release cycle, and prioritisation of bugs addressed for each release. I previously touched on this issue with one of my blog posts over at unity - http://www.boonex.com/unity/blog/entry/Product_release_cycles

Based on past performance at Boonex, and anticipating the issues and extended wait with version 7, when it was originally announced, I decided to stick with version 6  - This is a choice that i am glad i made. Not only as the expected release date slipped way beyond the original estimate, and there were more issues than even I anticipated, but also as it has meant that I have managed to build my user-base over the past year, and develop the community for which the site serves.

6.1.6 to 7.0.1 Migration

So with the 7.0.1 release, I decided that it was actually time to take the plunge and update my Dolphin 6 site. The 7.0.1 release is not without it's issues, but in comparison to a standard 6.1.6 installation, they are probably about on par. My main apprehension with the update was that i would be losing some premium modifications - purchased mods that definitely enhanced the user experience, these, plus many other minor mods and bugfixes that I had carried out myself - amounting to over 60 mods in all.

Ultimately, i decided that the additional features offered by the new version, and the overall improvement in the interface was worth the trade off for the few premium mods that I would lose.

I tested an update to the new version 7.0.1 direct from version 6.1.6 using the migration module, but found that there were a few fields not transferred - so I decided to reinstall version 7, perform the migration, and then update to the new 7.0.1 version. The migration was straightforward enough - and once you had manually fixed the update package, the update was also relatively painless.This has now given me a working 7.0.1 site, but this is not without some issues that needed to be addressed.

There are additional steps that you will need to do manually to completely transfer over your Dolphin 6 site to version 7. Most of these relate to missing database data - data that is present and can be converted, but for some reason is missed. I manually had to transfer the following

  • Links are not converted to Sites
  • Photo and video view counts are not transferred
  • Tags are not transferred correctly
  • Quotes not transferred
  • FAQ / About / Privacy pages not transferred
  • Additional user created pages not transferred
  • Subscribers not transferred
  • Old mass mailer emails not transferred

So far the site seems pretty stable, and with a few tweaks to the standard template does not look too different to the old site. I've already started to redo the mods that I previously had in place on the old site that have not been covered by the new version 7 features, and will be releasing these in the marketplace as I get around to documenting them.

So what do I think?

Well - those of you who frequent Unity, will already know my thoughts on how Boonex handle development and releases, so I will not repeat them here. My main issues with the 7.0.1 update are that whilst an issue was discovered with the upgrade package, it was not addressed, the package is still being shipped with the problem plus a convoluted set of instructions on how to circumnavigate it. To me this is not a very professional way of handling the problem, especially when you consider that some users have paid nearly $1000 for licensing.

For me - I take Dolphin at face value - I do not consider it a mature product, and so I expect it to have problems - an expectation which is unfortunately met tenfold. I get the feeling that Boonex is trying very hard to be a market player, by portraying a professional image, and largely acting like one, but time again it lets itself down with actions like the faulty update package - not an issue in itself - but an issue because it has not been dealt with in a professional manner. This unfortunately extends to the rest of the development too.

The software itself still has some way to go. It embraces a few web2 technologies such as employing the excellent jqeury framework and a generous splattering of Ajax, which whilst improving the overall user perception of the product, is in my eyes a little overused. It's almost comparable to the abuse made to the internet by the blink and marquee tags some 10 years ago - they key to implementing enhancements like these is simply to know when to stop, if it does not add value (ie Ajax exchanges that take longer then page loads, or amateurish looking sliding page masks) then it simply should not be included.

Overall Dolphin brings together the key elements of a good community into one product, but whilst the integration of each element has been executed quite well, each individual element on it's own is little more than average - and this is despite the attempts to dress them up with Jquery animations and the like.

This is also not an observation that is isolated, it is one shared by quite a few of the Unity forums regulars - users that have even undertaken integrations of third party elements to bring Dolphin up to what they consider a more usable product.

The perception of quality all depends of course - on what your particular community requires - for my site it suits fine, but of course your mileage may vary.

Would I recommend this product?

if you are webmaster with some coding skills, that doesn't mind getting their hands dirty on a regular basis - then Dolphin is great - it is a very 'hands on' package - there is generally always something to fix / improve, but for the fact that it needs work to get it 100% overall the product is a good one. In this case - yes I would recommend it - but don't expect to have a great dolphin site without quite a bit (months) of work, and a few headaches trying to figure out the 'spaghetti logic'.

However, If you were to ask me if i would recommend this to my clients - I would say no. Simply because it is high maintenance, and would probably require many post installation visits to address the issues that my client discovers - not a good business plan - even if I am getting paid to fix the issues.

I would also suggest that a stable mature Dolphin is still some way off, and so issues should still be expected for the next few releases. My guess is that it will take at least six months to a year to iron out all of the bugs, by which time the focus would likely have shifted to the already mentioned Dolphin 8 - leaving Dolphin 7 to take a seat next to Dolphin 6 - unfinished and unloved.

So, would I change from using Dolphin for my own site?

At this stage I would say no. I simply have too many hours invested in it, and there is no direct migration path to a comparable product. There is also the fact to consider that my site is a relatively small specialist community site, it is not high traffic, and does not earn money, so there is very little disadvantage from the occasional issues that arise. But this may be a different story for a commercial site.

For me - for the time being, I will stick with Dolphin, but if you are a new user considering it for the first time, my advice is simply to make sure that you approach it with your eyes wide open, if you know what to expect, you will not be disappointed.

/DM

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

If you would like to hide the flash promo from displaying to logged in members all you have to do is the following.

Edit inc/design.inc.php

Find the following line in the getPromoCode() function (it's the last line)

return $sCode;

Then add just before it:

if(isMember()) $sCode = '';

That's it! Easy huh?

/DM

 

Hits: 1807
Rate this blog entry:
0
Continue reading 4 Comments

After updating my Dolphin 6 site to the new version 7 software I decided that I wanted to move the avatar to the banner - basically the same as for my D6 site. I also wanted to put the quotes at the bottom - I decided to mimick the style and layout for my D6 site - I wanted my upgrade to D7 to be more or less transparent to my users.

 

How To Relocate the daily quotes

To modify the quotes position is  simple enough - you just need to modify the sys_injections table - look for quotes_injection and then change the key to injection_footer_after

injection_footer_after refers to the tag that the content will replace - in this case the tag in the footer

 

bx_injection:injection_footer_after />

 

This is only half of the story though - as the quotes do not display correctly - this is mostly as the css has a position:absolute attribute - this needs to be changed to position:relative, or removed altogether. This can easily be changed in unit.css in the quotes module - look for the .quote_div class name. Whilst you are there you might also want to change the rest of the styling to suit your own site.

You can also override the modules style by adding the following to general.css

 

div.quote_div { position:relative;}

 

Or just use the following code which will also position it nicely

    div.quote_div {
        position:relative;
        margin-top:20px;
        clear:both;
        width:100%;
    }
   
    div.quote_div div.daily_quotes {
        text-align: center;
    }

 

You could also put the quotes block anywhere you like by creating your own injection points - simply add the following tag to your template in the position you want to inject the code - I added this after the footer.

 

bx_injection:my_injection />

 

Then change the key in the sys_injections table to my_injection. Now the quotes display below the bottom footer instead of inside it.

You can include any kind of custom content in this manner by adding it to the sys_injections table - include the custom php code you want to execute in the data field and make sure you change the type to php.

In this manner you can include the avatar and username in the banner.

 

Add the avatar to the banner

The code that puts the avatar and username in the promo block is in design.inc.php - unless you want two avatars displayed you will need to comment it out after you have moved it.

 

$aInfo =  getProfileInfo();            
$sWelcomeElement = '
' . get_member_thumbnail($aInfo['ID'], "left", false) . '
' . _t('_Hello member', $aInfo['NickName']) . '
';

 

Simple create a new entry into the sys_injections table - I called it 'avatar' - then add in the info. We can use the same code for generating the avatar and text for the header. You have to change the way that the code is handled slightly - but not too much - we also need to check if the user is logged in. if not we will display nothing, but we could easily show the login / join buttons instead.

$aInfo = getProfileInfo(); 
return $aInfo = getProfileInfo(); if(isMember()) { return '
' . get_member_thumbnail($aInfo['ID'], "left", false) . '
' . _t('_Hello member', $aInfo['NickName']) . '
';} 


Make sure that you set the key to injection_logo_after so that it is injected in the same position as the quotes were.

You will now see the avatar and text displayed in the header - but you will notice that it does not display 100% correctly - it displays underneath the logo. This is because there are no style elements associated with it - the original styles applied in index.css no longer apply as the elements were explicitly defined - To remedy this simply add the following styles in general.css for the image and test respectively and style them to suit your needs

div.sys_ml_wrapper div.label_thumbnail {        
position:relative;
   float:right;
   top:28px;
}

div.sys_ml_wrapper div.label_thumb {
   float:right;
   margin-right:20px;
   position:relative;
   top:60px;    
}

/DM

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

Fixing the paragraph spacing issue

Posted by on in Dolphin 7.0.x Modifications

You may have noticed that after neatly setting out your post within the TinyMCE editor, when the page is published, the paragraphs are all squashed up.

The issue is a CSS issue. Basically the style applied to the P tag by TinyMCE and D7 are different - so it displays OK in the editor, but when the D7 code renders it - it is displayed differently.

The offending code is in templates/base/css/general.css, the attribute margin:0px is applied to the P tag, remove this and the issue will be gone, BUT there is one caveat - obviously this affects ALL instances of the P tag - so it may be that whilst this cures the immediate issue, it may cause problems elsewhere (i've not tested this, and this may be different for your site - depending on which template you use and what modifications you have applied to them)

To fix the issue, you will need to change general.css in two places -

Line 1

Change

 

a img, form, p

 

to

a img, form

and on line 120

change

p
{
margin:0px;
padding:0px;
}

to

p
{
padding:0px;
}

There is no real need to apply the attributes to the P as has been done in the original code, plus declaring the base P tag in two different places can lead to inheritance issues.

If it turns out that removing these elements has too much of a knock on effect on other areas of the site, then The best solution may be to alter the TinyMCE css to match the D7 general by adding the margin:0px to plugins/tiny_mce/themes/advanced/skins/default/content.css At least then what you see will actually be what you get

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