Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I'd like to add a feature to Drupal's blog module that would allow users with existing blogs to easily connect the two. Consequently, when a user posts in his/her existing blog, the same post shows up in Drupal's blog. First question--does something like this already exist? Wouldn't want to re-invent the wheel...
I'm working on a custom module for my site. After the user creates a new node using the module and it has been validated & subitted - I want to present a "thank you" page to the user and take other follow-up actions. Which hook would be best to use for this function?
I've searched, but haven't found how/if one can add a separator to a menu. I'd like to break the items in one of my menus by a line ( -------------- ) with no URL. I looked at hacking the menu_overview_tree_rows function, but that seemed a bit daunting. Has anyone else done this? I was thinking of a constant such as '###' in the URL field indicating separator.
I have created a module that will search the signature and email address for a query to return the name and email address of registered users. This way I do not need to list the email addresses. The menu function does not work. The item shows up for the admin but does not populate the menu path fields with the information I have inputed. Here is the code:
/***
<?php
/**
* Menu callback; presents the emailsearch form and/or emailsearch results.
*/
function emailsearch_view() {
code here to works just have problem with emailsearch_menu()
$nam=$_POST['name'];
if($nam=="")
{
$nam="ZZZ";
}
$sql_query = "SELECT * FROM USERS WHERE (signature LIKE '%$nam%')||(mail LIKE '%$nam%') order by 'signature'";
//store the SQL query in the result variable
$result = db_query($sql_query);
if(db_num_rows($result))
{
while($row = db_fetch_array($result))
{
$output.=("<p>$row[signature] : <a href=mailto:\"$row[mail]\">$row[mail]</a>");
}
}
//print theme('page', $nam);
print theme('page',$output ,t('Email search'));
}
/**
* Implementation of hook_perm().
*/
function emailsearch_perm() {
return array('access content');
}
/**
* Implementation of hook_link().
*/
function emailsearch_link($type) {
$links = array();
if ($type == 'page' && user_access('access content')) {
$links[] = l(t('emailsearch'), 'emailsearch', array('title' => t('Search for email address.')));
}
if ($type == "system") {
menu("emailsearch", t("email"), "emailsearch", 0, MENU_SHOW);
}
return $links;
}
function emailsearch_menu($may_cache) {
$items = array();
$items[] = array('path' => 'emailsearch', 'title' => t('Email Search'),
'callback' => 'emailsearch_view',
'access' => user_access('access content'),
'type' => 22);
return $items;
}
?>
I can not get my menu item to show up. When I enable it it has all areas empty. It does not like the path field. If I put admin in the field it points to the admin page.