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

Monument module ported to 5.0 in CVS. Testing needed

The Historic Monument module is now ported to work with 5.0 API. The module is in CVS right now - if anyone has time to try it out or even cast an eye over it for XSS vulnerabilities that would be appreciated.

Install files still to do - will commit them tomorrow.

Thanks in advance.

Why not a global $account variable from function user_view()

I was just wondering if it would be an improvement if the function user_view in the user.module would set the $account variable as global, so it can be accessed from other modules without reloading the account object again (and again, and again) from the several modules that create contents or blocks for the profile page.

I know I can probably solve it by creating my own global $profile_account variable in one of my modules in the function mymodule_user when $op=view, but I was just wondering. I'm pretty new to Drupal and php, so any suggestions are most welcome.

Adsense Mondule Help Please.....

Hi everyone

I've searched the forums, and site, to see if I could answer my query myself, but I haven't found anything that answers the problem I'm having.

I'm also not sure if it is a "Drupal" or an "Adsense Module" issue - so I'm not sure where to look in the scheme of things to correct the error I'm getting.

cck item positioning

I'm a new drupaller who is running 5 rc2. I just installed cck and I am trying to figure out how to position cck's output in my node. I want to place it before my story's title, not after, which it seems to by default. I'm trying to use it to place a different image next to my titles depending on the item type I choose (so if anyone knows a better way to do that as well please let me know). I'm not exactly a php master so please dumb it down a little. Thanks in advance.

Need help! Comment form doesn't appear

So I've been working with drupal for a while now, and things have been going great with it until I decided I wanted to allow people to post comments. The post comment form appears for all nodes except the nodes that I have made. This is almost certainly a result of me not programming well, but I can't figure out what I did wrong and would love any help/comments/feedback possible. The code for the module is as such (its for people to submit 'rants')


/**
* Implementation of hook_help().
*/
function rants_help($section) {
switch ($section) {
case 'admin/help#rants':
$output = '

'. t('The Rants module allows users to submit items for the Rants section. ') .'

';
$output .= '

'. t('The Rants module.') .'

';
$output .= t('

You can do stuff

', array('%node-add-rants' => url('node/add/rants'), '%admin-settings-content-types-rants' => url('admin/settings/content-types/rants')));
return $output;
case 'admin/modules#description':
return t('Allows users to submit Rants item');
case 'node/add#rants':
return t('Rants items are rant body and the person who wrote the rant.');
}
}

/**
* Implementation of hook_node_info().
*/
function rants_node_info() {
return array('rants' => array('name' => t('Rants'), 'base' => 'rants'));
}

/**
* Implementation of hook_perm().
*/
function rants_perm() {
return array('create Rants', 'edit own Rants');
}

/**
* Implementation of hook_access().
*/
function rants_access($op, $node) {
global $user;

if ($op == 'create') {
return user_access('create rants');
}

if ($op == 'update' || $op == 'delete') {
if (user_access('edit own Rants') && ($user->uid == $node->uid)) {
return TRUE;
}
}
}

function rants_nodeapi(&$node, $op, $arg = 0){
}

/**
* Implementation of hook_menu().
*/
function rants_menu($may_cache) {
$items = array();

if ($may_cache) {
$items[] = array('path' => 'node/add/rants', 'title' => t('Rants'),
'access' => user_access('create Rants'));
}

return $items;
}

/**
* Implementation of hook_form().
*/
function rants_form(&$node) {
$form['title'] = array('#type'=>'textfield', '#title'=>t('Headline'), '#required'=>TRUE,'#default_value'=> $node->title,'#rows' => 1);
$form['ranter'] = array('#type'=>'textfield','#title'=>t('Author'), '#required'=>TRUE,'#default_value'=>$node->ranter,'#rows'=>1);
$form['introtext'] = array('#type'=>'textarea','#title'=>t('Introduction Text (optional)'), '#required'=>FALSE,'#default_value'=>$node->introtext,'#rows'=>20);
$form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Rant'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
$form['body_filter']['format'] = filter_form($node->format);
return $form;
}

function rants_insert($node) {
db_query("INSERT INTO rants (nid,ranter,rant,introtext) VALUES (%d,'%s','%s','%s')",$node->nid,$node->ranter,$node->body,$node->introtext);

}

function rants_update($node) {

if ($node->revison){
overheard_insert($node);
}
else {
db_query("UPDATE rants SET ranter ='%s', rant = '%s', introtext = '%s' WHERE nid = %d",$node->ranter,$node->rant,$node->introtext,$node->nid);
}
}

function rants_delete($node) {
db_query("DELETE FROM rants WHERE nid= %d",$node->nid);
}

function rants_load($node) {
$additions = db_fetch_object(db_query("SELECT node.created, rants.ranter,rants.rant,rants.introtext FROM rants JOIN node ON node.nid = rants.nid WHERE rants.nid = %d",$node->nid));
return $additions;
}

function rants_view(&$node, $teaser = FALSE, $page = FALSE) {

//$node = node_prepare($node, $teaser);
$test = theme('rants_content',$node);

}

function theme_rants_content($node){

$output .= "

";
$output .= "

B-Rant

";

if ($node->ranter != '')
$output .= "

- submitted by ".$node->ranter." on ".format_date($node->created,'custom','m/d/Y')."

";
else
$output .= "

- added on: ".format_date($node->created,'custom','m/d/Y')."

";

$output .= "
".$node->title."

";

$output .= "

".$node->body."

Views module,May customising the new user list?

Views module,May customising the new user list?

I need according to user's ID arrangement.

Thanks

Pages

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