<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:admin="http://webns.net/mvcb/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
    <title>Forum One Tech Blog</title>
    <link>http://tech.forumone.com/</link>
    <description>Insight on Technology Trends from Forum One</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <pubDate>Thu, 07 May 2009 20:50:58 GMT</pubDate>

    <image>
        <url>http://tech.forumone.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Forum One Tech Blog - Insight on Technology Trends from Forum One</title>
        <link>http://tech.forumone.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ForumOneTechBlog" type="application/rss+xml" /><item>
    <title>The Cloud: how is it relevant?</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/tl1F2ZWN6g0/160-The-Cloud-how-is-it-relevant.html</link>
            <category>Hosting</category>
    
    <comments>http://tech.forumone.com/archives/160-The-Cloud-how-is-it-relevant.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=160</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=160</wfw:commentRss>
    

    <author>nospam@example.com (Jo Ryden)</author>
    <content:encoded><![CDATA[
    <img width="200" height="125" style="border: 0px none ; float: right; padding-left: 5px; padding-right: 5px;" src="http://tech.forumone.com/uploads/2Color_Business_Partner.serendipityThumb.png" /><p><font size="3"><b>I</b></font> attended the <a href="http://nten.org/ntc" target="_blank">Nonprofit Technology Conference</a> in San Francisco a couple of weeks ago. As in so many other places these days, both on and offline, a lot of the buzz and talk was centered around The Cloud and Cloud Computing. What is it? What can it do for us? Who uses it? It's easy to get into long discussions about these topics and there are many articles, blog posts and even <a href="http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=cloud+computing&x=0&y=0" target="_blank">books</a> covering a wide array of aspects and philosophies of Cloud Computing. I'll try to give a very brief and cursory overview below in an attempt not to cause immediate information overload. If you would like to continue the discussion a bit more in-depth, please feel free to leave a comment or contact me at any time.</a> </p><br />
<h4><em>What is it?</em></h4><hr width="100%" size="2" /><p><font size="3"><b>T</b></font>here are still quite extensive (and sometimes heated...) debates going on regarding how to define The Cloud and services operating from The Cloud. I'm a visual person and I think this video is a good attempt at depicting The Cloud, what it is and where it came from. </p><center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/XdBd14rjcs0&hl=en&fs=1&rel=0" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="425" height="344" src="http://www.youtube.com/v/XdBd14rjcs0&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" /></object></center><b><font size="3">A</font></b> few highlights: <p><ul><li>A collection of shared, internet accessible resources or infrastructure evolved from several "as a Service" infrastructure and software delivery models</li><li>Can be tapped into on an as-needed basis (resources can be scaled up or down with little to no effort)</li><li>Pay for the resources you use, and don't pay for what you don't use (utility type metered billing model)</li><li>&quot;Open&quot; philosophy (open meaning access from any device anywhere at a higher level and <a href="http://en.wikipedia.org/wiki/API">API</a> access at a lower level)</li></ul></p><font size="3"><b>S</b></font>ome people like to argue that with the evolution of The Cloud, the various "as a Service" concepts have become obsolete. I don't necessarily subscribe to that view. To use a familiar example: Google Apps (GA). GA is what has traditionally been categorized as <em>Software as a Service</em> (SaaS), and I think that is still the most accurate description of what it is. However, since GA runs off The Cloud you could make the argument that it should be called a Cloud [based] Service.</p><h4><em>What can it do for us?</em></h4><hr width="100%" size="2" /><p><font size="3"><b>B</b></font>esides the obvious and immediate cost savings associated with life in The Cloud, it also offers a level of flexibility in a number of areas that is previously unparalleled in the computing world:<ul><li>No more long binding hardware/hosting contracts</li><li>Need a staging site for that one new application to show off for an afternoon? No problem, just click a button</li><li>Have a high profile campaign driving a lot of traffic to your web site? Deploy some extra resources for the duration of the campaign effect and terminate them at will as soon as your traffic returns to normal levels</li><li>Need some compelling arguments when presenting and/or defending your web operations budget? How about: no longer will you be spending on what you <em>might</em> need, you are now spending on what you in <em>actuality</em> need and use</li></ul></p><p><font size="3"><b>S</b></font>o what's the catch? There really is no catch to speak of. The barrier of entry to The Cloud is very low, cost is exclusively operational as opposed to in previous years where the barrier of entry to high level computing resources has been associated with large upfront capital expenditures.</p><h4><em>Who uses it?</em></h4><hr width="100%" size="2" /><p><font size="3"><b>C</b></font>hances are you as an individual or maybe in some business capacity, are already taking advantage of what The Cloud has to offer in some way or another without even knowing about it, which is coincidentally one of the major characteristics of The Cloud; the abstraction of the underlying infrastructure, hardware or software platform. I mentioned Google Apps above, here are some other major players using The Cloud and/or providing access to it and services running from it: <ul><li><a href="http://www.salesforce.com/" target="_blank">Salesforce.com</a> - provides cloud services</li><li><a href="http://aws.amazon.com/" target="_blank">Amazon.com</a> - provides cloud services and cloud infrastructure (which have evolved from an infrastructure that mainly came about due to its own need for an operating platform for its e-commerce business)</li><li><a href="http://www.razorfish.com/" target="_blank">Razorfish.com</a> - operates from The Cloud</li></ul><font size="3"><b>T</b></font>he distinction between who "uses" the cloud and who provides access to cloud infrastructure and services can sometimes be a little fuzzy since providers are oftentimes middle men and end users as well, and vice versa. </p><h4><em>Final words</em></h4><hr width="100%" size="2" /><p><font size="3"><b>A</b></font>t Forum One we offer our clients and partners a slice of, and a guided way into, The Cloud and all of the benefits discussed above through our partnership with Rackspace and its <a href="http://www.mosso.com/index.jsp" target="_blank">Cloud Division</a>. We also have several SaaS offerings (or Cloud Service offerings if you will), our flagship being <a href="http://www.projectspaces.com/" target="_blank">ProjectSpaces</a>. The Cloud isn't just the future of computing, it is here <em>now</em> and ready for you to put to use!</p> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/tl1F2ZWN6g0" height="1" width="1"/>]]></content:encoded>

    <pubDate>Wed, 06 May 2009 14:02:08 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/160-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/160-The-Cloud-how-is-it-relevant.html</feedburner:origLink></item>
<item>
    <title>LegiStalker: Getting people engaged with Congress</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/S5KHRbJYNDM/159-LegiStalker-Getting-people-engaged-with-Congress.html</link>
            <category>Open Source</category>
            <category>Tools</category>
    
    <comments>http://tech.forumone.com/archives/159-LegiStalker-Getting-people-engaged-with-Congress.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=159</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=159</wfw:commentRss>
    

    <author>nospam@example.com (Matt Gibbs)</author>
    <content:encoded><![CDATA[
    There's a lot of people out there wanting to keep up with Congress.<br />
<br />
Many people just want to know what their representatives are doing in Congress, how they're voting, and who they're interacting with. Unfortunately, that's pretty hard to find, especially from several different angles.<br />
<br />
We at Forum One felt that exposing this information was a pretty good idea, so we ran with it. The final result is the site <a href="http://legistalker.org/"  title="LegiStalker">LegiStalker</a>.<br />
<br />
From the low level, it's a pretty simple concept. We pull in all the information we can find about every Congressperson, clean it up, and store it in an ever-growing database. So far, we've managed to harness YouTube, Twitter, latest voting data, and several hundred different news sources. With so many different news sources, there's a pretty good spectrum of differing perspectives -- ranging from CNN and the New York Times to Fox News.<br />
<br />
This is a lot of good information, but a lot of information nonetheless. If users are presented with just the latest items retrieved, it would get pretty overwhelming for the user. With that in mind, we came up with a 5-tiered system for filtering the data to meet any user's needs.<br />
<br />
1. <a href="http://legistalker.org/"  title="U.S. Level">U.S. Level</a> - a high-level view with the latest feeds from any congress member.<br />
<br />
2. <a href="http://legistalker.org/places/NC"  title="State Level">State Level</a> - When the user clicks on a state, it first displays all representatives in that state. All the tabs now display feeds relating only to congress members in that state.<br />
<br />
3. <a href="http://legistalker.org/places/90210"  title="Zip Code Level">Zip Code Level</a> - When the user enters their zip code in the box, all their Congress representatives will first appear. This will include the two senators, as well as one or more representatives. All the tabs now display feeds relating only to those people listed.<br />
<br />
4. <a href="http://legistalker.org/people/M001147"  title="Detail Level">Detail Level</a> - At this level, the congressperson's contact information is displayed. In addition to News, YouTube, and Twitter, that person's most spoken Congress words are displayed in the new "Capitol Words" tab, and there is also a history of that person's latest votes. All the other tabs are filtered to that single person in question.<br />
<br />
5. <a href="http://legistalker.org/following"  title="Watch List Level">Watch List Level</a> - When users are viewing a congressperson's detail page, they have the option to add that person to their "Watch List". When they do, that person is displayed in the "My Watch List" area at the top right corner of the site. An unlimited number of people can be added to someone's watch list. <strong>This allows users to filter content based only on representatives that they want to keep track of</strong>.<br />
<br />
Adding this much fine-tuning was quite some work, but we feel that it's worth it. Visitors can now keep track of who they want to keep track of, thus making more informed decisions.<br />
<br />
Although the <a href="http://sunlightlabs.com/blog/2009/04/20/and-winners-are/"  title="Apps for America">Apps for America contest</a> is over, we'll definitely keep adding more features to pry open the doors between congresspeople and their constituents. 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/S5KHRbJYNDM" height="1" width="1"/>]]></content:encoded>

    <pubDate>Sun, 26 Apr 2009 15:27:09 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/159-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/159-LegiStalker-Getting-people-engaged-with-Congress.html</feedburner:origLink></item>
<item>
    <title>Code Samples, Job Applications, and You</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/C4PtW-LctmI/156-Code-Samples,-Job-Applications,-and-You.html</link>
            <category>Programming</category>
    
    <comments>http://tech.forumone.com/archives/156-Code-Samples,-Job-Applications,-and-You.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=156</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=156</wfw:commentRss>
    

    <author>nospam@example.com (Sandy Smith)</author>
    <content:encoded><![CDATA[
    According to a couple of sources I've checked out recently, code samples are rare in the software development interviewing process. <a href="http://ask.slashdot.org/article.pl?sid=06/12/14/0511224"  title="One discussion">One discussion</a> was full of responses calling the idea ridiculous and suggesting candidates cancel interviews at places that request a code sample. I think they're incredibly wrong. I think code samples are a great idea, and I'm going to not only tell you why, but give you tips on amateur mistakes to avoid if you want to be taken seriously.<br />
<br />
<h3>You can't tell that much about a person from a code sample</h3><br />
That's right, and that's wrong. It's right in that many commenters calling a company "stupid" for "relying" on code samples assume there's no other criteria to hiring. Code samples are actually one of several initial screening devices I use to cut out people who aren't going to work out. At every stage in the game, I'm looking for something to tell me--before committing a lot of money and diverting a lot of other people's time to bring you on board--whether you're likely to be the sort of programmer we're looking for. This doesn't mean you're a bad programmer if we don't hire you; it just means that who you are and where you are as a programmer doesn't match our culture and our needs, and likely our culture and opportunities won't be a great fit for you, either.<br />
<br />
Of course, if I like a code sample, there are still interviews, references, and some discussion of real and example code. We still care very much as to whether you know our technology, can work well on a team, are comfortable working with policy nonprofits, and several other factors that go into a hiring decision.<br />
<br />
Then again, I can tell a lot about a person from their code. Are they consistent? Do their variable names follow a pattern? Do they have a coding style and stick to it? Basically, do they write code to be read by others, or assume they'll always know what they meant and code for themselves in the moment? Do they follow contemporary idioms for the programming language the code sample is in? Is the code filled with convoluted ways of solving simple problems? Is there anything clever, and is it in service of the problem or just adding complexity to make the solution more interesting to create? Is the code from an open source project? Have they collaborated with others? Do they follow good habits, even on personal projects? Is it well laid out or look like a quick hack?<br />
<br />
<h3>But you don't even know it's the person's own code!</h3><br />
Yeah, I do. I mean, not immediately on first glance, but there should be some correspondence between the level of sophistication in the code and the work history on the resume. Rarely have I gotten a sample so perfect I wonder if the programmer wrote it themselves. And even if they stole the code, whether they have the sense to steal a Renoir or a Kinkade also tells me something. I mean, if you can't even steal good code, I can safely pass on to the next application.<br />
<br />
If, during an interview, I get an impression that's at odds with the code sample I've seen, I can always ask about it. It's tough to fake familiarity with a piece of code you grabbed off a server somewhere. If the code uses design patterns, I ask about them. If it doesn't, I ask why not. I ask about the tradeoffs in using a given pattern versus not using one. I'll usually ask these sorts of questions anyway, so I get a sense of where the programmer is in thinking about code as well as writing it.<br />
<br />
<h3>But maybe my code is all proprietary or even classified!</h3><br />
The code you write at work is, but there's no reason you can't write out part of a common solution. We're also an open source shop, so you can always write a plugin or extend an open source app. If you need a few days to get a sample together, I'll understand, but hey, if you're going to apply for programming positions, you shouldn't be surprised if they want to see samples of your work. This is a problem long ago dealt with in other aspects of your profession: strategists will be asked to provide writing samples and designers will be asked for samples of their portfolio. Programming isn't a job you tend to hold onto for decades; you should have a sample ready. I have always had current samples since I became a programmer.<br />
<br />
<h3>OK, so what should I provide?</h3><br />
Above all, something you're proud of, or at the very least feel is a good representation of where you are as a programmer. This does not mean the cleverest thing you've ever done (frequently the cleverest thing a programmer does is not the best thing a programmer does). It can be a whole program or just a part of one. It should be more than one screenful of code--I need enough to see patterns.<br />
<br />
In a way, it's like the various cooking competitions that are all the rage now (go <a href="http://www.fansofrealitytv.com/forums/top-chef-new-york/78504-carla-top-chef-new-york.html#post3221053">Carla</a>!). These chefs have a body of work and produce pieces of dishes many times each lunch and dinner (or even breakfast). But the finale comes down to whether they produced a great meal that represents them as a creative artist. And, like food, programming is a mix of artistry and engineering.<br />
<br />
<h3>So...what should I not provide?</h3><br />
Thanks for asking--because I rarely worry about stolen code when I see so much bad stuff given to me as representative of a programmer.<br />
<h4>Don't indulge your bad habits</h4><br />
Anybody who gets out of a programming 101 class knows good programmers comment their code. There are arguments about how much or how little, but there's a reason almost every code-completing IDE also generates comment templates for you. We all slack off sometimes (admit it), but the time to do it is not when you're sending me code that's going to help me determine whether or not to bring you in for an interview.<br />
<br />
Likewise, giving me code with obvious XSS or SQL injection vulnerabilities is probably not a good idea. Even if you're writing a toy app to demonstrate a few techniques, the fact that you code without basic filtering and validation is going to make me nervous that you'll do it when there's a project manager asking you if there's any way you can add a couple of more client requests by the deadline. Sure, it's the kind of thing non-technical people aren't going to notice or praise you for, but they will curse you when their site around sensible regulations for underwater basket weaving curricula is replaced with pr0n.<br />
<br />
<h4>Don't be weird</h4><br />
I see some really odd constructions. If you think the rest of the universe is wrong about most things about programming in a given language and you're going to prove them wrong and stun me with your brilliance in a single code sample, you're basically doomed. I'm looking to see if you're aware of best practices going on in the wider world around you (do you read any programming blogs? articles on your language?). I'm also looking to see if you think about problems in a way that makes sense to most people. In our organization at least, everybody is going to work on someone else's code at some point. Wrapping a static HTML block inside a PHP include that contains a Javascript function to print out each line of HTML is not the kind of innovation that I'm looking for. Save it for the <a href="http://www.ioccc.org/">obfuscated C competition</a>. Don't laugh; I've seen that.<br />
<br />
<h4>Don't give me the same code sample you used six years ago</h4><br />
I'm looking to see what you're like now. If you haven't really progressed in six years, then, OK. I've still got the PHP 4 samples lying around. Heck, I've even got the Perl CGI flat-file database I used when I interviewed here. They're probably not my best chance to prove to you that I know what I'm doing now. Likewise, don't give me HTML 4 table-based layouts with nested function calls that assumes <code>register_globals</code> is on.<br />
<br />
Remember, all of this--at least in my case--is not to prove you're the most brilliant programmer that ever walked the face of the earth. I'm not actually interested in hiring that person. I'm interested in a really good programmer who works well with others, can be put in front of someone non-technical, and who can easily pick up our idioms and have positive contributions of their own. So don't overthink the code sample, but don't put less thought and care into it than you do how you dress for the interview. Neither will get you the job by themselves, but both of them can either keep you from getting the job you want or make a good impression you can confirm throughout the interview process. 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/C4PtW-LctmI" height="1" width="1"/>]]></content:encoded>

    <pubDate>Mon, 09 Mar 2009 23:16:15 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/156-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/156-Code-Samples,-Job-Applications,-and-You.html</feedburner:origLink></item>
<item>
    <title>DrupalCon DC</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/hbk0x9rhz0M/155-DrupalCon-DC.html</link>
    
    <comments>http://tech.forumone.com/archives/155-DrupalCon-DC.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=155</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=155</wfw:commentRss>
    

    <author>nospam@example.com (Matt Gibbs)</author>
    <content:encoded><![CDATA[
    Hey everyone, just a heads up that the whole Tech Team will be attending <a href="http://dc2009.drupalcon.org/"  title="DrupalCon DC">DrupalCon DC</a> from March 4 - 7. "DrupalCon is the official Drupal unconference that attracts the most talented open source developers and innovative web shops in the world and brings them together to share knowledge, make decisions on the future of Drupal, and get to know each other in person". If you're also attending, feel free to stop by our booth if you want to chat or know more about us.<br />
<br />
We hope to see you there! 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/hbk0x9rhz0M" height="1" width="1"/>]]></content:encoded>

    <pubDate>Wed, 04 Mar 2009 07:10:46 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/155-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/155-DrupalCon-DC.html</feedburner:origLink></item>
<item>
    <title>What is a Content Type?</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/gFvn1KcCVso/154-What-is-a-Content-Type.html</link>
    
    <comments>http://tech.forumone.com/archives/154-What-is-a-Content-Type.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=154</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=154</wfw:commentRss>
    

    <author>nospam@example.com (Matt Gibbs)</author>
    <content:encoded><![CDATA[
    A "Content Type" is jargon for what is a simple programming concept. I've been asked this question many times over the years, and hopefully this post will cut through the obscurity once and for all.<br />
<br />
Document. Event. News Article. Staff Member. These are all examples of Content Types.<br />
<br />
Which input fields would you expect to see when adding a new <strong>Staff Member</strong>? You'd probably want "First Name", "Last Name", "Date of Birth", "Phone Number", "Active Projects", etc. For Events, you'd likely want "Event Title", "Start Date", "End Date", "Location", and "Contact Name". The fields serve to describe the item, and any field(s) can be added to or removed from a content type.<br />
<br />
That's it. <strong>A content type is the term for a "bucket" of input fields.</strong> All items marked as "Events" share the same fields. If you add a new input field to the "Event" content type, then all current (and future) Event items will have that new field, too. Pretty simple, huh?<br />
<br />
The real power of content types isn't the categorization alone. Since all this information is now nicely structured within these content types, it's a whole lot easier to <em>form relationships</em> among different items. Remember that "Contact Name" field in the "Event" content type? A developer could easily set that field to pull in all staff members (items belonging to the "Staff Member" content type) and allow the user to select which staff members to use.<br />
<br />
Many modern CMS platforms (<a href="http://drupal.org/"  title="Drupal">Drupal</a>, <a href="http://pods.uproot.us/"  title="Pods">Pods</a>, <a href="http://www.syntaxcms.org/"  title="SyntaxCMS">SyntaxCMS</a>) allow developers to easily add and configure new content types without touching a line of code. 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/gFvn1KcCVso" height="1" width="1"/>]]></content:encoded>

    <pubDate>Tue, 06 Jan 2009 15:42:00 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/154-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/154-What-is-a-Content-Type.html</feedburner:origLink></item>
<item>
    <title>Drupal module and theme naming collisions</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/0keYM-IB4fI/152-Drupal-module-and-theme-naming-collisions.html</link>
    
    <comments>http://tech.forumone.com/archives/152-Drupal-module-and-theme-naming-collisions.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=152</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=152</wfw:commentRss>
    

    <author>nospam@example.com (William Hurley)</author>
    <content:encoded><![CDATA[
    As good as Drupal is, as many third-party enhancements there are, there usually comes a time when they just aren't quite enough.  The answer to that is to create your own module that does exactly what you or your client needs.  And since they are for a particular site the natural inclination is to name them after that site.  Similarly when developing a theme for a site the natural inclination is to name the theme for the site.  This, unfortunately, is a Very Bad Thing (TM).  For why this is let's take a quick look at where the configuration for modules and themes ends up, the system table.<br />
<br />
A quick export shows us the following:<br />
<pre><br />
CREATE TABLE `system` (<br />
  `filename` varchar(255) NOT NULL default '',<br />
  `name` varchar(255) NOT NULL default '',<br />
  `type` varchar(255) NOT NULL default '',<br />
  `description` varchar(255) NOT NULL default '',<br />
  `status` int(11) NOT NULL default '0',<br />
  `throttle` tinyint(4) NOT NULL default '0',<br />
  `bootstrap` int(11) NOT NULL default '0',<br />
  `schema_version` smallint(6) NOT NULL default '-1',<br />
  `weight` int(11) NOT NULL default '0',<br />
  PRIMARY KEY  (`filename`),<br />
  KEY `weight` (`weight`)<br />
)<br />
</pre><br />
<br />
The important rows are filename, which holds the file included for the module or the stylesheet displayed for the theme; name, which holds the name of the module or theme; type which is either module or theme; and description which holds the description of the module or the path to the templating engine for themes.  While I could take a slight detour to talk about why this structure is a bad idea (hint, it involves using the same column to mean two different things -- bad, Drupal, bad), it only partly contributes to our problem.<br />
<br />
When the theme and module have the same name and a user goes to the theme administrative section it updates all rows in the system table with the name of the theme to have the correct filename and description/templating engine.  It, however, does not check for the type.  So when it finds the module with the same name it overwrites it.  So you end up with a row that has a type of module but has the filename of a CSS file, and when the system goes to include all modules that are active it grabs the CSS and you end up with it output at the very top of the page.  Oh, and any functionality that your module provided no longer works.<br />
<br />
So the moral of the story is don't name themes and modules the same.  
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/0keYM-IB4fI" height="1" width="1"/>]]></content:encoded>

    <pubDate>Fri, 12 Dec 2008 11:33:58 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/152-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/152-Drupal-module-and-theme-naming-collisions.html</feedburner:origLink></item>
<item>
    <title>Drupal and basic Search Engine Optimization (SEO)</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/LDCpHFt9CLo/150-Drupal-and-basic-Search-Engine-Optimization-SEO.html</link>
    
    <comments>http://tech.forumone.com/archives/150-Drupal-and-basic-Search-Engine-Optimization-SEO.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=150</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=150</wfw:commentRss>
    

    <author>nospam@example.com (Oscar Merida)</author>
    <content:encoded><![CDATA[
    <p>Making your content visible in the first few pages of search results is a key strategy for disseminating the content of your web site.  There are some basic things any CMS should do to make SEO easy and almost effortless.  It should bake in the foundation for good SEO by providing the right tools, encouraging good SEO habits.  However, 80% of good search engine placement is a result of good, consistent web content management of useful, compelling content.  The following are some of our own thoughts about it, and tools at your disposition.</p>
<h2>The value of meta tags</h2>
<p>A common myth is that having the right keyword and description <a href="http://en.wikipedia.org/wiki/Meta_tags">meta tags</a> matters the most, but this myth was debunked a long time ago.  Meta tags have little weight for actual SEO, and AFAIK meta-keywords are completely ignored by major search engines since they were so easily gamed early. Meta description tags are a bit more useful, and if provided, are used by google as the description of your page.</p>
<p><a href="http://www.searchengineguide.com/richard-ball/meta-keywords-a.php>Meta Keywords Advice</a></p>
<blockquote>"Do not use the meta keywords tag. Many people still think of this as a quick fix for SEO. It's not. Google no longer uses it. Yahoo is perhaps the only search engine that still uses the meta keywords tag but places very little weight on it."</blockquote>
<p><a href="http://blog.ericgoldman.org/archives/2008/04/court_says_keyw.htm">Court Says Keyword Metatags Don't Matter--Standard Process v. Banks</a></p>
<blockquote>"SEOs and SEMs have known for years that most search engines ignore or give minimal acknowledgement to keyword metatags. Lawyers, on the other hand, have been living in a parallel fantasy universe where keyword metatags single-handedly divert unwaveringly brand-loyal customers to piratical competitors. Even today, many courts still rely on the 1999 Brookfield case and its dreadful keyword metatags-as-a-false-billboard analogy as an accurate and definitive statement of how search engines operate today"</blockquote>
<h2>Best Practices</h2>
<p>The following practices can help SEO.  Some of these should be done automatically by your CMS or platform of choice.</p>
<h3>Use a single domain for your site</h3>
<p>Use a single domain name for your site.  Seemingly less important things such as having a site accessible by way of multiple domains/hosts/URLs (forumone.com vs www.forumone.com e.g) lowers your Google ranking.  Redirecting permanently to one domain, ie if you go to projectspaces.com, redirect the link to www.projectspaces.com with a "Permanent Redirect" code so that search engines don't index both urls as separate pages.  The Drupal .htaccess file has a sample rewrite rule to customize for this.  Visitors can still use either domain name to reach your site (with or without www. for example), but they, and more importantly Google and other search engines, will all end up viewing your site at a single domain.  This prevents your search rank from being diffused between both domain names.</p>
<p>If you're using Apache and have mod_rewrite enabled, you can use the following RewriteRule</p>
<pre>
RewriteCond %{HTTP_HOST} ^www.projectspaces.com
RewriteRule ^(.*)   http://projectspaces.com/$1   [R=permanent,L]
</pre>
<h3>Pay attention to titles, title tags, urls</h3>
<p>Use descriptive and engaging titles for pages/content as well as using heading tags to mark up titles and subtitles. The title tag should reflect the title of the content a user is viewing. The order of words in title tags matters, for example, instead of "Forum One Website : Events", "Events: Forum One".  Words that appear earlier in the title get more weight, and also make your titles easier to scan in search results lisitings. By default, Drupal does a decent job of this since it reuses a node's title for its title tag.  Drupal also places the node's title before the site's title in the title tag.</p>
<p>Words in URLs influence your search ranking.  Compare the urls  the URL <code>node/93</code> to <code>publication/effectiveness-of-lending-in-latin-america</code>, the latter conveys what is available at that link more readily.  If any match a user's search terms, google will highlight them when it shows your search results, for example search for <a href="http://www.google.com/search?q=online+community+report">"online community report"</a>.  By default, Drupal does not alias URLs in this way, but the <a href="http://drupal.org/project/pathauto">pathauto module</a> should be installed and configured to create them.  If you don't have access the pathauto,  contributors can manually create aliases when adding content.
<p><b>Update:</b>I just noticed Gadgetopia enumerated <a href="http://gadgetopia.com/post/6346">the benefits of readable URLs recently</a>, beyond SEO.</p>
<h3>Make content easy to digest and discover</h3>
<p>Another good practice is to use descriptive links to lead users on your site, and to make content easily digestible.</p>
<ul>
<li>Use descriptive links to your content (ie, try to <a href="http://oscarm.org/news/detail/171-die_click_here_die">avoid click here</a>).  If you must instruct users to click on a link, make the instruction context specific, ie  "Click to view more publications"  or "Click to read about the Annual Conference". since that <a href="http://www.copyblogger.com/click-here/">improves click thru rates</a>.</li>
<li>Avoiding images for text (ie navigation, headers, titles, etc...), or at least provide descriptive alt tags.  This is also a good accessibility practice.</li>
<li>Don't just use flash, pdf to deliver text, provide content as HTML.  Search engines may not be able to index content if its inside flash or requires a plugin to view.</li>
</ul>
<h3>Use Google's Webmaster Tools</h3>
<p><A href="http://www.google.com/webmasters/">Use google's webmaster tools</a> to diagnose how your site is indexed by the search engine.  The tool gives a lot of diagnostic information for making improvements to a site's content.  It will report problems including duplicate title tags, missing or short description tags, content delivery errors (page not found, server or network timed out) that prevented google from indexing your site.  You can also see what external pages in Google's index link to your own pages, and more.</p>
<p>I also recommend reading the more exhaustive <A href="http://googlewebmastercentral.blogspot.com/2008/11/googles-seo-starter-guide.html">Google's SEO Starter Guide.</a>  The actual guide is a PDF available at that link, and yes, I find that a bit ironic.</p> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/LDCpHFt9CLo" height="1" width="1"/>]]></content:encoded>

    <pubDate>Thu, 04 Dec 2008 11:29:22 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/150-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/150-Drupal-and-basic-Search-Engine-Optimization-SEO.html</feedburner:origLink></item>
<item>
    <title>Drupal: restrict a block to user's buddies in Panels</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/dVIRgsDkEOs/149-Drupal-restrict-a-block-to-users-buddies-in-Panels.html</link>
            <category>Drupal</category>
    
    <comments>http://tech.forumone.com/archives/149-Drupal-restrict-a-block-to-users-buddies-in-Panels.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=149</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=149</wfw:commentRss>
    

    <author>nospam@example.com (Oscar Merida)</author>
    <content:encoded><![CDATA[
    <p>The code below can be used to hide blocks displayed on a Panel page.  I think we tried doing this with PHP block visibility but couldn't quite get it to work.  Luckily, panels provides the hook_panels_panel_content_alter() for each block/content type you have in a container.  The code below is an example of using the hook to display certain blocks only if the logged in user is a buddy of the user whose profile is displayed.</p>
<style type="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #009966;
font-style: italic;
}
.syntax2 {
color: #999999;
font-style: italic;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #cc0033;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #0099ff;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #3399ff;
}
--></style>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax3">/**</span>
<span class="gutter">   3:</span><span class="syntax3"> </span><span class="syntax3">*</span><span class="syntax3"> </span><span class="syntax3">Tests</span><span class="syntax3"> </span><span class="syntax3">is</span><span class="syntax3"> </span><span class="syntax3">the</span><span class="syntax3"> </span><span class="syntax3">logged</span><span class="syntax3"> </span><span class="syntax3">in</span><span class="syntax3"> </span><span class="syntax3">user</span><span class="syntax3"> </span><span class="syntax3">is</span><span class="syntax3"> </span><span class="syntax3">a</span><span class="syntax3"> </span><span class="syntax3">buddy</span><span class="syntax3"> </span><span class="syntax3">of</span><span class="syntax3"> </span><span class="syntax3">the</span><span class="syntax3"> </span><span class="syntax3">specified</span><span class="syntax3"> </span><span class="syntax3">uid</span>
<span class="gutter">   4:</span><span class="syntax3"> </span><span class="syntax3">*</span><span class="syntax3"> </span><span class="syntax12">@param</span><span class="syntax3"> </span><span class="syntax18">integer</span><span class="syntax3"> </span><span class="syntax3">user</span><span class="syntax3"> </span><span class="syntax3">id</span>
<span class="gutterH">   5:</span><span class="syntax3"> </span><span class="syntax3">*/</span>
<span class="gutter">   6:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">user_is_buddy</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">)</span>
<span class="gutter">   7:</span><span class="syntax18">{</span>
<span class="gutter">   8:</span>    <span class="syntax8">static</span> <span class="syntax10">$is_buddy</span><span class="syntax18">;</span>
<span class="gutter">   9:</span>    <span class="syntax8">static</span> <span class="syntax10">$user_buddies</span><span class="syntax18">;</span>
<span class="gutterH">  10:</span>    <span class="syntax8">global</span> <span class="syntax10">$user</span><span class="syntax18">;</span> <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">logged</span><span class="syntax2"> </span><span class="syntax2">in</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  11:</span>
<span class="gutter">  12:</span>    <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">isset</span><span class="syntax18">(</span><span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">)</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax10">$user</span><span class="syntax18">)</span>
<span class="gutter">  13:</span>    <span class="syntax18">{</span>
<span class="gutter">  14:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">isset</span><span class="syntax18">(</span><span class="syntax10">$user_buddies</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutterH">  15:</span>        <span class="syntax18">{</span>
<span class="gutter">  16:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">hold</span><span class="syntax2"> </span><span class="syntax2">the</span><span class="syntax2"> </span><span class="syntax2">authenticated</span><span class="syntax2"> </span><span class="syntax2">user's</span><span class="syntax2"> </span><span class="syntax2">buddies</span><span class="syntax2"> </span><span class="syntax2">and</span>
<span class="gutter">  17:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">minimize</span><span class="syntax2"> </span><span class="syntax2">queries</span>
<span class="gutter">  18:</span>            <span class="syntax10">$user_buddies</span> <span class="syntax18">=</span> <span class="syntax9">array_keys</span><span class="syntax18">(</span><span class="syntax6">buddylist_get_buddies</span><span class="syntax18">(</span><span class="syntax11">$user</span><span class="syntax11">-&gt;uid</span><span class="syntax18">,</span> <span class="syntax13">'</span><span class="syntax13">uid</span><span class="syntax13">'</span><span class="syntax18">)</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  19:</span>        <span class="syntax18">}</span>
<span class="gutterH">  20:</span>
<span class="gutter">  21:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">users</span><span class="syntax2"> </span><span class="syntax2">are</span><span class="syntax2"> </span><span class="syntax2">there</span><span class="syntax2"> </span><span class="syntax2">own</span><span class="syntax2"> </span><span class="syntax2">buddies</span>
<span class="gutter">  22:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax10">$uid</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$user</span><span class="syntax11">-&gt;uid</span><span class="syntax18">)</span>
<span class="gutter">  23:</span>        <span class="syntax18">{</span>
<span class="gutter">  24:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax8">true</span><span class="syntax18">;</span>
<span class="gutterH">  25:</span>        <span class="syntax18">}</span>
<span class="gutter">  26:</span>        <span class="syntax8">else</span> <span class="syntax8">if</span><span class="syntax18">(</span><span class="syntax6">user_access</span><span class="syntax18">(</span><span class="syntax13">'</span><span class="syntax13">administer</span><span class="syntax13"> </span><span class="syntax13">buddylist</span><span class="syntax13">'</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  27:</span>        <span class="syntax18">{</span>
<span class="gutter">  28:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax8">true</span><span class="syntax18">;</span>
<span class="gutter">  29:</span>        <span class="syntax18">}</span>
<span class="gutterH">  30:</span>        <span class="syntax8">else</span> <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">empty</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  31:</span>        <span class="syntax18">{</span>
<span class="gutter">  32:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">=</span> <span class="syntax9">in_array</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">,</span> <span class="syntax10">$user_buddies</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  33:</span>        <span class="syntax18">}</span>
<span class="gutter">  34:</span>        <span class="syntax8">else</span>
<span class="gutterH">  35:</span>        <span class="syntax18">{</span>
<span class="gutter">  36:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax8">false</span><span class="syntax18">;</span>
<span class="gutter">  37:</span>        <span class="syntax18">}</span>
<span class="gutter">  38:</span>    <span class="syntax18">}</span>
<span class="gutter">  39:</span>
<span class="gutterH">  40:</span>    <span class="syntax8">return</span> <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">;</span>
<span class="gutter">  41:</span><span class="syntax18">}</span>
<span class="gutter">  42:</span>
<span class="gutter">  43:</span><span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">implementation</span><span class="syntax2"> </span><span class="syntax2">of</span><span class="syntax2"> </span><span class="syntax2">hook_panels_pane_content_alter</span>
<span class="gutter">  44:</span><span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">http://groups.drupal.org/node/7678</span>
<span class="gutterH">  45:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">planet_connect_panels_pane_content_alter</span><span class="syntax18">(</span><span class="syntax10">$content</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$pane</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$args</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$context</span><span class="syntax18">)</span>
<span class="gutter">  46:</span><span class="syntax18">{</span>
<span class="gutter">  47:</span>    <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">user</span><span class="syntax2"> </span><span class="syntax2">profile</span><span class="syntax2"> </span><span class="syntax2">customizations</span>
<span class="gutter">  48:</span>    <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">user</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax6">arg</span><span class="syntax18">(</span><span class="syntax5">0</span><span class="syntax18">)</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax10">$profile_uid</span> <span class="syntax18">=</span><span class="syntax18"> (</span>int<span class="syntax18">)</span> <span class="syntax6">arg</span><span class="syntax18">(</span><span class="syntax5">1</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  49:</span>    <span class="syntax18">{</span>
<span class="gutterH">  50:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">profile</span><span class="syntax2"> </span><span class="syntax2">about</span><span class="syntax2"> </span><span class="syntax2">stuff</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non</span><span class="syntax2"> </span><span class="syntax2">buddies,</span><span class="syntax2"> </span><span class="syntax2">EVER</span>
<span class="gutter">  51:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">delta</span><span class="syntax2"> </span><span class="syntax2">is</span><span class="syntax2"> </span><span class="syntax2">diff</span><span class="syntax2"> </span><span class="syntax2">for</span><span class="syntax2"> </span><span class="syntax2">every</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  52:</span>        <span class="syntax10">$is_buddy</span> <span class="syntax18">=</span> <span class="syntax6">user_is_buddy</span><span class="syntax18">(</span><span class="syntax10">$profile_uid</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  53:</span>        <span class="syntax8">if</span><span class="syntax18">(</span><span class="syntax18">!</span><span class="syntax8">empty</span><span class="syntax18">(</span><span class="syntax10">$content</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  54:</span>        <span class="syntax18">{</span>
<span class="gutterH">  55:</span>            <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">About</span><span class="syntax13"> </span><span class="syntax13">You</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$content</span><span class="syntax11">-&gt;subject</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  56:</span>            <span class="syntax18">{</span>
<span class="gutter">  57:</span>                <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax8">null</span><span class="syntax18">;</span>
<span class="gutter">  58:</span>            <span class="syntax18">}</span>
<span class="gutter">  59:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">activity</span><span class="syntax2"> </span><span class="syntax2">stuff</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non</span><span class="syntax2"> </span><span class="syntax2">buddies,</span><span class="syntax2"> </span><span class="syntax2">EVER</span>
<span class="gutterH">  60:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">delta</span><span class="syntax2"> </span><span class="syntax2">is</span><span class="syntax2"> </span><span class="syntax2">diff</span><span class="syntax2"> </span><span class="syntax2">for</span><span class="syntax2"> </span><span class="syntax2">every</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  61:</span>            <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">Recent</span><span class="syntax13"> </span><span class="syntax13">Updates</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$content</span><span class="syntax11">-&gt;subject</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  62:</span>            <span class="syntax18">{</span>
<span class="gutter">  63:</span>                <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax8">null</span><span class="syntax18">;</span>
<span class="gutter">  64:</span>            <span class="syntax18">}</span>
<span class="gutterH">  65:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">activity</span><span class="syntax2"> </span><span class="syntax2">stuff</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non</span><span class="syntax2"> </span><span class="syntax2">buddies,</span><span class="syntax2"> </span><span class="syntax2">EVER</span>
<span class="gutter">  66:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">delta</span><span class="syntax2"> </span><span class="syntax2">is</span><span class="syntax2"> </span><span class="syntax2">diff</span><span class="syntax2"> </span><span class="syntax2">for</span><span class="syntax2"> </span><span class="syntax2">every</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  67:</span>            <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">My</span><span class="syntax13"> </span><span class="syntax13">Groups</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$content</span><span class="syntax11">-&gt;subject</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  68:</span>            <span class="syntax18">{</span>
<span class="gutter">  69:</span>                <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax8">null</span><span class="syntax18">;</span>
<span class="gutterH">  70:</span>            <span class="syntax18">}</span>
<span class="gutter">  71:</span>
<span class="gutter">  72:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">our</span><span class="syntax2"> </span><span class="syntax2">list</span><span class="syntax2"> </span><span class="syntax2">of</span><span class="syntax2"> </span><span class="syntax2">restricted</span><span class="syntax2"> </span><span class="syntax2">block</span><span class="syntax2"> </span><span class="syntax2">deltas</span>
<span class="gutter">  73:</span>            <span class="syntax10">$restricted_blocks</span> <span class="syntax18">=</span> <span class="syntax8">array</span><span class="syntax18">(</span>
<span class="gutter">  74:</span>                <span class="syntax13">'</span><span class="syntax13">blogs_user_id</span><span class="syntax13">'</span><span class="syntax18">,</span>
<span class="gutterH">  75:</span>                <span class="syntax13">'</span><span class="syntax13">resources_user_id</span><span class="syntax13">'</span><span class="syntax18">,</span>
<span class="gutter">  76:</span>                <span class="syntax13">'</span><span class="syntax13">projects_user_id</span><span class="syntax13">'</span><span class="syntax18">,</span>
<span class="gutter">  77:</span>                <span class="syntax13">'</span><span class="syntax13">favorites_user_id</span><span class="syntax13">'</span><span class="syntax18">,</span>
<span class="gutter">  78:</span>                <span class="syntax13">'</span><span class="syntax13">interests_user_id</span><span class="syntax13">'</span>
<span class="gutter">  79:</span>            <span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutterH">  80:</span>
<span class="gutter">  81:</span>            <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">blogs</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non-buddies</span>
<span class="gutter">  82:</span>            <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax9">in_array</span><span class="syntax18">(</span><span class="syntax11">$content</span><span class="syntax11">-&gt;delta</span><span class="syntax18">,</span> <span class="syntax10">$restricted_blocks</span><span class="syntax18">)</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  83:</span>            <span class="syntax18">{</span>
<span class="gutter">  84:</span>                <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">'</span><span class="syntax18">;</span>
<span class="gutterH">  85:</span>            <span class="syntax18">}</span>
<span class="gutter">  86:</span>
<span class="gutter">  87:</span>        <span class="syntax18">}</span>
<span class="gutter">  88:</span>    <span class="syntax18">}</span>
<span class="gutter">  89:</span>
<span class="gutterH">  90:</span>    <span class="syntax8">return</span> <span class="syntax10">$content</span><span class="syntax18">;</span>
<span class="gutter">  91:</span><span class="syntax18">}</span>
</span></pre> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/dVIRgsDkEOs" height="1" width="1"/>]]></content:encoded>

    <pubDate>Fri, 21 Nov 2008 13:39:03 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/149-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/149-Drupal-restrict-a-block-to-users-buddies-in-Panels.html</feedburner:origLink></item>
<item>
    <title>Drupal: create a block to display a user's organic groups </title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/gXTTWecWlTs/148-Drupal-create-a-block-to-display-a-users-organic-groups.html</link>
            <category>Drupal</category>
    
    <comments>http://tech.forumone.com/archives/148-Drupal-create-a-block-to-display-a-users-organic-groups.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=148</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=148</wfw:commentRss>
    

    <author>nospam@example.com (Oscar Merida)</author>
    <content:encoded><![CDATA[
    <p>I was a bit surprised that, at least in D6, the organic groups module doesn't supply a block to show a user's group memberships.  We had to display such a block on a client site recently and defined the box ourself.  First, define a new block via hook_block():</p>

<style type="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #009966;
font-style: italic;
}
.syntax2 {
color: #999999;
font-style: italic;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #cc0033;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #0099ff;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #3399ff;
}
--></style>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">forumone_block</span><span class="syntax18">(</span><span class="syntax10">$op</span><span class="syntax11"> </span><span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">list</span><span class="syntax13">'</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$delta</span><span class="syntax11"> </span><span class="syntax18">=</span> <span class="syntax5">0</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$edit</span><span class="syntax11"> </span><span class="syntax18">=</span> <span class="syntax11">array(</span><span class="syntax11">)</span><span class="syntax18">)</span>
<span class="gutter">   3:</span><span class="syntax18">{</span>
<span class="gutter">   4:</span>    <span class="syntax8">switch</span><span class="syntax18"> (</span><span class="syntax10">$op</span><span class="syntax18">)</span> <span class="syntax18">{</span>
<span class="gutterH">   5:</span>        <span class="syntax8">case</span> <span class="syntax13">'</span><span class="syntax13">list</span><span class="syntax13">'</span><span class="syntax18">:</span>
<span class="gutter">   6:</span>            <span class="syntax10">$blocks</span><span class="syntax18">[</span><span class="syntax5">0</span><span class="syntax18">]</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">info</span><span class="syntax13">'</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax6">t</span><span class="syntax18">(</span><span class="syntax14">&quot;</span><span class="syntax14">OG</span><span class="syntax14">:</span><span class="syntax14"> </span><span class="syntax14">Show</span><span class="syntax14"> </span><span class="syntax14">a</span><span class="syntax14"> </span><span class="syntax14">profile</span><span class="syntax14">'</span><span class="syntax14">s</span><span class="syntax14"> </span><span class="syntax14">group</span><span class="syntax14"> </span><span class="syntax14">membership</span><span class="syntax14">.</span><span class="syntax14">&quot;</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">   7:</span>
<span class="gutter">   8:</span>            <span class="syntax8">return</span> <span class="syntax10">$blocks</span><span class="syntax18">;</span>
<span class="gutter">   9:</span>        <span class="syntax8">break</span><span class="syntax18">;</span>
<span class="gutterH">  10:</span>
<span class="gutter">  11:</span>        <span class="syntax8">case</span> <span class="syntax13">'</span><span class="syntax13">view</span><span class="syntax13">'</span><span class="syntax18">:</span>
<span class="gutter">  12:</span>            <span class="syntax8">switch</span><span class="syntax18"> (</span><span class="syntax10">$delta</span><span class="syntax18">)</span>
<span class="gutter">  13:</span>            <span class="syntax18">{</span>
<span class="gutter">  14:</span>                <span class="syntax8">case</span> <span class="syntax5">0</span><span class="syntax18">:</span>
<span class="gutterH">  15:</span>                    <span class="syntax10">$block</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">subject</span><span class="syntax13">'</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax6">t</span><span class="syntax18">(</span><span class="syntax13">'</span><span class="syntax13">My</span><span class="syntax13"> </span><span class="syntax13">Groups</span><span class="syntax13">'</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  16:</span>                    <span class="syntax10">$block</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">content</span><span class="syntax13">'</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax6">forumone_users_og</span><span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  17:</span>                <span class="syntax8">break</span><span class="syntax18">;</span>
<span class="gutter">  18:</span>            <span class="syntax18">}</span>
<span class="gutter">  19:</span>            <span class="syntax8">return</span> <span class="syntax10">$block</span><span class="syntax18">;</span>
<span class="gutterH">  20:</span>        <span class="syntax8">break</span><span class="syntax18">;</span>
<span class="gutter">  21:</span>    <span class="syntax18">}</span>
<span class="gutter">  22:</span><span class="syntax18">}</span>
</span></pre>
<p>The forumone_users_og function takes advantage of the fact that a user's group memberships is a property of the object returned by user_load().  This block assumes that the uid comes from the url of the current page.</p>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">forumone_users_og</span><span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   3:</span><span class="syntax18">{</span>
<span class="gutter">   4:</span>    <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">should</span><span class="syntax2"> </span><span class="syntax2">be</span><span class="syntax2"> </span><span class="syntax2">the</span><span class="syntax2"> </span><span class="syntax2">profile</span><span class="syntax2"> </span><span class="syntax2">the</span><span class="syntax2"> </span><span class="syntax2">current</span><span class="syntax2"> </span><span class="syntax2">user</span><span class="syntax2"> </span><span class="syntax2">is</span><span class="syntax2"> </span><span class="syntax2">looking</span><span class="syntax2"> </span><span class="syntax2">at</span>
<span class="gutterH">   5:</span>    <span class="syntax10">$uid</span> <span class="syntax18">=</span><span class="syntax18"> (</span>int<span class="syntax18">)</span> <span class="syntax6">arg</span><span class="syntax18">(</span><span class="syntax5">1</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">   6:</span>    <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax10">$uid</span><span class="syntax18">)</span>
<span class="gutter">   7:</span>    <span class="syntax18">{</span>
<span class="gutter">   8:</span>        <span class="syntax10">$usernode</span> <span class="syntax18">=</span> <span class="syntax6">user_load</span><span class="syntax18">(</span><span class="syntax8">array</span><span class="syntax18">(</span><span class="syntax13">'</span><span class="syntax13">uid</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">&gt;</span> <span class="syntax10">$uid</span><span class="syntax18">)</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">   9:</span>
<span class="gutterH">  10:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax8">isset</span><span class="syntax18">(</span><span class="syntax11">$usernode</span><span class="syntax11">-&gt;og_groups</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  11:</span>        <span class="syntax18">{</span>
<span class="gutter">  12:</span>            <span class="syntax8">foreach</span><span class="syntax18"> (</span><span class="syntax11">$usernode</span><span class="syntax11">-&gt;og_groups</span> <span class="syntax8">as</span> <span class="syntax10">$ogid</span> <span class="syntax18">=</span><span class="syntax18">&gt;</span> <span class="syntax10">$og</span><span class="syntax18">)</span>
<span class="gutter">  13:</span>            <span class="syntax18">{</span>
<span class="gutter">  14:</span>                <span class="syntax10">$items</span><span class="syntax18">[</span><span class="syntax11">$og</span><span class="syntax11">-&gt;nid</span><span class="syntax18">]</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">data</span><span class="syntax13">'</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax6">l</span><span class="syntax18">(</span><span class="syntax10">$og</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">title</span><span class="syntax13">'</span><span class="syntax18">]</span><span class="syntax18">,</span> <span class="syntax13">'</span><span class="syntax13">node/</span><span class="syntax13">'</span> <span class="syntax18">.</span> <span class="syntax10">$og</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">nid</span><span class="syntax13">'</span><span class="syntax18">]</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutterH">  15:</span>            <span class="syntax18">}</span>
<span class="gutter">  16:</span>            <span class="syntax8">return</span> <span class="syntax6">theme</span><span class="syntax18">(</span><span class="syntax13">'</span><span class="syntax13">item_list</span><span class="syntax13">'</span><span class="syntax18">,</span> <span class="syntax10">$items</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  17:</span>        <span class="syntax18">}</span>
<span class="gutter">  18:</span>    <span class="syntax18">}</span>
<span class="gutter">  19:</span><span class="syntax18">}</span>
<span class="gutterH">  20:</span>
</span></pre>
 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/gXTTWecWlTs" height="1" width="1"/>]]></content:encoded>

    <pubDate>Fri, 21 Nov 2008 13:28:38 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/148-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/148-Drupal-create-a-block-to-display-a-users-organic-groups.html</feedburner:origLink></item>
<item>
    <title>Where is my server?</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/YuyCP7qS5-A/146-Where-is-my-server.html</link>
            <category>Hosting</category>
    
    <comments>http://tech.forumone.com/archives/146-Where-is-my-server.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=146</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=146</wfw:commentRss>
    

    <author>nospam@example.com (Jo Ryden)</author>
    <content:encoded><![CDATA[
    Data centers and the physical location of web sites tend to be a black hole for a lot of people. Have you ever wondered where the server your web site runs off is actually hosted and what it might look like? Forum One partners with <a href="http://www.rackspace.com/" >Rackspace</a> for our clients' hosting needs, which lets us leverage <a href="http://www.rackspace.com/whyrackspace/network/datacenters.php" >a world class hosting infrastructure</a>. Rackspace has data centers in VA, TX, The UK and Hong Kong, all of which feature impressive physical security, highly sophisticated power and network configurations, and skilled teams of network technicians.<br />
<br />
The other day I came across an <a href="http://royal.pingdom.com/2008/11/14/the-worlds-most-super-designed-data-center-fit-for-a-james-bond-villain/" >article</a> about a new data center, built and operated by one of Sweden's largest internet providers in an old bomb shelter 100 ft below the surface of Stockholm city. As impressive as the Rackspace data centers may be, I'm guessing they might turn a slight shade of green with envy when they see these luxury server (and network technician) accommodations.<br />
<br />
<img src="http://farm4.static.flickr.com/3214/3028705951_b330207194_o.jpg" width="450" height="300" alt="" /><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<blockquote>This underground data center has greenhouses, waterfalls, German submarine engines, simulated daylight and can withstand a hit from a hydrogen bomb. It looks like the secret HQ of a James Bond villain.</blockquote> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/YuyCP7qS5-A" height="1" width="1"/>]]></content:encoded>

    <pubDate>Tue, 18 Nov 2008 09:06:00 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/146-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/146-Where-is-my-server.html</feedburner:origLink></item>
<item>
    <title>Did you know Internet Explorer 6 limits how many stylesheets are loaded?</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/N8-YZzMkyxI/144-Did-you-know-Internet-Explorer-6-limits-how-many-stylesheets-are-loaded.html</link>
            <category>Drupal</category>
    
    <comments>http://tech.forumone.com/archives/144-Did-you-know-Internet-Explorer-6-limits-how-many-stylesheets-are-loaded.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=144</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=144</wfw:commentRss>
    

    <author>nospam@example.com (Oscar Merida)</author>
    <content:encoded><![CDATA[
    <p>I ran into this particularly pesky limitation on a recent project and, as in all IE6 related matters, became intensely irritated and angry.  It turns out, that for both IE6 and IE7, only the first 30 &lt;style&gt;&lt/style&gt; and &lt; link type=&quot;text/css&quot; ... /&gt; are parsed.  On Drupal, you can easily reach this limit between the core style sheets, module contributed style sheets, and your own theme's stylesheet.  There are proposed patches, and a lively debate about supporting IE6 at all in the drupal issues tracker <a href="http://drupal.org/node/228818">IE: Stylesheets ignored after 30 link/style tags</a>.  Mind you, this is simply a limit on the number of tags - you can load many files within each tag.</p>
<blockquote>You'll forgive me for not being in favor of making our code lower quality to cater to a dying browser that has already resulted in the waste of hundreds of thousands of hours. If you use @import, you cannot effectively Save-As a page because the imported stylesheets don't come with it. Frankly I've yet to hit the 30 stylesheet mark myself so I've not encountered this problem.</blockquote>
<p>If, like me, you are forced to work in the real world and not some idyllic fantasy land where you get a completely standards compliant browser AND a pony, you can adapt my solution below.  This solution is ideal if you do not want to, or cannot, patch or hack away at Drupal's core.</p>
<p>In your theme, instead of using drupal_get_styles(), we'll use our own function.  Find where the styles markup is defined or echo'd to the browser and replace it with a call to a new function:</p>
<style type="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #009966;
font-style: italic;
}
.syntax2 {
color: #999999;
font-style: italic;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #cc0033;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #0099ff;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #3399ff;
}
--></style>
<pre>
<span class="gutter">   1:</span><span class="syntax10">$styles</span> <span class="syntax18">=</span> <span class="syntax6">my_group_css</span><span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">;</span>
</span></pre>
<p>Before that function is called, you'll need to define it with the following php code:</p>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">Max</span><span class="syntax2"> </span><span class="syntax2">limit</span><span class="syntax2"> </span><span class="syntax2">of</span><span class="syntax2"> </span><span class="syntax2">stylesheets</span><span class="syntax2"> </span><span class="syntax2">in</span><span class="syntax2"> </span><span class="syntax2">IE</span><span class="syntax2"> </span><span class="syntax2">bug:</span><span class="syntax2"> </span><span class="syntax2">see</span><span class="syntax2"> </span><span class="syntax2">http://drupal.org/node/228818</span>
<span class="gutter">   3:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">my_group_css</span><span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   4:</span><span class="syntax18">{</span>
<span class="gutterH">   5:</span>    <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">despite</span><span class="syntax2"> </span><span class="syntax2">the</span><span class="syntax2"> </span><span class="syntax2">name,</span><span class="syntax2"> </span><span class="syntax2">this</span><span class="syntax2"> </span><span class="syntax2">returns</span><span class="syntax2"> </span><span class="syntax2">an</span><span class="syntax2"> </span><span class="syntax2">array</span><span class="syntax2"> </span><span class="syntax2">of</span><span class="syntax2"> </span><span class="syntax2">all</span><span class="syntax2"> </span><span class="syntax2">stylesheets</span>
<span class="gutter">   6:</span>    <span class="syntax10">$styles</span> <span class="syntax18">=</span> <span class="syntax6">drupal_add_css</span><span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">   7:</span>    <span class="syntax10">$output</span> <span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">'</span><span class="syntax18">;</span>
<span class="gutter">   8:</span>    <span class="syntax8">foreach</span><span class="syntax18"> (</span><span class="syntax10">$styles</span> <span class="syntax8">as</span> <span class="syntax10">$media</span> <span class="syntax18">=</span><span class="syntax18">&gt;</span> <span class="syntax10">$css</span><span class="syntax18">)</span>
<span class="gutter">   9:</span>    <span class="syntax18">{</span>
<span class="gutterH">  10:</span>        <span class="syntax10">$css</span> <span class="syntax18">=</span> <span class="syntax9">array_merge</span><span class="syntax18">(</span><span class="syntax10">$css</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">module</span><span class="syntax13">'</span><span class="syntax18">]</span><span class="syntax18">,</span> <span class="syntax10">$css</span><span class="syntax18">[</span><span class="syntax13">'</span><span class="syntax13">theme</span><span class="syntax13">'</span><span class="syntax18">]</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  11:</span>        <span class="syntax10">$groups</span> <span class="syntax18">=</span> <span class="syntax9">array_chunk</span><span class="syntax18">(</span><span class="syntax9">array_keys</span><span class="syntax18">(</span><span class="syntax10">$css</span><span class="syntax18">)</span><span class="syntax18">,</span> <span class="syntax5">30</span><span class="syntax18">,</span> <span class="syntax8">true</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  12:</span>
<span class="gutter">  13:</span>        <span class="syntax8">foreach</span><span class="syntax18"> (</span><span class="syntax10">$groups</span> <span class="syntax8">as</span> <span class="syntax10">$grp</span><span class="syntax18">)</span>
<span class="gutter">  14:</span>        <span class="syntax18">{</span>
<span class="gutterH">  15:</span>            <span class="syntax10">$output</span> <span class="syntax18">.</span><span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">&lt;style</span><span class="syntax13"> </span><span class="syntax13">type=&quot;text/css&quot;</span><span class="syntax13"> </span><span class="syntax13">media=&quot;</span><span class="syntax13">'</span> <span class="syntax18">.</span> <span class="syntax10">$media</span> <span class="syntax18">.</span> <span class="syntax13">'</span><span class="syntax13">&quot;&gt;</span><span class="syntax13">'</span><span class="syntax18">;</span>
<span class="gutter">  16:</span>            <span class="syntax8">foreach</span><span class="syntax18"> (</span><span class="syntax10">$grp</span> <span class="syntax8">as</span> <span class="syntax10">$url</span><span class="syntax18">)</span>
<span class="gutter">  17:</span>            <span class="syntax18">{</span>
<span class="gutter">  18:</span>                <span class="syntax10">$output</span> <span class="syntax18">.</span><span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">@import</span><span class="syntax13"> </span><span class="syntax13">&quot;</span><span class="syntax13">'</span> <span class="syntax18">.</span> <span class="syntax6">base_path</span><span class="syntax18">(</span><span class="syntax18">)</span> <span class="syntax18">.</span> <span class="syntax10">$url</span> <span class="syntax18">.</span> <span class="syntax13">'</span><span class="syntax13">&quot;;</span><span class="syntax13">'</span> <span class="syntax18">.</span> <span class="syntax14">&quot;</span><span class="syntax14">\n</span><span class="syntax14">&quot;</span><span class="syntax18">;</span>
<span class="gutter">  19:</span>            <span class="syntax18">}</span>
<span class="gutterH">  20:</span>            <span class="syntax10">$output</span> <span class="syntax18">.</span><span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">&lt;/style&gt;</span><span class="syntax13">'</span><span class="syntax18">;</span>
<span class="gutter">  21:</span>        <span class="syntax18">}</span>
<span class="gutter">  22:</span>    <span class="syntax18">}</span>
<span class="gutter">  23:</span>
<span class="gutter">  24:</span>    <span class="syntax8">return</span> <span class="syntax10">$output</span><span class="syntax18">;</span>
<span class="gutterH">  25:</span><span class="syntax18">}</span>
<span class="gutter">  26:</span>
<span class="gutter">  27:</span>
</span></pre> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/N8-YZzMkyxI" height="1" width="1"/>]]></content:encoded>

    <pubDate>Tue, 04 Nov 2008 14:57:54 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/144-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/144-Did-you-know-Internet-Explorer-6-limits-how-many-stylesheets-are-loaded.html</feedburner:origLink></item>
<item>
    <title>Recovering deleted data from ReiserFS 3</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/6j0xSi68kpw/143-Recovering-deleted-data-from-ReiserFS-3.html</link>
    
    <comments>http://tech.forumone.com/archives/143-Recovering-deleted-data-from-ReiserFS-3.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=143</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=143</wfw:commentRss>
    

    <author>nospam@example.com (Mike Shade)</author>
    <content:encoded><![CDATA[
    Everyone suffers from clouded judgement from time to time; thankfully, there are tools that exist that may help correct your fat-fingered mistakes.  Suffice to say, I had to delve into this subject recently and I thought I would share my method of recovering some important files from a ReiserFS partition.<br />
<br />
If you or a user have mistakenly deleted or moved files from a filesystem, all is not lost.  Most distributions of Linux that support ReiserFS ship with a couple of tools that can be used to recreate the filesystem if the data is still intact on the device.  I will be discussing <strong>reiserfsck</strong> and a couple of more generic disk tools in this post.<br />
<br />
First and foremost, it is important to <strong>unmount the partition as soon as you have discovered the mistaken deletion</strong>!  Stop using it.  While data is not wiped from the drive in a deletion, unlink, or move operation, the area of the disk which the deleted file occupied is marked as available.  <strong>If you continue working with the filesystem after having deleted the file, chances are very good that the freed space will be used, destroying the file you want to recover</strong>!<br />
<br />
The second rule of data recovery is to <strong>always make a backup of the affected partition</strong>.  If for some reason the filesystem check makes matters worse, you can revert to the previous state.  This is important, but sometimes difficult if working with large disks or partitions.  Trust me, you will want to make sure you have that backup.  If <strong>reiserfsck</strong> is unable to correct the problem, you may want to try another approach later.  Having a backup of the partition is paramount in this situation.<br />
<br />
Let's begin with that disk image.  The <strong>dd</strong> utility can be used to make a backup of a partition or a whole disk.  Remember to specify block size when you make your copy, or you will be waiting a long time for it to complete.  This example assumes your affected partition is <em>/dev/sde1</em> and you have enough space in <em>/data</em> to hold the image.  You must unmount the partition if you have not already before continuing.<br />
<br />
<code><br />
# dd if=/dev/sde1 of=/data/sde1-backup.img bs=16M<br />
</code><br />
<br />
Now that we have a bit-for-bit backup available of the damaged ReiserFS partition, we can begin working.<br />
<br />
This method employs the <strong>reiserfsck</strong> utility to scan the entire partition and rebuild the filesystem tree from data that is encountered.  This is a big, sweeping rewrite of the partition which will recover as many whole files as possible.  In my particular case, this is what I wanted -- I was after a few complete directories that had been wrongfully deleted.  Depending on how quickly you caught the deletion and began this process, you may or may not recover everything in its normal location.  Files that are recovered but were unable to be renamed correctly will be placed in <strong>lost+found</strong>.  They will be given numeric names which loosely correspond to their locations in the filesystem.  Files that have the same first few numbers were likely in the same directory together.<br />
<br />
This invocation of <strong>reiserfsck</strong> will perform the operation described above:<br />
<br />
<code><br />
# reiserfsck --rebuild-tree -S /dev/sde1<br />
</code><br />
<br />
You will be required to enter 'Yes' at this point to continue.  Since we have made a backup of the partition using <strong>dd</strong> previously, there is no need to worry about what will happen here.  Should something go wrong, we still have the original image of the filesystem to revert to if needed.<br />
<br />
Depending on the size of your partition, this operation may take a long time.  When it returns, <strong>reiserfsck</strong> will output a summary of what was done -- how many files, directories, links, etc were recovered will be listed.<br />
<br />
Now, hold your breath, mount the partition, and take a look around.  If you are lucky, your files will be accessible in their original locations.  If not, you will need to dig through <strong>lost+found</strong> and try to identify the numerically named files that were recovered.  The <strong>file</strong> utility can make this a bit simpler to quickly identify files without having to open them individually.<br />
<br />
Be careful, and good luck!   
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/6j0xSi68kpw" height="1" width="1"/>]]></content:encoded>

    <pubDate>Mon, 03 Nov 2008 12:34:50 -0500</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/143-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/143-Recovering-deleted-data-from-ReiserFS-3.html</feedburner:origLink></item>
<item>
    <title>Rackspace acquires VPS provider</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/QlbGkn2nIAA/142-Rackspace-acquires-VPS-provider.html</link>
            <category>Hosting</category>
    
    <comments>http://tech.forumone.com/archives/142-Rackspace-acquires-VPS-provider.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=142</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=142</wfw:commentRss>
    

    <author>nospam@example.com (Jo Ryden)</author>
    <content:encoded><![CDATA[
    <a href="http://www.rackspace.com/information/mediacenter/release.php?id=8385" >Rackspace announced</a> just this week that they have acquired VPS (Virtual Private Server) provider <a href="http://www.slicehost.com/" >Slicehost</a>.<br />
<br />
<blockquote>Our new offerings are part of a strategy to bring cloud benefits to all businesses with simple, cost-effective products that everyone can use, backed by the best customer support that only Rackspace can deliver</blockquote><br />
<br />
The news follows the success of <a href="http://aws.amazon.com/" >Amazon Web Services</a>, also just announcing its service has left the beta phase and entered General Availability. While Amazon Web Services has been loosely targeting the developer market and has been considered a "geek(y)" service, the Rackspace offering has its aim set more clearly at a production level service for the business market, the offering being backed by the characteristic promise of fanatical support and more tailor-made packaging, encompassing backup solutions and other relevant services.<br />
<br />
The nitty-gritty details of the Rackspace offering are yet to be unveiled, and while it looks to be exciting, the Rackspace equivalent of Amazon's S3 storage service will be relying on Mosso, the Rackspace "computing and storage cloud" division, which has had its fair share of <a href="http://www.hostingcoupons.org/web-hosting-mosso-analysis-not-ready-for-prime-time/" >start-up and growing pains</a>. That might give some room for pause initially but I think in the long run this is a way for non-profits and other organizations, struggling with the financial challenges of building and maintaining a complex and solid tech infrastructure, to get in on some of the fun. Virtual Private Servers and cloud computing bring to the table significantly lower investment requirements and the flexibility to create and maintain infrastructure solutions which would normally incur a significant dent in any non-fortune 500 company's tech budget. 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/QlbGkn2nIAA" height="1" width="1"/>]]></content:encoded>

    <pubDate>Sat, 25 Oct 2008 15:38:26 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/142-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/142-Rackspace-acquires-VPS-provider.html</feedburner:origLink></item>
<item>
    <title>Controlling pane visibility in Drupal Panels2</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/IWH_VAnEUaY/140-Controlling-pane-visibility-in-Drupal-Panels2.html</link>
    
    <comments>http://tech.forumone.com/archives/140-Controlling-pane-visibility-in-Drupal-Panels2.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=140</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=140</wfw:commentRss>
    

    <author>nospam@example.com (Oscar Merida)</author>
    <content:encoded><![CDATA[
    <p>We're working on a social networking site, and one requirement is that only a user's buddies can see certain profile information by default.  The site uses <a href="http://drupal.org/project/buddylist">buddylist</a> and I'd installed <a href="http://drupal.org/project/private_nodes">Private nodes</a> to allow users to designate who can see nodes they contribute.  But for their profile, limiting visibility to a user's buddies was a final requirement.  We spent a good bit of time this morning reading the <a href="http://groups.drupal.org/node/7678">Panels2 API</a> to figure out if we could programatically control the visibility of panes within a mini-panel or panel page.  By using Panels' hook_panels_pane_content_alter() hook, we were able to implement this easily.</p>
<p>We already had a module to customize the site, and we added the hook and a helper function to it.  First we needed a way to test if the logged in user was the buddy of the profile being viewed.</p>
<style type="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #009966;
font-style: italic;
}
.syntax2 {
color: #999999;
font-style: italic;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #cc0033;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #0099ff;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #3399ff;
}
--></style>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax3">/**</span>
<span class="gutter">   3:</span><span class="syntax3"> </span><span class="syntax3">*</span><span class="syntax3"> </span><span class="syntax3">Tests</span><span class="syntax3"> </span><span class="syntax3">is</span><span class="syntax3"> </span><span class="syntax3">the</span><span class="syntax3"> </span><span class="syntax3">logged</span><span class="syntax3"> </span><span class="syntax3">in</span><span class="syntax3"> </span><span class="syntax3">user</span><span class="syntax3"> </span><span class="syntax3">is</span><span class="syntax3"> </span><span class="syntax3">a</span><span class="syntax3"> </span><span class="syntax3">buddy</span><span class="syntax3"> </span><span class="syntax3">of</span><span class="syntax3"> </span><span class="syntax3">the</span><span class="syntax3"> </span><span class="syntax3">specified</span><span class="syntax3"> </span><span class="syntax3">uid</span>
<span class="gutter">   4:</span><span class="syntax3"> </span><span class="syntax3">*</span><span class="syntax3"> </span><span class="syntax12">@param</span><span class="syntax3"> </span><span class="syntax18">integer</span><span class="syntax3"> </span><span class="syntax3">user</span><span class="syntax3"> </span><span class="syntax3">id</span>
<span class="gutterH">   5:</span><span class="syntax3"> </span><span class="syntax3">*/</span>
<span class="gutter">   6:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">user_is_buddy</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">)</span>
<span class="gutter">   7:</span><span class="syntax18">{</span>
<span class="gutter">   8:</span>    <span class="syntax8">static</span> <span class="syntax10">$is_buddy</span><span class="syntax18">;</span>
<span class="gutter">   9:</span>    <span class="syntax8">static</span> <span class="syntax10">$user_buddies</span><span class="syntax18">;</span>
<span class="gutterH">  10:</span>    <span class="syntax8">global</span> <span class="syntax10">$user</span><span class="syntax18">;</span> <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">logged</span><span class="syntax2"> </span><span class="syntax2">in</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  11:</span>
<span class="gutter">  12:</span>
<span class="gutter">  13:</span>    <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">isset</span><span class="syntax18">(</span><span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  14:</span>    <span class="syntax18">{</span>
<span class="gutterH">  15:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">isset</span><span class="syntax18">(</span><span class="syntax10">$user_buddies</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  16:</span>        <span class="syntax18">{</span>
<span class="gutter">  17:</span>            <span class="syntax10">$user_buddies</span> <span class="syntax18">=</span> <span class="syntax9">array_keys</span><span class="syntax18">(</span><span class="syntax6">buddylist_get_buddies</span><span class="syntax18">(</span><span class="syntax11">$user</span><span class="syntax11">-&gt;uid</span><span class="syntax18">,</span> <span class="syntax13">'</span><span class="syntax13">uid</span><span class="syntax13">'</span><span class="syntax18">)</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  18:</span>        <span class="syntax18">}</span>
<span class="gutter">  19:</span>
<span class="gutterH">  20:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">users</span><span class="syntax2"> </span><span class="syntax2">are</span><span class="syntax2"> </span><span class="syntax2">their</span><span class="syntax2"> </span><span class="syntax2">own</span><span class="syntax2"> </span><span class="syntax2">buddies</span>
<span class="gutter">  21:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax10">$uid</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$user</span><span class="syntax11">-&gt;uid</span><span class="syntax18">)</span>
<span class="gutter">  22:</span>        <span class="syntax18">{</span>
<span class="gutter">  23:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax8">true</span><span class="syntax18">;</span>
<span class="gutter">  24:</span>        <span class="syntax18">}</span>
<span class="gutterH">  25:</span>        <span class="syntax8">else</span> <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax18">!</span><span class="syntax8">empty</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">  26:</span>        <span class="syntax18">{</span>
<span class="gutter">  27:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">=</span> <span class="syntax9">in_array</span><span class="syntax18">(</span><span class="syntax10">$uid</span><span class="syntax18">,</span> <span class="syntax10">$user_buddies</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  28:</span>        <span class="syntax18">}</span>
<span class="gutter">  29:</span>        <span class="syntax8">else</span>
<span class="gutterH">  30:</span>        <span class="syntax18">{</span>
<span class="gutter">  31:</span>            <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span> <span class="syntax18">=</span> <span class="syntax8">false</span><span class="syntax18">;</span>
<span class="gutter">  32:</span>        <span class="syntax18">}</span>
<span class="gutter">  33:</span>    <span class="syntax18">}</span>
<span class="gutter">  34:</span>
<span class="gutterH">  35:</span>    <span class="syntax8">return</span> <span class="syntax10">$is_buddy</span><span class="syntax18">[</span><span class="syntax10">$uid</span><span class="syntax18">]</span><span class="syntax18">;</span>
<span class="gutter">  36:</span><span class="syntax18">}</span>
<span class="gutter">  37:</span>
<span class="gutter">  38:</span>
</span></pre>
<p>In our implementation of the alter content hook, we simply remove the content we do not want to display if our is_buddy test fails by setting it to null.  If content is empty, then the pane does not display at all.  For most panes, the delta attribute should be sufficient to identify it, but some panes, like node fields and node field groups, have different deltas per user, so we had to rely on the subject property instead.</p>
<pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax17">&lt;?php</span>
<span class="gutter">   2:</span><span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">implementation</span><span class="syntax2"> </span><span class="syntax2">of</span><span class="syntax2"> </span><span class="syntax2">hook_panels_pane_content_alter</span>
<span class="gutter">   3:</span><span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">http://groups.drupal.org/node/7678</span>
<span class="gutter">   4:</span><span class="syntax8">function</span><span class="syntax8"> </span><span class="syntax6">my_module_panels_pane_content_alter</span><span class="syntax18">(</span><span class="syntax10">$content</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$pane</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$args</span><span class="syntax18">,</span><span class="syntax11"> </span><span class="syntax10">$context</span><span class="syntax18">)</span>
<span class="gutterH">   5:</span><span class="syntax18">{</span>
<span class="gutter">   6:</span>    <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">user</span><span class="syntax2"> </span><span class="syntax2">profile</span><span class="syntax2"> </span><span class="syntax2">customizations</span>
<span class="gutter">   7:</span>    <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">user</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax6">arg</span><span class="syntax18">(</span><span class="syntax5">0</span><span class="syntax18">)</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax10">$profile_uid</span> <span class="syntax18">=</span><span class="syntax18"> (</span>int<span class="syntax18">)</span> <span class="syntax6">arg</span><span class="syntax18">(</span><span class="syntax5">1</span><span class="syntax18">)</span><span class="syntax18">)</span>
<span class="gutter">   8:</span>    <span class="syntax18">{</span>
<span class="gutter">   9:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">profile</span><span class="syntax2"> </span><span class="syntax2">about</span><span class="syntax2"> </span><span class="syntax2">stuff</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non</span><span class="syntax2"> </span><span class="syntax2">buddies,</span><span class="syntax2"> </span><span class="syntax2">EVER</span>
<span class="gutterH">  10:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">delta</span><span class="syntax2"> </span><span class="syntax2">is</span><span class="syntax2"> </span><span class="syntax2">diff</span><span class="syntax2"> </span><span class="syntax2">for</span><span class="syntax2"> </span><span class="syntax2">every</span><span class="syntax2"> </span><span class="syntax2">user</span>
<span class="gutter">  11:</span>        <span class="syntax10">$is_buddy</span> <span class="syntax18">=</span> <span class="syntax6">user_is_buddy</span><span class="syntax18">(</span><span class="syntax10">$profile_uid</span><span class="syntax18">)</span><span class="syntax18">;</span>
<span class="gutter">  12:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">About</span><span class="syntax13"> </span><span class="syntax13">You</span><span class="syntax13">'</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$content</span><span class="syntax11">-&gt;subject</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  13:</span>        <span class="syntax18">{</span>
<span class="gutter">  14:</span>            <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax8">null</span><span class="syntax18">;</span>
<span class="gutterH">  15:</span>        <span class="syntax18">}</span>
<span class="gutter">  16:</span>
<span class="gutter">  17:</span>        <span class="syntax2">//</span><span class="syntax2"> </span><span class="syntax2">don't</span><span class="syntax2"> </span><span class="syntax2">display</span><span class="syntax2"> </span><span class="syntax2">blog</span><span class="syntax2"> </span><span class="syntax2">posts</span><span class="syntax2"> </span><span class="syntax2">to</span><span class="syntax2"> </span><span class="syntax2">non-buddies</span>
<span class="gutter">  18:</span>        <span class="syntax8">if</span><span class="syntax18"> (</span><span class="syntax13">'</span><span class="syntax13">blogs_user_id</span><span class="syntax13">'</span><span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax11">$content</span><span class="syntax11">-&gt;delta</span> <span class="syntax18">&amp;</span><span class="syntax18">&amp;</span> <span class="syntax8">false</span> <span class="syntax18">=</span><span class="syntax18">=</span> <span class="syntax10">$is_buddy</span><span class="syntax18">)</span>
<span class="gutter">  19:</span>        <span class="syntax18">{</span>
<span class="gutterH">  20:</span>            <span class="syntax11">$content</span><span class="syntax11">-&gt;content</span> <span class="syntax18">=</span> <span class="syntax13">'</span><span class="syntax13">'</span><span class="syntax18">;</span>
<span class="gutter">  21:</span>        <span class="syntax18">}</span>
<span class="gutter">  22:</span>    <span class="syntax18">}</span>
<span class="gutter">  23:</span>
<span class="gutter">  24:</span>    <span class="syntax8">return</span> <span class="syntax10">$content</span><span class="syntax18">;</span>
<span class="gutterH">  25:</span><span class="syntax18">}</span>
</span></pre>
 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/IWH_VAnEUaY" height="1" width="1"/>]]></content:encoded>

    <pubDate>Tue, 21 Oct 2008 13:30:45 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/140-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/140-Controlling-pane-visibility-in-Drupal-Panels2.html</feedburner:origLink></item>
<item>
    <title>Using Javascript to Fix What CSS Can't</title>
    <link>http://feedproxy.google.com/~r/ForumOneTechBlog/~3/dZMUR3-O504/139-Using-Javascript-to-Fix-What-CSS-Cant.html</link>
    
    <comments>http://tech.forumone.com/archives/139-Using-Javascript-to-Fix-What-CSS-Cant.html#comments</comments>
    <wfw:comment>http://tech.forumone.com/wfwcomment.php?cid=139</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tech.forumone.com/rss.php?version=2.0&amp;type=comments&amp;cid=139</wfw:commentRss>
    

    <author>nospam@example.com (Matt Gibbs)</author>
    <content:encoded><![CDATA[
    As I hinted to in a <a href="http://tech.forumone.com/archives/56-Web-Developer-Design-Considerations.html"  title="Web Developer Design Considerations">previous post</a>, the roles of developers and designers are becoming more and more indistinguishable. Modern layouts can involve more time spent on scripting (PHP, Javascript) than on actual design (HTML, CSS, Photoshop). Take <a href="http://www.newsvine.com/"  title="Newsvine">Newsvine</a> for example. It's filled with drag-n-drop panels, auto-refreshing of content, and persistent panel states (minimize/maximize/remove). Evidently, scripting can also cover some gray areas that CSS can't yet solve on its own.<br />
<br />
Some of the more interesting uses of Javascript from the following blog post include:<br />
<br />
1. <strong>enabling PNG transparency in IE6</strong><br />
2. <strong>loading images only when their position is visible to the browser</strong> (Lazy Loading)<br />
3. <strong>aligning elements consistently throughout browsers</strong><br />
4. <strong>increasing the size of click targets</strong><br />
5. <strong>setting equal column heights for div elements</strong> (thus imitating a table-based layout)<br />
<br />
<a href="http://www.noupe.com/css/using-javascript-to-fix-12-common-browser-headaches.html"  title="Noupe.com">Using Javascript to Fix 12 Common Browser Headaches</a> 
    <img src="http://feeds.feedburner.com/~r/ForumOneTechBlog/~4/dZMUR3-O504" height="1" width="1"/>]]></content:encoded>

    <pubDate>Mon, 13 Oct 2008 11:24:00 -0400</pubDate>
    <guid isPermaLink="false">http://tech.forumone.com/archives/139-guid.html</guid>
    
<feedburner:origLink>http://tech.forumone.com/archives/139-Using-Javascript-to-Fix-What-CSS-Cant.html</feedburner:origLink></item>

</channel>
</rss>
