Okay, doing up a site for someone and ran into this problem. It's one of those things that you hate because as soon as you see it you know it's going to be a file hunt to finally figure out where the thing is controlled from and how to fix it. Specifically, we're talking about appearance/layout items that you think would be in the CSS files but as soon as you firebug it you know it's a waste of time to look in the CSS.
This time, it was the thumbnails on the Friends. It was missing it's left border and if I adjusted the margin it flew into that dang repeat crap it does. Bascially, when you firebug it you see this and you know the hunt is on:
float:none;
}
That in and of itself tells you that the item is controlled in the PHP files and NOT in the CSS where it would be so easy to change. Of course, we were looking at a "My Account" page and also the Viewfriends.php page. But they weren't the same exact issue and they weren't handled the same way. But it was the same task as both were element styles.
Now, when I changed the float to left on the one and put a text-align:center on the other, it fixed both problems in FB, but I had to find out where they were. Only one way, find the <div> that's being called specifically and adjust it. In this instance we were looking for 2 of them.
browse_nick and thumbnail_block
Doesn't seem to hard, right? This took hours to hunt down. Why? Because we had to start with the base page file and go through all the files called to finally figure it out. Take a look at finding thumbnail_block for the member.php page. Here's what it calls:
require_once( 'inc/header.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'members.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'news.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'sharing.inc.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolBulletins.php' );
require_once( BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolClassifieds.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolGroups.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPageView.php' );
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolSharedMedia.php' );
if(file_exists( BX_DIRECTORY_PATH_ROOT . 'last_visitors_member.php' ))
require_once( BX_DIRECTORY_PATH_ROOT . 'last_visitors_member.php' );
if(file_exists( BX_DIRECTORY_PATH_CLASSES . 'BxDolLastVisitorsManagerAddon.php' ))
require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolLastVisitorsManagerAddon.php' );
What does that mean? That we have to start with member.php and look at the files it calls. Of course, we think we're lucky as we find one instance of thumbnail_block in the member.php file.
We find:
$ret = '';
$ret .= '<div class="thumbnail_block" style="float:' . $float . '; ">';
$ret .= "<a href=\"{$this->aConfSite['url']}upload_media.php\">";
$ret .= '<img src="' . getTemplateIcon( 'spacer.gif' ) . '" style="' . $style . '" alt="' . process_line_output( $aFileName['med_title'] ) . '" />';
$ret .= '</a>';
$ret .= '</div>';
return $ret;
The problem is, that's not it. Nope, change it to:
$ret .= '<div class="thumbnail_block" style="float:left;">';
Does nothing for our problem the same as:
$ret .= '<div class="thumbnail_block">';
Did nothing.
This means that the hunt is really on to find the solution. Now, some files we're automatically eliminated as they had NOTHING to do with what we we're looking at. Things like Groups, Events, Classifieds, header.inc.php and so on. In the end this search was not as bad as some are. Since the vast majority of files do NOT have thumbnail_block in them, it was a matter of just hunting for it with the search function in notepad++. Finally, with 8 files opened and searched it was found:
inc/design.inc.php
//$bResDrawMargin = ($sCoupleImgEl != '') ? false : $bDrawMargin;
$bResDrawMargin = $bDrawMargin;
$ret = '';
$ret .= '<div class="thumbnail_block" style="float:">';
$ret .= "<a href=\"".getProfileLink($ID)."\">";
$ret .= '<img src="' . getTemplateIcon( 'spacer.gif' ) . '" style="' . $sMarginsAddon . $style . '" alt="' . process_line_output( $aFileName['med_title'] ) . '" />' . $sCoupleImgEl;
$ret .= getProfileOnlineStatus( $user_is_online, $bResDrawMargin, ($sCoupleImgEl!='') );
$ret .= '</a>';
$ret .= '</div>';
Yes, by changing it to:
//$bResDrawMargin = ($sCoupleImgEl != '') ? false : $bDrawMargin;
$bResDrawMargin = $bDrawMargin;
$ret = '';
$ret .= '<div class="thumbnail_block">';
$ret .= "<a href=\"".getProfileLink($ID)."\">";
$ret .= '<img src="' . getTemplateIcon( 'spacer.gif' ) . '" style="' . $sMarginsAddon . $style . '" alt="' . process_line_output( $aFileName['med_title'] ) . '" />' . $sCoupleImgEl;
$ret .= getProfileOnlineStatus( $user_is_online, $bResDrawMargin, ($sCoupleImgEl!='') );
$ret .= '</a>';
$ret .= '</div>';
(Removed the float reference on the <div class="thumbnail_block"> line of code. That allowed the float to be called from the CSS files and NOT the php files.
Why in the world are you doing this Boonex? I've been ripping for hours on this today. Both to find the issue and then to check the site for any errors that have appeared from it. Not a single issue is caused by removing the float from the php file, instead it resolved so many of them that it's ridiculous. Why can't we get a standardized system here?
I understand that for somethings, like profile customization we need to drop the CSS commands into the php files so we can call it from the DB, but for something like this that is a standard item, a stupid thumbnail_block, we're forced to hunt through file after file after file after file after file to find it and correct it. Yes, this was on a D6 site, not a D7, but D7 is no better about this. In order for us, the members to help you develop Dolphin we need a set of standard rules/guidelines to follow. As long as you are doing things that make no sense that deviate from the standards you have allegedly set for us to follow, it is impossible for us to help you get it where it needs to be.
So how about it Boonex, can you guys kill this practice of randomly placing CSS inside of php files and instead do it the way you want us to do it, placing layout code in the CSS files where it belongs?
If we had see more
whats up!
Regards,
DosDawg
float:none;
}
that tells me Javascript
I just see it as another thing that is causing longer load times as more and more files are called to do the most basic of things. Just because you can use something somewhere doesn't always mean you should. Remember, work smarter, not harder. JS Should be used where traditional coding (CSS in this instance) can not be used to obtain a desired result. Lining up a thumbnail is NOT one of those instances. see more
Wherever I may have HTML in whatever I code, it's because a certain area was rushed through and I haven't yet gotten around to switching it to use templating. This is usually what you see in draft production when you are ironing see more
We tried to eliminate such code in Dolphin 7 as much as possible ! But there are a lot of such things, almost everywhere .. it was written for years ..
Dolphin 7 is much better than Dolphin 6 .. most of the functionality was moved to modules and templates was completely separated. But some old things are still in the code.
In the future we will get rid of such code at all !
float:left;
11 see more