Topic: Can the admin get an email every time someone posts?

I'd like to receive an email every time that a user posts. Is there a setting that does that?

Right now I have to manually check the forum every day and see if I need to answer any posts.  thanks!

2

Re: Can the admin get an email every time someone posts?

chillnc,

Why don't you use RSS?

Re: Can the admin get an email every time someone posts?

I don't know if that would help me out or not -- I've never used RSS for anything. Doesn't that still require me to launch my browser or RSS reader? I would rather not have to remember to check on the forum, which I why I was looking for an email notification. Does that make sense? thanks-

4

Re: Can the admin get an email every time someone posts?

Use Thunderbird, no need to launch your browser.

Re: Can the admin get an email every time someone posts?

Ok, while I do appreciate the suggestion to set up RSS feeds and switch my email client to Thunderbird, it's not really the addressing the original question. Should I assume that it is not possible to get emailed when someone posts? thanks-

Re: Can the admin get an email every time someone posts?

Maybe there's a, um...., RSS Mod, or just look through the mods.

If you find one please post it here!

Thanks

7

Re: Can the admin get an email every time someone posts?

Here you go, copy this and call it rss.php and place it in the root of your forum:

<?php
/**
  * BLOG:CMS: PHP/MySQL Personal Content Management System 
  * http://blogcms.com/
  * http://forum.blogcms.com/
  *
  * 2003-2004, (c) Radek HULAN 
  * http://hulan.cz/
  *
  * Mod by Bert Garcia for PunBB 1.2.1
  * http://nupusi.com
  *
  * Additional changes Copyright 2005 by Alex King
  * Now creates feeds for categories, forums, topics
  * http://www.alexking.org/software/
  *
  * Modified by Daniel Jalkut to eliminate redundant Topic and 
  * Message prefixes is the description output, and to include
  * content in a content:encoded namespace for better formatting
  * preservation. http://www.red-sweater.com/.
  * 
  * Please see the enclosed readme.txt file for usage
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.

// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// *****************************************************************

**/


define('PUN_ROOT', './');
@include PUN_ROOT.'config.php';

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
    exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');

// Disable error reporting for uninitialized variables
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);


// Load the functions script
require PUN_ROOT.'include/functions.php';
require PUN_ROOT.'include/parser.php';

// Load DB abstraction layer and try to connect
require PUN_ROOT.'include/dblayer/common_db.php';

// Get the forum config
$result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
while ($cur_config_item = $db->fetch_row($result))
    $pun_config[$cur_config_item[0]] = $cur_config_item[1];

// Make sure we (guests) have permission to read the forums
$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
if ($db->result($result) == '0')
    exit('No permission');


// Attempt to load the common language file
@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
if (!isset($lang_common)) exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.');

// parse RSS
ob_start();

// make feed
/* original query
$result = $db->query(
    "select p.id as id, p.message as message, p.posted as postposted, t.subject as subject ".
    "from ".$db->prefix."posts as p, ".$db->prefix."topics as t ".
    "where p.topic_id=t.id ".
    "order by postposted desc ".
    "limit 0,15") 
    or error('Unable to fetch forum posts', __FILE__, __LINE__, $db->error());;
*/

if (!empty($_GET["cid"])) {
    $where = "    AND c.id = '".intval($_GET['cid'])."'";
    $title = 'cid';
}
else if (!empty($_GET["fid"])) {
    $where = "    AND f.id = '".intval($_GET['fid'])."'";
    $title = 'fid';
}
else if (!empty($_GET["tid"])) {
    $where = "    AND t.id = '".intval($_GET['tid'])."'";
    $title = 'tid';
}
else {
    $where = '';
    $title = '';
}
$result = $db->query("
    SELECT p.id AS id, p.message AS message, p.posted AS postposted, t.subject AS subject, f.forum_name, c.cat_name 
    FROM ".$db->prefix."posts p
    LEFT JOIN ".$db->prefix."topics t 
    ON p.topic_id=t.id 
    INNER JOIN ".$db->prefix."forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN ".$db->prefix."categories AS c 
    ON f.cat_id = c.id
    LEFT JOIN ".$db->prefix."forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id=3
    )
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) 
    $where 
    ORDER BY postposted DESC 
    LIMIT 0,15
") or error('Unable to fetch forum posts', __FILE__, __LINE__, $db->error());;
$i = 0;
while ($cur = $db->fetch_assoc($result)) {
    if ($i == 0) {
        putHeader($cur, $title);
        $i++;
    }
    putPost($cur);
}
putEnd();

// get feed into $feed
$feed = ob_get_contents();
ob_end_clean();

// create ETAG (hash of feed)
$eTag = '"'.md5($feed).'"';
header('Etag: '.$eTag);

// compare Etag to what we got
if ($eTag == $_SERVER['HTTP_IF_NONE_MATCH']) {    
    header("HTTP/1.0 304 Not Modified");
    header('Content-Length: 0');
} else {
    // dump feed
    header ("Content-type: text/xml");
    echo $feed;
}

/* entity to unicode decimal value */
function entity_to_decimal_value($string){
    static $entities_dec = false;
    if (!is_array($entities_dec)) {
        $entities_named       = array(" ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","ƒ","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","•","…","?","?","?","?","?","?","?","™","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?",""","&","<",">","Œ","œ","Š","š","Ÿ","ˆ","˜","?","?","?","?","?","?","?","–","—","‘","’","‚","“","”","„","†","‡","‰","‹","›","€","&apos;");
        $entities_decimal     = array(" ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?",""","&","<",">","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","'");
        if (function_exists('array_combine')) 
            $entities_dec=array_combine($entities_named,$entities_decimal);
        else {
            $i=0;
            foreach ($entities_named as $_entities_named) $entities_dec[$_entities_named]=$entities_decimal[$i++];
        }
    }
    return preg_replace( "/&[A-Za-z]+;/", " ", strtr($string,$entities_dec) );
}

function encode_xml($data){
    // line breaks
    $data=str_replace('<br(.*?)>',"\n\n",$data);
    // ending html tags into line breaks
    $data=preg_replace("/<\/(pre|ul|li|p|table|tr)>/","\n\n",$data);
    // remove other html tags
    $data=preg_replace("/<(.*?)>/","",$data);
    // remove multiple newlines
    //$data=preg_replace("/\n\n+/","\n\n",$data);
    return entity_to_decimal_value($data);
}

function putHeader($cur, $title) { 
    switch ($title) {
        case "cid":
            $title = ' : '.$cur['cat_name'];
            break;
        case "fid":
            $title = ' : '.$cur['cat_name'].' : '.$cur['forum_name'];
            break;
        case "tid":
            $title = ' : '.$cur['cat_name'].' : '.$cur['forum_name'].' : '.$cur['subject'];
            break;
        default:
            $title = '';
            break;
    }
    global $lang_common,$pun_config;
    echo '<'.'?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?'.'>'."\n";
    echo "<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n";
    echo "<channel>\n";
    echo "<title>".entity_to_decimal_value(htmlspecialchars($pun_config['o_board_title'].$title))."</title>\n";
    echo "<link>".$pun_config['o_base_url']."</link>\n";
    echo "<description>".entity_to_decimal_value(htmlspecialchars($rss_description.' '.$pun_config['o_board_title']))."</description>\n";
    echo "<language>en</language>\n";
    echo "<docs>http://backend.userland.com/rss</docs>\n";
} 

function putPost($cur) {
    global $pun_config;
    echo "<item>\n";
    echo "<title>".entity_to_decimal_value(htmlspecialchars($cur['subject'].' in '.$cur['cat_name'].' : '.$cur['forum_name']))."</title>\n";
    $link = $pun_config['o_base_url'].'/viewtopic.php?pid='.strval($cur['id']).'#'.strval($cur['id']);
    echo "<link>".entity_to_decimal_value(htmlspecialchars($link))."</link>\n";
    echo '<guid isPermaLink="false">'.strval($cur['id']).'@'.$pun_config['o_base_url'].'</guid>'."\n";
    $data = parse_message($cur['message'],0);
    echo "<description>".encode_xml($data)."</description>\n";
        echo "<content:encoded><![CDATA[".$data."]]></content:encoded>\n";
    echo "<pubDate>".strval(date("r",$cur['postposted']))."</pubDate>\n";
    echo "</item>\n";
}


function putEnd() {
    echo "</channel>\n";
    echo "</rss>\n";
} 

?>

Re: Can the admin get an email every time someone posts?

I put that in notepad, saved it as rss.php, save it in ANSI format (which said it might lose some characters), then I uploaded it, now what?

Re: Can the admin get an email every time someone posts?

Emil775 wrote:

I put that in notepad, saved it as rss.php, save it in ANSI format (which said it might lose some characters), then I uploaded it, now what?

A service such as RSSFWD can email you items from the RSS feed.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Can the admin get an email every time someone posts?

KK Thanks

11

Re: Can the admin get an email every time someone posts?

Sorry, forgot the readme.txt:

RSS mod for PunBB 1.2.x.

This enclosed rss.php file creates RSS feeds for PunBB 1.2.x categoires, forums, topics and recent posts.

=======================================================================

To create a RSS feed for a category, pass in the ID of the category:

    http://www.example.com/punbb/rss.php?cid=2

To create a RSS feed for a forum, pass in the ID of the forum:

    http://www.example.com/punbb/rss.php?fid=16

To create a RSS feed for a topic, pass in the ID of the topic:

    http://www.example.com/punbb/rss.php?tid=1254

To create a RSS feed for the last 15 posts, just access the rss.php page:

    http://www.example.com/punbb/rss.php


=======================================================================

To create links to these RSS feeds (as seen here: http://www.alexking.org/forums/), add the following code to the following files (using the PunBB 1.2.2 code):

RSS Feeds for Categories, edit index.php.

Find this code:

    <h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>

And change it to:

    <h2>
        <span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span>
        <a href="rss.php?cid=<?php echo $cur_forum['cid'] ?>">RSS Feed</a>
    </h2>


RSS Feeds for Forums, edit index.php and viewforum.php.

In index.php, find this code:

    <div class="tclcon">
        <?php echo $forum_field."\n".$moderators ?>
    </div>

And change it to:

    <div class="tclcon">
        <?php echo $forum_field."\n".$moderators ?>
        <a href="rss.php?fid=<?php echo $cur_forum['fid'] ?>">RSS Feed</a>
    </div>

In viewforum.php, find this code:

    <h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>

And change it to:

    <h2>
         <span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span>
         <a href="rss.php?fid=<?php echo $id ?>">RSS Feed</a>
    </h2>


RSS Feeds for Topics, edit index.php and viewforum.php.

In viewtopic.php, find this code:

    <div class="linkst">
        <div class="inbox">
            <p class="pagelink conl"><?php echo $paging_links ?></p>
            <p class="postlink conr"><?php echo $post_link ?></p>
            <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
            <div class="clearer"></div>
        </div>
    </div>

And this code:

    <div class="postlinksb">
        <div class="inbox">
            <p class="postlink conr"><?php echo $post_link ?></p>
            <p class="pagelink conl"><?php echo $paging_links ?></p>
            <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
            <?php echo $subscraction ?>
        </div>
    </div>

And change it to:

    <div class="linkst">
        <div class="inbox">
            <p class="pagelink conl"><?php echo $paging_links ?></p>
            <p class="postlink conr"><?php echo $post_link ?></p>
            <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?> (<a href="rss.php?tid=<?php echo $id ?>">RSS Feed</a>)</li></ul>
            <div class="clearer"></div>
        </div>
    </div>

And:

    <div class="postlinksb">
        <div class="inbox">
            <p class="postlink conr"><?php echo $post_link ?></p>
            <p class="pagelink conl"><?php echo $paging_links ?></p>
            <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?> (<a href="rss.php?tid=<?php echo $id ?>">RSS Feed</a>)</li></ul>
            <?php echo $subscraction ?>
        </div>
    </div>



=======================================================================

Notes:

- The RSS feeds exclude posts that are not publicly viewable.
- The RSS feeds include the "Category Name : Forum Name : Topic Name" as in the item title as appropriate.
- Please post any support questions on the PunBB forums:

http://punbb.org/forums/viewtopic.php?id=6586

12

Re: Can the admin get an email every time someone posts?

chillnc wrote:

I'd like to receive an email every time that a user posts. Is there a setting that does that?

Right now I have to manually check the forum every day and see if I need to answer any posts.  thanks!

I wrote a mod a while ago exactly for this:
http://www.punres.org/files.php?pid=95

The German PunBB Site:
PunBB-forum.de

Re: Can the admin get an email every time someone posts?

omg. I LOVE YOU! lol...hehe

Re: Can the admin get an email every time someone posts?

thanks for the help!

Re: Can the admin get an email every time someone posts?

It's probably good, but, it doesn't work on my version! (the latest one...)

That SUCKS

Re: Can the admin get an email every time someone posts?

What error do you get?

Re: Can the admin get an email every time someone posts?

"This Mod is not conpatible w/your punBB version"

18 (edited by Smartys 2006-02-14 02:07)

Re: Can the admin get an email every time someone posts?

Open install_mod.php, edit the array with the different versions to have 1.2.10 in it

Re: Can the admin get an email every time someone posts?

I dunno how to edit, but, it's ok.
I do, however, have another question.

I made something that I will let people to download, but,this is what I wanna do:
Put a link to download it off the forums, but, they must FIRST register in the forum, and then and ONLY then will they be able to have a link to download it.

Also, if there is a way to put a few words under that show how many times the file has been downloaded.Thanks!

Re: Can the admin get an email every time someone posts?

Check out the Download Mod?

Re: Can the admin get an email every time someone posts?

Download Mod?

Ok...thanks!

Re: Can the admin get an email every time someone posts?

I looked at this file and it seems that there is an option to mail everyone on a list of any new posts to the forums. Is there any way to create lists on a "group" basis. In other words, have all members of a group receive updates for ONLY the forums they are allowed to see.