Classified Ads (ed-classified) - No contact option
I have installed the Classified Ads module.
The problem I have is the contact option. Or the lack of it...
Registered users can see what user has posted the ad, and go via the contact page of that user. Not really a very elegant solution I think. And unregistered users can't contact the advertiser at all.
The module has one option under "Ad content policy" (/admin/settings/ed-classified):
-------------------- snip ------------------
Show contact link on classified ad posts
Provide contact link in classified ad links. Not necessary if you provide an alternative method of contacting advertisers, such as the privatemsg module).
-------------------- snip ------------------
This is checked but it seemes to have no effect.
Any hints or tips please?
K

CCK + emailfield
download CCK module, and the CCK email field
those will give you an option to setup an email option, so when one posts an ad, they supply an e-add to be contctaed on
AuthorContact + some .tpl finesse
I ran into the same problem and ended up going with AuthorContact which is a block module and provides an e-mail field, subject & 'comment' or body section for an anonymous user to contact the author.
I personally didn't like the overall bulkiness of the contact fields within the node, so I created a node-post.tpl.php (post being my classified ad content type) and added the following information below the content section into the template for a collapsible fieldset:
<script type="text/javascript" src="/misc/collapse.js?L"></script><div class="authorcontact">
<fieldset class="menu-item-form collapsible collapsed"><legend>Email the seller about this item</legend>
<?php $block = module_invoke('authorcontact', 'block' , 'view', 0); ?>
<?php print $block['content']; ?>
</fieldset>
</div>
I am so far happy with the results, though at the time of this writing, the site is still in 'beta' testing...
The checkbox for contact in ed-classified D6
I've added send private msg to the ad creator, but any messaging method should be available.
see my code below from the ed-classified.module
I have commented out contact checkbox logic and only check to see if the user logged in is not the ad creator.
hope this helps
S
/**
* Implementation of hook_link().
*/
function ed_classified_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
global $user;
if (_ed_classified_node_is_classified($node)) {
//if (user_access('access user profiles') && _ed_classified_variable_get('show_contact_form_link_on_posts', TRUE) && _ed_classified_module_exists('contact')) {
$ad_author = user_load(array('uid'=>$node->uid));
// echo 'ed_classified_link ad_author='.$ad_author->uid.' ';
if ($ad_author && $user->uid != $ad_author->uid && $ad_author->uid != 0) {
$links['ed_classified_contact'] =
//array('title'=>t('View the advertiser\'s (@advertiser) profile.', array('@advertiser'=> $ad_author->name)),
// 'href' => 'user/' . $ad_author->uid,
// 'html' => TRUE);
array('title'=>t('Contact @advertiser.', array('@advertiser'=> $ad_author->name)),
'href' => 'messages/new/' . $ad_author->uid,
'html' => TRUE);
}
//}
// Show contact link
//if (0 != $user->uid && module_exists('contact')) { // only if logged in and there's a sitewide contact form
// $links['ed_classified_suggest_new_category'] =
// array('title' => t('Suggest a new category'),
// 'href' => 'contact',
// 'attributes' => array('title'=>t('Click here to suggest a new classified ad category')));
// }
}
return $links;
}
You can use the "Write to
You can use the "Write to Author" option in private message module (http://drupal.org/project/privatemsg). It will show under each classified ads listing.