Marcus French's blog

Displaying content based on logged in status, and updating view count on a view

Using a customfield view field: http://drupal.org/project/views_customfield
<?php
global $user;
$content_to_display=$data->node_revisions_body;
 
if ($user->uid) {
         echo $content_to_display;
}
if (!$user->uid) {
echo substr($content_to_display,0,350);
echo " [...] <a href=\"/user/register\">Register</a> or <a href=\"/user/login\">log in</a>  to read more.";
}
?>
 
<?php
// Need to do this b/c statistics won't update from a view
// Based on statistics.module
// MPF Oct 19, 2009
// A node has been viewed, so update the node's counters.

The Grinder

After getting into OpenSTA, we're switching to The Grinder for our opensource performance testing. Thought this was interesting:

1.1.3. How does The Grinder stack up against a commercial tool like Mercury Interactive's LoadRunner™?

Here is an edited version of Tom Braverman's post to grinder-use.

A few reasons:

* The Grinder is lightweight

Compared to setting up LoadRunner or some other full featured tools, The Grinder is trivial to install and get running.
* The Grinder is a programmer's load tester

LoadRunner Timestamps

For simplicity's sake, the following are some timestamps you can use in LoadRunner:
    lr_save_datetime("%m/%d/%y 00:00:00", DATE_NOW + ONE_DAY + ONE_DAY, "in_two_days");
 
    lr_save_datetime("%m/%d/%y 00:00:00", DATE_NOW + ONE_DAY , "in_one_day");
 
    lr_save_datetime("%m/%d/%y %H:%M:%S", DATE_NOW + ONE_HOUR + ONE_HOUR, "in_two_hours");

Drupal Ubercart Error

I received the following error in a virtual merchant payment gateway in UberCart:

Credit card payment declined error message. Array ( [errorCode] => 4009 [errorName] => Required Field Not Supplied [errorMessage] => The field Customer Code (ssl_customer_code) required but not supplied in the authorization request. )

To fix this, add the following between line 118 and 119 in uc_virtualmerchant.module:

'ssl_customer_code' => 1111,

Joomla Performance Grader

For any Joomla sites out there, I'd highly recommend testing your site using the Joomla Performance Grader found here: http://www.joomlaperformance.com/component/option,com_performance/Itemid...

Very detailed and Joomla-specific testing done here, it definitely helps with page load speed.

Syndicate content