Foolog: Mostly geek, tech, misc stuff

Blog - Foolog

Arbitrary Snippets

<?php if (isset($primary_links)) { ?><div id="primary"><?php print theme('primary', $primary_links) ?></div><?php } ?> Will render an active class when the node is being viewed...So that you can add a a.active { class to add your css attribtes to.. Could be a bg color, onHover event or whatever else..

Teasers broken with CCK

Uh...after much efforts trying to sort it out and an innate lethargia, paranoia to hack core.. (especially that dru 5.2 is out just now ..and that I'll wait for a few before I upgrade).. Here's the despo fix for Missing Read-Mores ($node->readmore bool thats almost always false). <div class="field field-type-text field-field-location"> <h3 class="field-label">Location</h3> <div class="field-items"> <?php foreach ((array)$field_location as $item) { ?> <div class="field-item"><?php print $item['view'] ?></div> <?php } ?> </div> </div> <div class="field field-type-text field-field-description"> <h3 class="field-label">Overview</h3> <div class="field-items"> <?php foreach ((array)$field_description as $item) { ?> <div class="field-item"><?php print $item['view'] ?></div> <?php } ?> </div> </div> <div class="field field-type-text field-field-schedule--itinerary"> <h3 class="field-label">Itinerary  </h3> <div class="field-items"> <?php foreach ((array)$field_schedule__itinerary as $item) { ?> <div class="field-item"><?php print $item['view'] ?></div> <?php } ?> </div> </div> <div align="left"><span class="readmore"><?php print l('« More »', 'node/'.$nid, array('title' => 'Read more on this article')); ?></span></div> The lastline was manually added to the template :))..That will not do any strlen()s to validate teaser length to set the readmore bool...but will just display that More link in the teaser view anyway...Works for now, I think this will be fixed in dru6 if I'm not wrong BTW... The teasers themselves break down When used with Custom Links..More CCK-Readmore-Teaser issues!

IE 7 is a blight upon the society

Uh yeah...so my friend and I half-rewrote our 3 column Zen theme to make it look good..and cool IE7 breaks it down like a biatch. Ie 6 is not a lot better..but atleast not as worse. Firefox, Safari3, Knoqueror, Epiphany et al worked with it as smooth as clockwork..Validates..except for the Star Selectors (Which I later realised dint work with IE7 anymore) Much to my selective Php n00bishness.. I thought the get_browser() would be blocked by most hosts as it would have to 'phone out' to the client browser... Contradictorily, It wasnt.. Much to my lethargy to write elonquent code lines with hundreds of $_SERVER[HTTP_USER_AGENT] thingys, I ran into the Browscap module whilst randomly browsing in the contrib.module section on the cvs...Just what I needed! So now that the Browscap module populates a full list of browsers that exist, all I had to do was spend a couple of hours on writing something to filter site compatibility by browser...and obviously IE 7 was getting nothing but the phptemplate_maintenence_page! Earlier, I was driven to the verge of baldness, suicide, depression after continual pissing around with conditional comment lines to get IE7 to use a stylesheet it likes...But sadly enough, IE remained obstinate. All that done, Ie7 blocked and IE6 warded off with a warning, a google ad script for the IE7 maitenence page... It was a happy ending. function phptemplate_maintenance_page($content, $messages = TRUE, $partial = FALSE) { drupal_set_header('Content-Type: text/html; charset=utf-8'); drupal_set_html_head('@import "'. base_path() . drupal_get_path('module', 'system') .'/defaults.css";'); drupal_set_html_head('@import "'. base_path() . drupal_get_path('module', 'system') .'/system.css";'); drupal_set_html_head('@import "'. base_path() . path_to_theme() .'/maintenance.css";'); drupal_set_html_head(' '); $output = "\n"; $output .= ''; $output .= ''; $output .= ' '; $output .= drupal_get_html_head(); $output .= drupal_get_js(); $output .= ''; $output .= ""; $output .= ' '; $output .= 'site header'; $output .= ' '; if ($messages) { $output .= theme('status_messages'); } $output .= $content; $output .= " "; $output .= " "; $output .= ""; return $output; } So that was the override of the default maintenence page in the template.php.. Ofcourse, you can add all the styles you want in the maintenence.css...but again, Dont take the trouble for it's IE7.. you may have to do another maintenence / persuasion page for IE7 might screw up on the CSS again. Feels like heaven to get IE7 out of the way. Might do some more tweaking.. a filter by navigator.Platform / OS detection as a parallel disparate set that can be operated on with various combos of browsers.. Maybe make it easier for myself to block this stupid linux chauvinist I know

Uh..Work Haunts

Far too many deadlines et al..
  • The trekking guy's site.. Been on for six whole months, Done 2 re-makeovers and what not.. The Data entry does not proceed.. Well, Not my problem though..That I'm ready to give him anything from a CSV import unto the db unto a field formatted entry form and yet there's been an eternity of delay trying to find the right persons to do it.. Uh..I got this guy I know to do it, But I'm afraid its hardly par mediocrity for that matter... Good labour comes at a far higher price.. and people like I are hard to find :))
  • The Animal NGO ? Snail's pace..duhh.. It's not my fault.
  • That PMS of mine... Its coming up too.. Plenty o' bugfixing on... I wish I had tried it with CakePHP after all..
  • The womens social networking site.. The rest is about ready..I reckon they'll ask for a pink theme any moment.
  • The big integration... is running into a lot of problems..G2 is a huge problem, basically.
  • Uh..somebody asked me to help me out..The poor server was churning out pages in 4 minutes time doing a poultry 400Queries/page.. Always the case with borrowed code.
  • One more AJAX result table with a user authentication for an arbitrary person.. Not too bad, this.
  • Might be doing National Clg, B'gudi's site too ?...Although I'm not sure whether they want me to.

Where's the Kannada?

We've seen all the misdirected kannada chauvinism by arbitrary retards on Orkut.. Yeah, I mean those folks who created that "Bangalore's full Go Home" community...flamed useless e-wars to prove they were gangsta...and had their community deleted too. But all that I got to notice there was relatively unprovoked flamery against Northies. Sure, There 're them arbitrary retards...but obviously they aren't the folks who make the majority..Atleast, so far as I know..I'd rate less than 50% Northies as being anything ignorant. On the contrary, Here 're the Tamilians..Of whom I'd rate Atleast, a good 80% or more to being fanatics. Tamil sadly, is about as or (in all probability) perhaps more  a staple regional language here in the capital of Kannada..Than Kannada itself. If I were to do a survey about my friends' circle.. I'd probably find out more than 50% of them, who've been in karnataka more than a generation still cant speak a whiff of Kannada!.. All tamil flamery comes during the Cauvery issue and gets forgotten in millsecs. I amn't against Tamil or anything as such..But on the contrary a huge Tamil fan so far as it's beauty as a language goes...But really, Whilst in Karnataka..Please care to respect Kannada for we've an identity of our own. Do we try to speak about in Kannada when we are in Madras? Not that we'd survive doing that either. This is in the wake of a rather (stupid) hilarious incident where I got into a rather nasty fight where I got knocked about by 6 arbitrary sons of bitches.. While I was rather stupid to  (!shut the fuck up and move on to keep move on).. What irked me and made me lose my temper was that these bastards spoke in Tamil continiously whilst I politely asked them to speak in Kannada.. Such is their audacity..and in Karnataka too. Not to mention yet again, That I completely lost control off my wits for that few minutes. The end result = A shaky tooth, Plenty of wounds in the mouth that would soon evolve into painful ulcers, This would require Oral Anasthesia to ward off the pain for a couple of weeks..Not to mention the stammering whilst speaking to people !...Yeah, all this happened and I can still laugh it off So I board a bus from home till Indian Express..and I dont hear a fucking whiff of the native language except for the conductor!..There's Tamil all around..No shortage of Telugu either.. aye, there's malayalam as well..Not to mention the omnipresent 'national language' hindi... I really find it intriguing that kannadigas still take ignorance to all this... There 're the retarded morons who go about the Kannada-Tamil relationship et al... And give me excerpts from Periyar's Aryan Invasion Theory.. I've not but the patience and calm to tell them to go fuck themselves.

Life takes a turnaround.

It was long overdue.. Would've been great had it only come a couple of years earlier. The new found happiness does not last too long.. Far from complacence, it's plain disappointment and ridicule at my own audacity to do something as preposterous as I have..Nonetheless, It's a path I've decided to trod on.. Will take on it no matter what.. Folks at my old abode may not be as cooperative as I'd like them to...but we'll see what happens. Been a fiery busy 2 years..learning new things, more self delusions, greed, resentment in love life, new hopes et al.. Nonetheless, B'lore south feels so good :-)

^:)^ To Ravi Belagere

http://thatskannada.oneindia.in/column/ravibelagere/index.html
I'll beg to differ about aavaraNa, but for the most part..Ravi Belagere happens to have most pragmatic takes on things. Truly an articulate genius.

Why BSNL Sucks.

So, the telephone line was screwed up..Not much to it, for it happens ever so often with BSNL. The faulty telephone complaint number is 080-25452198. And the bot takes the call. Bot: Please dial 1 for Kannada, 2 for English Me: 2 Bot: Please dial the faulty telephone number Me : @*#*$^$^%% (Whatever my number is) Bot: You've provided @*#8$^$^%%. If this is correct, Press 1. else press 2 Me: 1 Bot: "This is not a working number. Than you for calling" *Call Disconnected* WOW. So much for BSNL's artificial intelligence..or whoever the person that made the stupid call bot. To tell me that my number isn't working when that was the fucking reason I was calling. Looks like that's 1 faulty number.

More chronic blogging at 4:43PM

Trying to recollect some of the better stuff on DD
  • Mile sur mera tumhara
  • Baje sargam har taraf se
  • Poorab se
  • eek chidya anek chidya (?..Not sure..I was far too young then )
I can distinctly recall more..but somehow, far too unclear and deep inside thoughts to output !...Seriously LSSP and the creative stuff they came up with was amazing ! ...Those were the kind of things you'd watch without switching channels like you do, with ads on..(You dint have the choice then though. No Satellite TV ! ).. I wish DD can go 10 years back in time.

Drupal 6 FTW !

The codefreeze has happened ! I reckon we can expect Drupal 6 sometime this year ! I was just testing it out a month back or so... It seems much faster than Dru 5 in sorts.
  • The installer is stunning..The password strength indicators have been put up this time around.
  • The sudo user is actually created before the installation is complete, unlike in Dru 5.. 'Nother useful feature
  • Ability to enable clean URLs at installation itself...Somehow, this dint work for me (Me running the latest version of XAMPP )..I enabled it and all my paths started slipping invariably into the hands of apache which would render them 404 (or was it to the localhost root ?)..Anyway.. I'll just expirement with one of the Rewrite Conds.. If that is what is actually causing the problem

PHP4 seems to be heading towards the end of the road and 8.8.08 seems to be the date... Somebody showed me this link - http://news.php.net/php.internals/start/30508... GoPhp5.org is an initiative of veteran Drupallers of the like of Rober Douglass, Ken Rickard and co to actually speed the transition process up and prompt hosting companies to Update their paraphernalia...Really PHP4 is plain rotting and still everywhere. I cant wait for Drupal 7.... But thats probably more than a couple of years away.