User branding

gaijinu - July 18, 2007 - 08:08
Project:Avatar gallery
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Sometimes you may want to replace the text on top of the avatar gallery block from:
"There are 1000 users on My site" to "There are 1000 gamers on My site" or whatever. I suggest adding:

<?php
  $form
['misc']['avatar_gallery_branding_singular'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Word to replace user in "There is 1 user on the site"'),
   
'#size' => 20,
   
'#maxlength' => 20,
   
'#default_value' => variable_get('avatar_gallery_branding_singular', 'user'),
  );
 
$form['misc']['avatar_gallery_branding_plural'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Word to replace users in "There are x users on the site"'),
   
'#size' => 20,
   
'#maxlength' => 20,
   
'#default_value' => variable_get('avatar_gallery_branding_plural', 'users'),
  );
?>

at the end of function avatar_gallery_admin_settings() right before return system_settings_form($form);

and replace this line (should be around 51)

<?php
$members
= format_plural($result->count, '1 user', '@count users');
?>

with:
<?php
$members
= format_plural($result->count, '1 ' . variable_get('avatar_gallery_branding_singular', 'user'), '@count ' . variable_get('avatar_gallery_branding_plural', 'users'));
?>

The file to be modified is avatar_gallery.module. I've tested this on a multi site installation.
If anyone could make a patch out of this and maybe combine with the other patch for white spaces I'll be grateful.

 
 

Drupal is a registered trademark of Dries Buytaert.