This forum is for assistance with theme development.

How to modify the html of a block?

I'm completely new to Drupal, so forgive me if this is a newbie question (and yes, I have searched the docs and forums). Is there any easy way to modify the output of a block? For example, to change the length of the user login form text fields, or the layout of the login forms?

User page, how to change and other

Hi. Is there a way to change the user "node" (phptemplate engine) ?

Where I can change/add some text to the login page/node ?

Where I can get the form displaied in "?q=user/X/contact" (X is the uid) ?

Tnx in advance

obfuscate emails with your theme

Here's yet another way to obfuscate emails. Setting aside the question of whether it works and how long it might work, on this particular site we wanted the site-wide but weak protection that this provides. Most of the existing obfuscation techniques are parts of modules, but here the more reliable (and potentially efficient?) mechanism is to do all your obfuscation at once at the theme level. In this case, the emails were being exposed by the civicrm module in the profiles.

So here it is in two parts:

1. In the template.php file, add these two functions:


function _phptemplate_encode_mailto($mail) {
$link = 'document.write(\'' . $mail . '\');';
$js_encode = ''; for ($x = 0; $x < strlen($link); $x++) {
$js_encode .= '%' . bin2hex($link{$x});
}

$link = '

eval(unescape(\''.$js_encode.'\'))

';
$link .= ''.str_replace(array('@','.'),array(' at ',' dot '),$mail). '';
return $link;
}

function phptemplate_safemail($text) {
if (strpos($text, '@') === FALSE)
return $text;
// Split at and so that we can avoid encoding addresses in link text.
$t = preg_replace(":( $a = explode("\001", $t);
$n = count($a);

for ($i = 0; $i < $n; ++$i) {
if (preg_match('/^(]*)mailto:([^@]+@[-.a-z0-9]+)(.*)/i', $a[$i], $m)) {

Does profile_load_profile not work anymore?

Have a sticky problemI can't work out.

the following used to work perfectly before for extracting and displaying a particular profile field in a block/node.tpl.php/php page...but it won't work for me with Drupal 4.6.6.

<?php global $user ;?>
<?php profile_load_profile($user->uid); ?>
<?php print $user->profile_companyname; ?>

Anyone any ideas? did a quick search to see if there were any notices about a change in how Drupal works.

Phil

Link Underline below images

I'm trying to get rid of the underline below links and images, using box_grey, and it has a { text-decoration: none; }
but there are still underlines, most annoyingly under the logo image in the header. Am i missing somthing? Thanks.

Theming comments

It's a cool feature to style admin comments in a different way that normal uses (like thinkvitamin.com does). If a user uploads a picture as part of their profile will that show up in forums or comments?

Also is there anyway to theme comments based on role or something?

I suppose if there isn't I could always edit the comment theme function in theme.inc (I'm guessing its there) to spit out that user's role as a class in the comment. Then I could make admin comments look different via css. What do you think?

Pages

Subscribe with RSS Subscribe to RSS - Theme development