This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Log users off from admin panel

Is there anyway to log users off via the admin panel (or other ways) Without just putting the site in offline mode?

Google AdSence Q:

I was wandering if there was a way to display ads on the page for admins?

Ok so when normal users are logged on, they see the ads. And when I (the admin) am about to sign on, I see them. Soon as I log on, they disappear. I do not want that happening. Is there a way to display the ads for admin accounts as well?

Situations vacant module

Is there such a thing as a situations vacant or jobs available module?

Problems themeing a form item

So apparently you can call theme functions to format your theme items:

$form  $form['contact']['phone_no'] = array(
    '#theme'        => 'divs_inline',
    '#type'         => 'textfield',
    '#title'        => t('Phone Number'),
    '#description'  => '10 digits, including the area code.',
    '#size'         => 15,
  );

and then the theme function:

function theme_divs_inline($form) {
  return '<div class="divs-inline">'. form_render($form) .'</div>';
}

Or at least that's my understanding of how to use it. The problem being that the form item is not actually printed to screen, But the '

' gets printed so the function is being called.

Further testing indicates that you can do something like:

<?php
$form['cc']['expiry'] = array(
'#theme' => 'children_inline',
);
$form['cc']['expiry']['ccmonth'] = array(
'#type' => 'textfield',
'#title' => t('Exp. Date'),
'#required' => TRUE,
'#maxlength' => 2,
'#size' => 2,
'#attributes' => array(
'onKeyPress' => 'return numbersonly(this, event)',
'onChange' => 'validateCCmonth();'
),
);
$form['cc']['expiry']['ccyear'] = array(
'#type' => 'textfield',
'#description' => t('(mm/yy)'),
'#required' => TRUE,
'#maxlength' => 2,

Adding in sIRF (Flash HTML text replacement)

http://www.mikeindustries.com/sifr/

I want to use the code for sIRF in a Drupal site.

Have done a simple test and got it working in HTML.

How do I go about using it in Drupal? Can I just hack it into the theme module I'm using?

I did try the 'Signwriter' module but it doesn't meet the grade for text quality.

Can I just add HTML code to the page.tpl.php in the template?

Hope this isn't too stupid a question, I'm just a bit out of my depth mess with Drupal's PHP system.

Yani

What is "$var1 = (object)$var2;" doing?

I'm not a PHP expert, but I am able with difficulty to read the code and follow others' logic and sometimes spot where a problem might be fixed, and I'm currently trying to do something like that with the registerprofile.module.

There's a line in it that I don't understand what it's doing - what the syntax means in PHP and I've referred to my PHP books and can't find anything in there that explains what this construct is doing:

$var1 = (object)$var2;

Anyone able to enlighten me?

Cheers,

Jock

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions