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

Code Snippets module

Snippets offer functionality similar to standard PHP-execution filter, but I hope in more flexible manner. Site admin or power users may create named snippets of PHP-code (with access to Drupal API), then categorize and store them to the site code repository. Particular users can't view PHP-code - only snippet name and help. From user point of view - snippets are macros, which may be used in postings - nodes and comments. Macros may accept parameters which transferred to snippet code. Example: [macro], [macro|param1|param2], [link|9165].

Where are Permissions by role defined in the Database?

Where are Permissions by role defined in the Database?

I have created a Module that uses the _perm hook but I am curious where it is actually stored within the system? I have looked throught the database and cannot find it under any of the tables.

I thought it would be under the variables table but did not see it in there.

Very curious because I wanted to clean up some old hooks I made. Mostly because I want to know where Drupal keeps this list.

Thanks!

Form validation for user profiles?

I've added a bunch of new user profiles under: administer -> users -> configure -> profiles

If I want to do some simple data validation on these new fields, what is the most logical place to put my PHP code?

thanks!

Adding to onload

I wrote this small module to add my onload stuff:

function mytheme_onload() {
  return array("MM_preloadImages('myimages.png', 'myimages2.png')");
} 

I get the following error with image/view:

Flexinode Images - resizing on upload.

Hi all.

Is it possible to have flexinode resize the images on upload?

So if a user uploads an image that is 1024x768 and 1.5mb , flexinode resizes it to become only 640x480 and 500kb?

thanks

Mr Maggoo

image filter

I've modified urlfilter to create imagefilter. This will convert the address of any image (url of a file ending with jpg,jpeg,png,gif) into an inline img tag. This img will be surrounded by a div class "image" which you can modify in your css.

so effectively with this filter, all you have to insert an image into a node or comment, is to just paste the address of a picture, something like wiki if i'm not mistaken.

file:
imagefilter.module



function imagefilter_help($section) {
  switch ($section) {
    case 'admin/modules#description':
      return t("Automatically turns '.gif', '.jpg', '.jpeg' and '.png' addresses into inline images.");
  }
}


hope somebody finds this useful
function imagefilter_filter_tips($delta, $format, $long = false) {
  return t("'.gif', '.jpg', '.jpeg' and '.png' addresses automatically turn into inline images.");
}

function imagefilter_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(0 => t("Image filter"));

    case 'description':
      return t("Automatically turns '.gif', '.jpg', '.jpeg' and '.png' addresses into inline images.");

    case 'process':
      $text = ' ' . $text . ' ';


      $HTMLbefore="<div class=image><img src='";
      $HTMLafter="'></div>";

      $text = preg_replace(
        '!(<p>|[ \n\r\t\(])([a-zA-Z0-9@:%_~#?&=.,/;-]*)\.(jpg|jpeg|gif|png)(</p>|[ \n\r\t\)])!i' ,
        " ".$HTMLbefore."$2.$3".$HTMLafter." " ,
        $text
      );

      $text = substr($text, 1, -1);

      return $text;

    default:
      return $text;
  }
}


Pages

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