Just a bunch of feature ideas, for you to think about and possibly add some to your wiki. Some I may be able to help with.

-> Last Post should have a link before you enter the forums
-> Statistics at bottom of all the forums
-> Stickies should be separated from normal topics, or at least highlighted differently.
-> AJAX submit should be fixed so that we can have quicker replying features.
-> Announcement feature for the whole forum and site to see.
-> Highlighting of Forum Topic Titles should display AJAXily teasers of the actual topic!
-> Quote button should be improved by being able to quote multiple people on a page, (Quote module related)
-> Perhaps a Report button to report bad things.
-> Warning system for rule breakers?
-> Forum Rule system?
-> Quick Edit system, because the current AJAX edit, isn't working well at the moment
-> Ability to limit visibility of a forum to a certain role(s) so that we can have private forums.
-> Automatically see IP of people that make posts as an admin
-> A special trash forum, logging who moved what there, so that evil moderators don't delete certain posts and disappear?
-> A drop down menu outside of edit that admin/mod can see so that they can quickly sticky, unsticky, promote front page, move, topics etc.

CommentFileSizeAuthor
#2 advforum_update.zip12.93 KBexecutex
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VM’s picture

Priority: Critical » Normal

feature requests aren't considered critical.

executex’s picture

FileSize
12.93 KB

This is a patch that adds the following two features:

1) Enhances forum.module in order to add "In: topicTitleLink" to all Last Post rows when viewing the forum-list.
2) Enhances forum-list.tpl.php in order to add the forum-new.png and forum-default.png to be displayed when there is or when there is not new topics next to the FORUM name on the forum-list.

Installation:
Overwrite all the files in advforum theme folder from the zip in the attachment, except forum.module.
Overwrite the forum.module in your modules/forum directory with the forum.module in this zip.

If maintainer decides that this is an ideal way to modify the forums, then I guess maintainer can add it on to the newest stable version of advforum, although altering forum.module may not be the best plan. Perhaps move the _forum_filter function from forum.module into advforum, the only limitation is that we need $nid and $title variables from the SQL query, which isn't added into $topic->last_post which is then passed to advancedforum, so the modification on forum.module is quite necessary.

To see my changes, simply search "eXecute addition" in the documents provided.

Michelle’s picture

I'm working on advanced profile right now so can't look at this in depth. I won't put in anything that requires hacking the core forum module but I'll have a look at the rest. Probably tomorrow. I need to get a bit farther on advprofile then put out a camera club newsletter then work on a client site. And take care of my kids in there somewhere. :)

Michelle

LasseP’s picture

To get the title of the posting you can use this function:

<?php
function last_post_title_get_title($uid, $tid = NULL) {
	$query = "SELECT
   N.title AS nodeTitle,
   RES.title AS resTitle,
   RES.created,
   RES.type AS resType,
   N.type AS nodeType,
   N.nid AS nid,
   T.tid,
   RES.cid AS cid
   FROM node AS N INNER JOIN
   (SELECT title, created, nid, uid, type, 'cid' AS cid FROM node
   UNION SELECT subject, timestamp, nid, uid, 'comment', cid
   FROM comments ORDER BY created DESC)
   AS RES ON N.nid=RES.nid
   INNER JOIN term_node AS T ON N.nid = T.nid
   WHERE RES.uid = %d";

	if($tid != NULL) {
		$query .= " AND T.tid = %d";
	}

	$query .= " LIMIT 0,1";
	$result = db_query( $query, $uid, $tid);
	return db_fetch_object($result);

}

?>

To display it, open up the forum-list.tpl.php
Add the following lines bevor the row[] statement

<?php
        // LAST POST
        $fLastPost = $forum->last_post;
        $lastPostTitle = last_post_title_get_title($fLastPost->uid, $forum->tid);
        if ($fLastPost && $fLastPost->timestamp) {
        	$lpURL = $lastPostTitle->nid;
        	if($lastPostTitle->resType == "comment") {
        	 $lpURL .= '#comment-'. $lastPostTitle->cid;
        	}
          $last_post =  t('<a href="node/'. $lpURL .'">@title</a><br />@time ago<br />by !author', array('@title' => $lastPostTitle->nodeTitle, '@time' => format_interval(time() - $fLastPost->timestamp), '!author' => theme('username', $fLastPost)));
        } else {
          $last_post =  t('n/a');
        }
?>

and exchange the following line:
array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'));

with this:
array('data' => $last_post, 'class' => 'last-reply'));
I'm using it in a custom module. It is not fully tested for bugs or performance, but it is at least a way without hacking the core modules.
If someone has any perfomance improvements on the sql statement, i'd be glad if you leave a notice ;)

Michelle’s picture

Sorry it's taking me so long on this. I was away Friday-Sunday and then today I got caught up in some advprofile stuff and I have a client site to work on tonight. I've got big plans for advforum, though, so stuff is coming. :)

Michelle

executex’s picture

I'm hacking the forum.module because 5.5 is the last before 6.x... Plus, it takes less memory and more efficient to hack the core, than to make some hack to avoid hacking the core, that's worse. My changes were like 2-3 lines, while yours is at least 30-50. I think it's fine to hack core as long as you are careful with security problems etc.

VM’s picture

actually 5.6 was just released and 5.7 is in -dev, which should show that 5.5 is not the last release before Drupal 6 is gold. Based on the see saw of pending issues against Drupal 6, it could still be awhile before 6 is released in full. considering that the pattern has been an RC has to be released with out creating more critical issues.

Hacking core is never the best way to go about doing anything especially when developing a module. If there is something that core needs and you can convince core developers of it's importantance, you supply a patch to core and work on the changes getting into core. This is how you create change. While hacking core may save you lines of code, it creates an abundance of support requests when the next update is released and modules get broken because the changes have been overwritten.

Michelle’s picture

I agree with VeryMisunderstood. You're welcome to do whatever you like on your own site, of course, but I won't be hacking core in this module.

Michelle

jmai’s picture

@LasseP: great implementation. It works for me.

@Michelle: Keep up the great work. I'm looking forward to more features coming soon :)

I have to agree with VeryMisUnderstood and Michelle against hacking core. Everytime a new version comes out, i'd have to hack it again. It becomes cumbersome and many times I feel unsure if other things will break. I noticed this community are well versed in software designs. They build things from bottom-up design rather than top-down especially for this modular software unlike some competitors. I have to say thanks to all those who made it a very stable software and easy to build upon.

LasseP’s picture

@executex

Most of the lines are for a clean code. You can, of course, put the sql statement in one line. And you could possibly remove the if clause for the tid, if you want to.
You can even just override the _forum_format function completely and save a few more lines, and you can strip down the resultset of the sql statement, so that you can save a few more lines of code.

I can understand why you say it is easier to hack the core. But if you want to have a stable environment, which is up to date, you need an environment which can easily be updated. Imagine you want to update from 5.5 to 5.6. You would have to merge your core hacks into the foum module. And if it had changed, you might need to rewite it.

As Michelle said, this is good if you're just doing it for your own site. Because that does only belong to you. But if you're in a multisite environment, or have site for a company or something like that, it need to be upgradeable, without any core hacks. And that's why i posted this function. It's allways better to change a module then changing the core.

I do not want to say that your work was worthless. But there are better ways. And if i would create a simple site for myself, without wanting to go to much in detail about module development, i would possibly prefer your work.

executex’s picture

I think the problem is resultant from the fact that they haven't made any forum _hooks. I'll hack forum module anyway, just for simplicity, because your code is good, but requires extra queries, which wouldn't be the greatest plan for high traffic sites like mine that use drupal. Good job tho, I did think of doing this, but didn't want the extra query.

Michelle’s picture

Status: Active » Fixed

LasseP's code committed. The rest of this is either covered in other issues or the to do list or is out of scope.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.