No known problems
How to "Claim a Namespace" for a module, theme, or other project
If you choose to contribute to Drupal.org you may find yourself in a situation where you create a project page before the code is actually ready. This is a great idea so that you can broadcast the fact that you are about to build a module with a specific purpose so that others interested in the topic can collaborate with you.
However, if you do so you should be certain to note several things on the project page.
- Clearly state that it is placeholder page and that you plan to release the full project in the future.
- Explain the purpose of the project - even if you don't have code you can explain what you intend to ultimately do.
- Give an estimated timeline for completion.
Setting up LeagueSite Seasons and Leagues
Installing LeagueSite is the same as every other Drupal module. Unzip the files and drop them into your sites module folder. You can then enable the module at admin/build/modules. The instructions below refer to the core LeagueSite module which arranges league tables in seasons.
Once your module is enabled, you can access the main pages for setup at admin/content/leaguesite
Your first port of call should be the 'Config' tab (admin/content/leaguesite/config) which will allow you to define scoring methods for your leagues. The default scoring type added is Rugby. To add your own, click 'add a new score type' or go to admin/content/leaguesite/scores/add and define your Sport with points values here.
Once you have created your scoring type, you can head to admin/content/leaguesite to set up your sports season! Simply click 'add a new season' or go to admin.content/leaguesite/add and enter the name of your season and the time the season spans between. For example, I might add 09/10 as the name for my 2009 to 2010 season in rugby. If you intend to have multiple seasons, you might want to add more information, such as Rugby 09/10 or Summer 09/10. You get the idea.
Once your season is set up, you can then create your league by navigating to admin/content/leaguesite/leagues and clicking 'Add a new league' or going to admin/content/leaguesite/leagues/add
Footnotes
Although the Biblio module can create reference lists on its own, it can also work in conjunction with the Footnotes module which will allow you to intermingle Footnotes [fn] and Biblio [bib] tags in the same document and have them sequentially numbered.
There is a little configuration required to get it to work, but the following steps should be all that is required...
- On the admin/settings/biblio page in the "Footnotes" section, enable "Integration with the footnotes module"
- You need to edit each of your input formats (admin/settings/filters) and click the configure link and enable both "Footnotes [fn]...[/fn]" and "Biblio module references or [bib]" option for each of the input formats that you use.
- Make sure that the above mentioned "Biblio module references or [bib]" option is listed ABOVE the "Footnotes [fn]...[/fn]" option, and if it isn't, click the "Rearrange" button at the top of the page to rearrange them so that Biblio is above Footnotes.
- Create/edit your page or article in which you want to include a biblio footnote, and add the footnote to the text like this... "This is a test of [bib]16389[/bib] and [bib]16390[/bib]" where the text between the [bib] tags represents a "citekey" from a biblio entry which has already been created.
HowTo: Remove recipients of a Privatemsg
This page explains how to remove all the recipients of the Privatemsg thread so that only the sender is visible in the participants.
I wanted to be able to send messages to multiple people without all those people knowing who else I sent the message to (exactly how BCC works in email).
Berdir the modules maintainer kindly sent along this code:
<?php
function yourmodule_privatemsg_sql_participants_alter(&$fragments, $thread_id) {
global $user;
// Join table that contains author information.
$fragments['inner_join'][] = 'INNER JOIN {pm_message} pm ON (pm.mid = pmi.mid)';
// Only include the author of the first message of that thread and
// the current user (needed for permission checks).
$fragments['where'][] = '(pmi.uid = pm.author AND pmi.mid = pmi.thread_id) OR pmi.uid = %d';
$fragments['query_args']['where'][] = $user->uid;
}
?>Which accomplished this perfectly. Thanks Berdir and thanks for this awesome module!
Managing a CCK allowed values list without granting "administer content types" access
Problem
If you want to give a user the ability to update the values in a CCK text field select list, the only "built-in" way to do it is to give that user the very powerful and potentially dangerous "administer content types" permission.
Solution
An alternative, detailed here, is for the site developer to place PHP code into the "PHP Code" fieldset below the allowed values box on the textfield set up page in order to populate the list by parsing the text stored in a node.
At that point, the ability to edit the select list is controlled via node access. Users with access to a node with select-list options, referenced by the PHP code, will thus be able to control both the ordering and content of the select list without having "administer content-type" privileges.
For this example, assume that you have a content type of "resource" and a text field with a select widget called "author", such that a user creating new articles can pick from a select list of authors.
First, create a new node called "Author List", and list the authors you want in the select list in the body, with simple carriage returns between them. For example:
Jane Doe
John P. Smith
Jim Jones(Note the node id of this node, you'll be referring to it in a minute.)
Show result list of a view with exposed filters only when filters set
There is a (Views2) view listing any type of elements and with at least one exposed filter. The task is to show the empty text instead of the list if the filter is not set. One part of the solution can be found at forum, but is not perfect. It works fine while every part of the exposed filters are textfields - but there are views with optional filters shown as dropdowns/selects with the first, "empty" element being <All>. This value is being sent to PHP as All, so the array checked in the above code will not be empty, so the list will appear when one of the exposed filters was shown as dropdown/select, and was optional. Here is a solution which works fine even in such cases.
