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

Empty taxonomy block and debuggging with db_fetch_object

Hey, I'm trying to hack arund with taxonomy block to get, for example, better support of nodes with many terms. But I'm running into odd behaviour with db_fetch_object.

to whit:

$nodescount = db_query('SELECT count(DISTINCT(n.nid)) FROM {node} n CROSS JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN (%s) AND n.status = 1', implode($str_tids, ','));
$nodecount = db_fetch_object($nodescount);

returns '3', but

Serious need for a better codefilter

Am I the only one frustrated with the limitations of the existing codefilter module?

On the one hand it has the ability to create beautiful syntax colored php code samples as can be seen in this first example.

Example 1

if ($links) {
	print '<div class="links container">'.$links.'</div>';
}

The problem is that the the nice php syntax coloring is limited to a single set of <?php ?> tags like the above example. Yet so many of the code samples involved with themes and templates jump in and out of php several times. For instance, look here is a typical example of some template code:

Example 2

		<?php if ($links): ?>
				<div class="links"><?php print $links ?></div>
		<?php endif; ?>

For instance, a typical block of html from a node.php.tpl might contain well over 20 sets of inline <?php ?> which forces us to use the <code> </code> tags which don't get to the nice php syntax coloring, on the relevant sections within the <?php ?> tags. Instead, like in the second example above - the whole block is rendered as one monotonous block of code.

But if I leave out the <code> </code> tags in an effort to gain syntax coloring, the same block of code is displayed as several separate, boxed codeblocks. Here is the same exact code used in example 2 above, but without the surrounding <code> </code> tags:

Example 3
if ($links):

endif;

The resulting code sample is not only unrecognizable in format, but it is missing the inline html altogether, so it and therefore useless for the purpose of discussion.

What I really need is a way to provide a block of sample code so that it displays like Example 2, but with the pretty syntax coloring of Example 1 on the relevant strings between the <?php ?> tags.

I realize that the existing codefilter, is really only meant to be a simple filter without a lot of bells and whistles, and I can appreciate that.

It's just that so many of the topics discussed in these forums are already very difficult to talk about as it is -- anything we can do to increase the ease and consistency of producing sample code for discussion is a direct benefit to the whole community.

There are many great existing syntax coloring text functions already in wide use on the web, most of which are capable of jumping in and out of php sections with ease -- a good example is the PEAR :: Package :: Text_Highlighter -- but for some reason I am having trouble integrating any of them into the Drupal input formats.

I have also monkeyed with the existing codefilter module, trying to create a crossbreed of the two filtering types, but I'm getting nowhere.

Does anyone have any ideas or techniques that will help me better achieve better code highlighting?

Organic Groups: anonymous users have full access to view group content

OG, drupal 4.6, is not restricting access to view content for anonymous users. Anonymous users have full access to view group content. I have been trying to see if there was something I have missed in the installation, I don't believe I have. And no posts on the forum as of yet. I am not sure how to fix this but someone else probably does. Is this a feature of organic groups or should I submit a bug report?

Contact directory hack for hierarchy/dept

For my purposes (and those of an agency or organization with a hierarchy) it would be most useful to have a contact directory with "parent/department" contact information.

I'm thinking about hacking the contact directory module to allow for this, but I'm looking for ideas, since I haven't messed with PHP much.

The functionality (just initial ideas of how to achieve my goals):

Custom taxonomy display

I'm trying to develop a recipe module, using taxonomy to categorise each recipe. The following page shows roughly what I want to achieve:

http://brandedthoughts.co.uk/drupal/node/6

The taxonomy is displayed in a custom format down the right, as a summary about the recipe. I'd like this to be the only display of the taxonomy for the node (as opposed to being duplicated below the title). How would I go about doing this?

What's the status on event.module for 4.6?

I notice that the event.module is no longer listed in the downloads section. From bits and pieces I've read on a search, it is apparently being replaced by a flexinode version. But I can't find out any other information. How do I get an event module feature working on a 4.6 site? And if it's going to flexinode, it seems to me the event.module would lose a lot of functionality, like the ability to show an event calendar.

Where can I find out what's going on with the event.module?

Pages

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