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

automagically generate content from file directory

Hi:

I am new to drupal development here, but I have a contract to develop a cms for a medium-sized corporate intranet. Part of their motivation is providing a central repository for their internal forms and templates (pdfs and excel files, mostly), which will keep track of revisions and whatnot.

They like the idea of being able to simply upload the file into a directory and have the system take care of it from there. That is, no need for manual node creation, while retaining the ability to add information/descriptions to the nodes.

tagging and pinging (social bookmarking)

hi!
Thank you all for great drupal and plugins! I'm very new in content management and have installed drupal on my site only recently. I have a few Q...

1) first, I'd like to make sure what you call taxonomy is what others (like social bookmark sites, like del.icio.us) call "tags"? it looks to me the same, does it also function the same?

2) how can I add more sites to the automated pinging list drupal uses whenever there's new content?
and is there a way to ping the tags?

3) i've purchased a tag&ping tutorial which came with 2 plugins - but to wordpress. i'd like to stick to drupal. does anyone know an alternative or a drupal solution that's similar?

  1. here's the first WP plugin:

    Plugin Name: WP-Sociable
    Plugin URI: http://www.maxpower.ca/sociable/2006/01/26/
    Version: 0.35 Beta
    Description: A simple plugin which lists a range of social bookmarking sites allowing visitors to quickly socially bookmark the post/page they are currently viewing. Usage instructions are available at maxpower.ca. Based on the work of Paul Stamatiou (visit his blog -- its good).
    Author: Kirk Montgomery

    example:

    // Check to see if user wants to fark [heh]<br>
    if(strstr($wpsoc_sites_wanted,"fark")) { <br>
    // Fark This <br>
    echo "&nbsp;&nbsp;&nbsp;&nbsp;";<br>
    echo "<a href=\"http://cgi.fark.com/cgi/fark/edit.pl?new_url=";<br>
    echo $wpsoc_the_perm."&amp;new_comment=";<br>
    echo $wpsoc_the_title_urlencode;<br>
    echo "&amp;new_link_other=";<br>
    echo $wpsoc_the_blogname;<br>
    echo "&amp;linktype=".$wpsoc_the_fark_cat;<br>
    echo "\" title=\"".$wpsoc_the_title_plain."\" rel=\"nofollow\" target=\"_blank\" />";<br>
    echo "<img src=\"";<br>
    echo $wpsoc_the_imgurl."fark.png\" class=\"socialbkmark\" ";<br>
    echo "alt=\"Fark ";<br>
    echo $wpsoc_the_title_plain." at Fark.com\"/></a>";<br>
    //Fark'd it good<br>
    }<br>

    this thing works with del.icio.us, Spurl, wists, simpy, newsvine, blinklists, furl, reddit, fark, blogmarks.

  2. the second plugin:
    Plugin Name: My Tags
    Plugin URI: http://www.raoul.shacknet.nu/
    Description: Constructs URLS for your categories, which have the tag relation set and appends a tags section to your post's body in single post view and to the feed item's content.
    Version: 0.5

    Info:
    This plugin automatically creates "tag directory" tags from WPO categories, then sticks these specially formatted tags into each of your blog posts and the WP RSS feed.


    php code:

    function mt_add_my_tags($PostBody) {
    global $feed, $my_tags_url, $my_tags_style;

    if ( is_single() || ( is_feed() && !empty($feed)) ) {

    $MyCatTagStr = "

    Tags: ";
    foreach((get_the_category()) as $cat) {
    if ( empty($my_tags_url) ) {
    $MyCatTagStr .= "\ncat_ID), 0, -1) . "\" rel=\"tag directory\">" . $cat->cat_name . ", ";
    } else {
    $MyCatTagStr .= "\ncat_name . "\" rel=\"tag directory\">" . $cat->cat_name . ", ";
    }
    }
    $MyCatTagStr = substr($MyCatTagStr, 0, -2) . "\n

view module add more nodes ie. NODE: published, NODE: Front Page

Want to have 3 sections on the frontpage.

So I have added 3 new ones called frontpage_top, frontpage_left and frontpage_right.

Have them working and choosable when adding content in the same way as promoted to frontpage.
called promoted to left frontpage, right.. etc.

Have installed VIEWS-module but cant figure out where to add the 3 new NODES so they can be chosen under filter so 3 types could be made.

filter: node: published equals yes
node: frontpage left yes

Custom Node Validation - how to autocorrect user input?

In creating a custom node module, it is great that you can create a _validate function to check user input.

However, what would be *really* neat would be the ability to auto-correct (or auto format) some common user mistakes, rather than just giving them an error message.

For example, some of my modules requires the user to submit a URL. For consistency, I want these to always be in the format "www.domain.com/page.htm" and *not* include the leading "http://". Despite giving this field a description that says the "http://" should not be included, users will often just cut+paste a URL from their browser, thus including the "http://" bit that I don't want.

Sure, I can write a _validate function to check if the URL starts "http://" and return an error, but it would be much nicer to just "auto-correct" this simple mistake.

Until now I have done this by creating a custom function, and modified my hook_insert and hook_update functions to call it, something like this (very cut down for simplicity):


function mylib_strip_url($url) {
// strip leading "http://", if present
if (substr($url,0,7) == 'http://') {
$stripped_url = substr($url,7);
} else {
$stripped_url = $url;
}
return $stripped_url;
}

function mynode_insert($node) {
db_query("INSERT INTO {mytable} (nid, website) VALUES (%d, '%s')", $node->nid, mylib_strip_url($node->website));

put taxonomy_dhtml menu into a block

Can anyone help me on this. I wish to have the exact menu that is displayed when i visit my domain.com/taxonomy_dhtml page. I need this menu in a block. I have tried the block that comes with taxonomy_dhtml, but this doesn't act in the same way. I have also tried all the php snippets available for blog categories and alos taxonomy_menu.

How can i do this?

Custom Book Block Module

Hi, I just hacked a module that lets the admin define blocks that list any number of books along with a customizable number of subpages for each. Based on NICE_MENUS module, it relies on the JSTOOLS module and its child, ACTIVEMENU to do some AJAX. It is not perfect and I used 4 spaces instead of 2 for indentations... old habit. I thought some people might appreciate it... in the future I want to define permissions a little bit better. So here it is:

Pages

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