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

New Module's Content

Hi,

I have created a new module, when we enter in this module like 'user/newmodule' in the address bar.
A form is displayed that takes some input and put the values in the database after submission. At the end of the newmodule_form_submit function, I have used drupal_goto('newmodule') and I have put the code in the newmoudle_menu function like this.

function newmodule_form_submit($form_id,$form_values){
......
......
......
......
......
drupal_goto('newmodule');
}

function newmodule_menu($may_cache){
 $items[] = array('path' => 'newmodule',
                                  'title' => t('On New Module'),
                                  'callback' => 'newmodule_all',
                                  'access' => user_access('access newmodule content'),
                                  'type' => MENU_CALLBACK);   
}

and the function newmodule_all .............

function newmodule_all(){
// content variable that will be returned for display
$page_content = '';

// Get today's date
$today = getdate();

// calculate midnight one week ago
$start_time = mktime(0, 0, 0, $today['mon'], ($today['mday'] - 7), $today['year']);

// we want items that occur only on the day in question,
// so calculate 1 day
$end_time = $start_time + 86400;
// 60 * 60 * 24 = 86400 seconds in a day

need to change .module file

can anybody tell me how i can change my previous .module file with new one??? i have posted an module in the project section and i need to change its .module file for some reasons

Input filters may not filter if you remove theme's <div> when editing contemplates

I realized this after modifying a node template using Contemplates that when I mistakenly removed the < div class="field field-type-text field-field-nameofcontent" > from the edit template section for body that the input filter I selected stopped working. I had mistakenly just inserted the < ? php print ? > part and was ready to reinstall when the reason occurred to me. There may be more to it than this but re-adding the div worked for me.

I'm posting this just in case someone else runs across this mistake.

Views: Pages and Blocks not playing well together?

re: Views Module, Drupal 5.2
Is it possible to display a Views generated block on a Views generated page? I can't seem to get it to work.

I am trying to create a custom front page by creating a PAGE view of the newest three articles, and below that display a BLOCK view list of articles from a particular vocab/term.

I created two new Views:

Escaping forward slashes in the path with clean URLs enabled?

I've spent a good chunk of time poking around D.O. and the internet at large for this and all I've come up with is this somewhat inconclusive bug report: http://drupal.org/node/93854

What I would like to do is pass a web URL to a Drupal path - in this case I'm writing a module that will log the request, and then redirect the user on their merry way... so I tried URL encoding the destination URL, resulting in a path that looks like:

determine current user's session expiration

Is it possible to determine the current user's session expiration (including for anonymous users)? IIRC, this is saved in the 'timestamp' field in the sessions table, but if there are multiple sessions per uid, how can I determine the correct one?

thanks,

-- telcontar

Pages

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