Hello,

I'm setting up a drupal for personal site. I use forum module but I dont want to force users to register only to be able to post comments or topic in forum (many would rather not post if having to bother with registration). But I cant find how to allow anonymous users to post also their name, mail and homepage when creating new forum topic (new node). They can do it when posting comments (and also when replying to existing topic) but not when they are creating the topic.

I found quite old issue at drupal.org: After the named anonymous comments, the named anonymous forum topics (July 9, 2004), but for some unknown reason it was closed - it was 'not relevant anymore' but I have no clue why, I just guess its already implemented in core (its quite basic feature).

Comments

mathio’s picture

I digged through the whole drupal admin section again but I didnt find settings for this feature. Do I have to code it myself? I can make a fix (maybe :D) but I'll have troubles updating and thats what I want to avoid. Yes, I could post it here as a fix, but as I wrote in first post I already found something similar here and the topic was closed :( Anyone knows a solution?

mathio’s picture

I talked to few people and they didnt know how to do it eighter. So I think I'll have to find some time and code it myself.

baobab’s picture

Mathio, did you solve anonymous forum topic, like email etc?

syquest’s picture

Go to Administer > Comments > Configure > Posting Settings...

Under Anonymous Commenting, select:
Anonymous posters may leave their contact information

If Anonymous Commenting is greyed out, then you need to adjust "anonomous user" permissions in Admin > Access Control.

neema’s picture

I think he is trying to figure out how to leave contact info for anonymous forum topics; your solution is good for anonymous comments. I am also trying to figure out how to do this with forum topics, anyone have a solution?

MarekP’s picture

Hi,

I have the same problem. I even don't want to offer a registration to my users. I need the topics has the same functionality as comments -- anonymous posting with a name and an optional e-mail.

Is a module or another solution that can do it?

Thank you,

Marek

basby’s picture

I would like to have exactly the same functionality. Anyone who knows how to get it / implement it?

Phillip Mc’s picture

HI Guys,

Anyone worked this one out?

I need the same functionality and have tried everything as well.

phil

jtjones23’s picture

subscribing

Designer Dude’s picture

same here

vgedris’s picture

Looking for the same.

palmstrom’s picture

Probably the biggest flaw of my Drupal websites.

andrej2k’s picture

subscribing

michelle’s picture

Not of immediate help, but this is on the to do list for advanced forum. I don't want to deal with an extra table, so I'm going to go with CCK for the fields.

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.

protoscopic.com’s picture

I'd think that could actually be a more general problem "Content Created by Anonymous Users." Seems like a lot of modules could have use for that.

Steel Rat’s picture

Hi Michelle, I know this is an old thread, but can you add CCK fields that will remember the anonymous user's information via a cookie?

laurent22300’s picture

Did anybody find out how to solve this issue? I would be interested in the solution too.

ebyrne41’s picture

I think what is being sought is the module that provides a CCK field type for email addresses, SEE
http://drupal.org/project/email

Once activated, you then go to 'Create Content > Edit forum topic' and create the field (selecting 'e-mail' from drop-down).

I also created a field for the topic creator to insert their name, just selected 'text' from drop-down.

Hope this helps.
Ed

Steel Rat’s picture

I'm not sure about everyone else, but what I'm seeking is the exact same functionality as we see with comments for unregistered guests. Meaning a Name field, an email field, and a website URL field.

I can create all these as plain text cck fields no problem, but they need to retain the data for the guest user each time they visit, so it would have to be cookie-based. and the fields would not be visible for registered users.

These are the issues I'm facing. Ideally I'd like these for any content type, not just forum topics.

Sean_O’s picture

Would like our users to be able to post new topics without registering, just like comments. Major problem with allowing anon comments, but not new topics, is that users simply post their new topics as comments. Unintended consequence and total drag.

Tomorrow we are plan to move forward with using CCK fields for names and emails and hooks to replace Submitted By, Last_Reply, Created by etc with the CCK data as appropriate.

Would prefer to see standard solution that made anonymous forum posts work the same as comments.

Already sent private messages to Michelle and LBA, with no reply yet (though only sent a few hours ago). We need this soon, please reply if you have any interest.

Thanks,
Sean

ronia’s picture

Dear SeanO

A group seems to be working on these features
Please see http://drupal.org/node/488714#comment-1690538

I also needed this and requested
this group to post this solution.

It is sad that Drupal misses
this essential feature though
it is provided for comments.

SeanO, one additional question.
If you are using forum have
you solved the problem
with Quote ?
http://drupal.org/node/492776

Scunt’s picture

I am really interested in this too. I think i need the same thing - to clarify:

So that instead of :

Submitted by [username - with link to profile] on 17 August 2009

It says

Submitted by [name of an anon user from a 'name' field which he filled in - with no active link] on 17 August 2009

thanksX

khanz’s picture

any news on this?

------------
Volvo, Video, Velcro. (I came, I saw, I stuck around.)

socceronly’s picture

This is just one of those soul crushing Drupal dead ends. Where you get almost to the finish line and realize to get the seemingly simple, rather austere implimentation requires 50 000% more drupal knowledge than you have.

Even when anonymous contact info is activated I really don't want email being required. It reduces participation EXPONENTIALLY.

Homepage?

Too simple to too complex.

michelle’s picture

I gave up on it. Just too much pain involved. Sure, you can add the CCK fields for it but then you have to account for the fact that some posts are attached to a user and some get info out of these fields for any views you make, forum topic lists, etc. I'd still be willing to look at it for AF if someone wants to write it but it's not going to be me.

Michelle

socceronly’s picture

Well if it is causing you pain, it might cause me to jump out the fourth floor window here! lol

Would there be a way to cheat?

Most people don't want the subject in replies. Use that as a name field, not show it but display it where anon would go?

But then what do you do for a Forum topic... of course you keep anons from creating forum topics but you are back to limiting participation again....

Why am I doing this on a Friday night. Is there a Drupal get a life module?

michelle’s picture

Replies already allow anonymous. It's the topic nodes that aren't equipped for them.

Honestly, it's like pulling teeth for me to get my registered users to start new topics. I can't imagine anonymous users starting many, outside of spammers. But, then, my community is small enough that I'm begging for help in my signature so maybe I'm not a good one to judge from. LOL

Michelle

socceronly’s picture

Wait a sec... isn't this a solution?

http://drupal.org/node/183746

If you remove homepage and email you are left with name.

Unfortunately the link posted by worldfallz seems to have evaporated.

socceronly’s picture

Ooops.

I see now it is not, cause it will not work with Forum Topics.

DOH!

:)

bartezz’s picture

subscribe

________________
Live fast die young

HenryLTV’s picture

Even though this topic is for Drupal 5.x, this still seems to be an outstanding issue/problem with D6. After successfully migrating 25,000 forum topics, I'm seriously hoping this doesn't run me into a deadend =\

I thought creating a plain text CCK field "topic_creator" would store the data, and then I could search for the logic that checks for $user->uid and prints "Anonymous" if it equals 0. Then I would just replace this logic with:

$field_topic_creator? print $field_topic_creator : print "Anonymous"

Anyone have a clue how to do this? Or just have an answer to this issue in general? Any help would be greatly appreciated. Willing to pay for solution if absolutely necessary!

Thanks!

bartezz’s picture

Hey Henry,

I think I've done something similar to what you've thought up. And then used a hook in template.php. Am on holiday right now so give me a shout next week if I forget :) Will check into the solution I've used and let ya know, I just can't access it from here!

Cheers

________________
Live fast die young

vistree’s picture

Hi,
I am very interested in this.
As I didn't find a way to let guests create the top topic and leaving there name (which is possible for all replies due comments) I also think on using a cck-field and rewrite the "anonymous" with the value of the cck.
Any approach?

bartezz’s picture

Here's my solution, not sure if it's the best but it works for me:

- I've added two cck fields to my forum cck: Your Name (yourname) and Your E-mail address (yourmail).
- Under admin/content/node-settings (for default settings):
+ Submitted by appearance: By [author-name] on [d] [mon], [yyyy]
+ Comment submitted by appearance: By [comment-author-name] on [comment-d] [comment-mon], [comment-yyyy]
- Under admin/content/node-type/forum (for forum cck settings):
+ Submitted by appearance: By[field_yourname-formatted] on[d] [mon], [yyyy]
+ Comment settings -> submitted by appearance: leave empty for default

This works nicely however in the forum overview page (where all topics are listed) /forum it will still say: 8 hours 42 min ago by anonymous
Therefore I have added this sniplet to my template.php, this will strip the 'by Anonymous' or 'by Username' completely from these pages:

function forum_preprocess(&$variables) {
	if(is_array($variables['forums'])) {
		foreach($variables['forums'] as $topic) {
			$topic->created = current(explode('<br />', $topic->created));
			$topic->last_reply = current(explode('<br />', $topic->last_reply));
		}
	}	
	if(is_array($variables['topics'])) {
		foreach($variables['topics'] as $topic) {
			$topic->created = current(explode('<br />', $topic->created));
			$topic->last_reply = current(explode('<br />', $topic->last_reply));
		}
	}	
}

Another solution might be somthing like this, yet it might cause some performance issues:

function forum_preprocess(&$variables) {
	if(is_array($variables['forums'])) {
		foreach($variables['forums'] as $topic) {
			$topic->created = current(explode('<br />', $topic->created));
			$topic->last_reply = current(explode('<br />', $topic->last_reply));
		}
	}	
	if(is_array($variables['topics'])) {
		foreach($variables['topics'] as $topic) {
			$topic->last_reply = current(explode('<br />', $topic->last_reply));
			if(empty($topic->name)) {
				$node = node_load($topic->nid);
				$topic->created = str_replace('Anonymous', $node->field_uwnaam[0]['value'], $topic->created);
			}
		}
	}	
}

Hope this helps!

Cheers,
Bartezz

________________
Live fast die young

HenryLTV’s picture

Hi Bartezz,

Just came back to update my own solution and I find that it's similar to what you did. I created the Forum CCK field like i mentioned in my first post, then I just edited the forum_preprocess function in template.php.

So in other words, this solution WORKS and is a good workaround =)

I like your idea of removing "by anonymous" too!

Thanks for your post Bartezz, i just hope it saves others the hours of time I invested mucking around for this solution =P

Henry

bartezz’s picture

Good to read it helped!
Reading back I see I forgot to mention this: http://drupal.org/project/submitted_by

Cheers

________________
Live fast die young

vistree’s picture

Hi and thank you for this workaround.
My question: is this a general "override" of the author-variable. Because, I want to use the advanced forum modul and am wondering, if your solution will also "override" the author details in the "author pane"

Have a nice Sunday

vistree

bartezz’s picture

Good question. I don't use Advanced Forum module so I really don't know.
Guess you just have to try if it does. But please post back your findings for others.
Maybe it works as is but you might have to tweak the code I wrote a bit.

Good luck and a good sunday back at ya :)

Cheers,
Bartezz

________________
Live fast die young

bartezz’s picture

JonoB, I received your email but I can't reply as you don't have your contact form enabled :)

Look at: http://drupal.org/project/submitted_by this is the answer to the missing settings you were asking about.

Cheers

________________
Live fast die young

ashcreighton’s picture

I'm very new to drupal, and I'm not expecting to understand how to do a lot of this stuff right out of the gate, but this feature seems pretty basic to me ("submitted by" instead of "by Anonymous" when unregistered users want to post).

I tried your solution, and I've got the CCK fields working in the forum, and the "submitted by" section is showing up when I edit my content type, but my forum still lists topics created "by Anonymous".

I think this is where your snippet comes into play, but I don't understand where I'm supposed to insert this.

(that's what she said.)

In all seriousness, when you reference your "template.php" file, what file are you referring to? Not "page.tpl.php"? (I tried that with pretty bad results.)

I know this is an old post, and again I'm still new at this (I was able to create my own theme from scratch and get it up and running and dynamic, so I'm getting comfortable with some of this stuff), but I'm really stumped on this. Any pointers would be so very appreciated.

-Ashley

khanz’s picture

template.php resides in the theme folder, and every theme dont have it by default. If its not present in your theme folder, simply create a text file and name it template.php.

------------
Volvo, Video, Velcro. (I came, I saw, I stuck around.)

ashcreighton’s picture

@khan_lko Thank you, I created a template.php file for my theme.

However, I still am unable to get my CCK field inputs to show up in place of "Anonymous". I've set up the "Appearance - Submitted by" section(s) with the correct CCK tokens, and yet when I go to test it, and fill out the topic with my name, it still publishes the topic without my name!

Am I missing something? Or is there no way to do this in the forum? I've been researching this everywhere and have yet to figure this out.

Thanks so much.

ashcreighton’s picture

The CCK input IS showing up, but it's only inside the body of the forum topic.

However, it still says "Anonymous" on the left column of the post, and also on the "list of topics" page (though it's been removed using the template.php code by @Bartezz).

If this is helpful, here's a view:

http://www.azroofing.org/forum.png

Is there no way to replace the "Anonymous" with my CCK name input?

michelle’s picture

There is a way, but it requires custom coding. You'd have to hook into the preprocessing code, check if it's anonymous, and replace it if so.

Michelle

ashcreighton’s picture

This helped! My knowledge of php is close to non-existent at this point, but I added something to the template.php (I only revised the code from Bartezz), and this fixed the "Topic List" page to reflect my CCK field_yourname input instead of "Anonymous".

However, I've spent the past few hours researching a way to change the "author-name" (in the author pane) of the actual forum topic with my CCK input (I'd even be happy to delete it altogether), and I guess I'm just in over my head. I might have to accept that this level of functionality is limited to developers/programmers (and I really wish I possessed the knowledge to call myself one.)

If by chance you have any more light to shed, I'd be very, very grateful :)

Thanks for your help.

michelle’s picture

In 2.x, the $node/$comment object gets passed into Author Pane so you have the fields available. Does take programming, though, I'm afraid, and more than I can just write out here quick. :(

Michelle

drikc’s picture

There is a project module named Anonymous Posting that allow to enable anonymous users to post their contact informations for content types of your choice including forum topics.

Find the project http://drupal.org/project/anonymous_posting.

shilk’s picture

I also want the same for my project but i'm unable to do that. please guide me