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

Session Variables

Trying to figure out a way to do something once per session regardless of whether or not a user has logged in. Have tried setting a variable in the $_SESSION array, but it does not appear to be saved from one page/screen to the next. Any ideas on how to do this? BTW, I'm running Drupal 4.5.0

Thanks!

Radi Shourbaji
http://radi-shourbaji.profconnect.org

Filter function

at end of filter.module function _filter_autop($text) must be updated:


function _filter_autop($text) {
$text = preg_replace('|\n*$|', '', $text) ."\n\n"; // just to make things a little easier, pad the end
$text = preg_replace('|
\s*
|', "\n\n", $text);
$text = preg_replace('!(<(?:table|ul|ol|li|pre|form|blockquote|h[1-6])[^>]*>)!', "\n$1", $text); // Space things out a little
$text = preg_replace('!()!', "$1\n", $text); // Space things out a little
$text = preg_replace("/\n\n+/", "\n\n", $text); // take care of duplicates
$text = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

$1

\n", $text); // make paragraphs, including one at the end
$text = preg_replace('|

\s*?

|', '', $text); // under certain strange conditions it could create a P of entirely whitespace
$text = preg_replace("|

(

  • |", "$1", $text); // problem with nested lists
    $text = preg_replace('|

    ]*)>|i', "

    ", $text);
    $text = str_replace('

    ', '

    ', $text);
    $text = preg_replace('!

    \s*(]*>)!', "$1", $text);
    $text = preg_replace('!(]*>)\s*

    !', "$1", $text);
    $text = preg_replace('|(?)\s*\n|', "

  • Filter function

    at end of filter.module function _filter_autop($text) must be updated:

    function _filter_autop($text) {
      $text = preg_replace('|\n*$|', '', $text) ."\n\n"; // just to make things a little easier, pad the end
      $text = preg_replace('|
    \s*
    |', "\n\n", $text); $text = preg_replace('!(<(?:table|ul|ol|li|pre|form|blockquote|h[1-6])[^>]*>)!', "\n$1", $text); // Space things out a little $text = preg_replace('!()!', "$1\n", $text); // Space things out a little $text = preg_replace("/\n\n+/", "\n\n", $text); // take care of duplicates $text = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

    $1

    \n", $text); // make paragraphs, including one at the end $text = preg_replace('|

    \s*?

    |', '', $text); // under certain strange conditions it could create a P of entirely whitespace $text = preg_replace("|

    (

  • |", "$1", $text); // problem with nested lists $text = preg_replace('|

    ]*)>|i', "

    ", $text); $text = str_replace('

    ', '
    ', $text); $text = preg_replace('!

    \s*(]*>)!', "$1", $text); $text = preg_replace('!(]*>)\s*

    !', "$1", $text); $text = preg_replace('|(?)\s*\n|', "
  • Automatic login?

    Hi all! Was wondering if anyone has worked out a way to provide an "automatic login" based on ip address, user-agent, etc. What I'm trying to do is provide a way for search engines to "login" to the site automatically so they can spider the "members" version of content.

    Thanks!

    Radi

    boldface sticky topics?

    I'm trying to figure out if there's anyway to hack a module (presumably the forum module) to make the titles of sticky posts bold. I found this function... but I'm not sure if there's a way to modify it so the "topics" class becomes "topics-sticky" if a post is sticky. That would enable a different style for sticky posts.

    You must select an image for upload

    I am having a very challenging time getting the image.module to upload images. Each time I attempt to preview or submit an image I receive this error message: You must select an image for upload.

    I have not been able to find a resolution to this anywhere. I have tried using both GD2 and Imagemagick and it has worked in the past on this server. I'm hoping somebody might have an idea why this is happening.

    Pages

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