[RC1] Prime Notify Topic - Add Msg to Notification Email

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Suggested Hosts
Locked
User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

[RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Tue Aug 07, 2007 8:50 pm

MOD Title: Prime Notify Topic
MOD Description: This MOD will insert into the topic notification e-mail the message body of the post from the thread or forum that is being watched.
MOD Version: 1.0.5
MOD Download: Main Download Site

Demo Board: http://www.AbsoluteAnime.com/forum/
Demo Username: tester
Demo Password: tester

For the release history, please view the Installation Instructions.
Last edited by primehalo on Mon Jan 14, 2008 11:04 pm, edited 9 times in total.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by IPB_Refugee » Tue Aug 07, 2007 8:57 pm

Let me be the first one to thank you. :lol: I know that many people wanted this (including myself).

Regards
Wolfgang

User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by Trinity » Tue Aug 07, 2007 9:26 pm

There seems to be a problem with this MOD around this part of the instructions:

Find:

Code: Select all

global $db, $user, $config, $phpbb_root_path, $phpEx, $auth
Add After:

Code: Select all

//-- mod: Prime Topic Notify ------------------------------------------------//
	if(is_array($mode))
	{
		$author  = $mode['author']; // This is the name, not the ID
		$message = $mode['message'];
		$mode    = $mode['mode'];

		// Strip user_id out of BBCode
		$uid = '[0-9a-z]{5,}';
		$message = preg_replace("#\[(\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?)(\:?$uid)\]#", '[\1]', $message);

		// Transform special BBCode characters into human-readable characters
		$str_from = array('<', '>', '&#91;', '&#93;', '&#46;', '&#58;');
		$str_to = array('<', '>', '[', ']', '.', ':');
		$message = str_replace($str_from, $str_to, $message);

		// If there is a URL between BBCode URL tags, then add spacing so
		// the email program won't think the BBCode is part of the URL.
		$message = preg_replace('#](http://.*?)\[/url]#', '] \1 [/url]', $message);

		// Remove HTML tags and remove backslashes that appear directly before single quotes
		$message = strip_tags($message); 	
		$message = stripslashes(trim($message));
	}
//-- end: Prime Topic Notify ------------------------------------------------//
I have this line, but it has a colon at the end:

Code: Select all

global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
I tried putting the code after the $auth and before the ; but I kept getting errors. I think there is a mistake somewhere perhaps? Not sure what to do.

I tried putting the above code after the colon, but that didn't work either.
Shop smart, shop S-mart.

User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by primehalo » Tue Aug 07, 2007 9:31 pm

It says "Add After" not "In-line Add After". You're supposed to put it on the next line. I didn't include the semicolon in the find because other MODs might add extra variables to that line and then the FIND wouldn't work.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by Trinity » Tue Aug 07, 2007 9:45 pm

Okay thanks. Sorry I'm a moron. :)
Shop smart, shop S-mart.

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 7:04 am

not working, it just show

Topic: Assalam Walaikum - IslamicTeachings.org tEST TOPIC
Author:
Message:

no author no message :oops:

i will try to reinstall this mod than will reply here.

Thanks for the wonderfull mods by you :)
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by primehalo » Thu Sep 06, 2007 7:19 am

Don't forget to clear the board's cache after installing any MOD. Let me know how it goes.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 7:20 am

I have tried again still the same problem :(

edit: i have purge the cache let see what happens
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 7:31 am

I have tried cleaning the cache but still same problem :( it doesnot show Author and message.

Topic: World Salat Timings & Qiblah Direction On Your Computer. Tes
Author:
Message:
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by primehalo » Thu Sep 06, 2007 7:44 am

Sorry, my mistake. The last two required edits weren't listed in the installation file.

Find

Code: Select all

		user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);
Add before

Code: Select all

//-- mod: Prime Topic Notify ------------------------------------------------//
		$mode = array('mode' => $mode, 'author' => $user->data['username'], 'message' => $data['message']);
//-- end: Prime Topic Notify ------------------------------------------------//
Find

Code: Select all

		user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);
Add after

Code: Select all

//-- mod: Prime Topic Notify ------------------------------------------------//
		$mode = $mode['mode'];
//-- end: Prime Topic Notify ------------------------------------------------//
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 8:10 am

still not working...

i have added those lines in functions_posting.php

not working :( same problem exist.
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by primehalo » Thu Sep 06, 2007 8:18 am

And you cleared the cache again?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 8:22 am

edit: oops this time my mistake lolz i have uplaoded that file in my forum backup folder bymistake.

I will upload that file correectly now and will reply here.
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

User avatar
primehalo
Former Team Member
Posts: 2828
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by primehalo » Thu Sep 06, 2007 8:29 am

I'm sure we can debug it. Can you send me your modified file? This is what the edited sections should look like:

Code: Select all

/**
* User Notification
*/
function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id)
{
    global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;

//-- mod: Prime Topic Notify ------------------------------------------------//
    if(is_array($mode))
    {
        $author  = $mode['author']; // This is the name, not the ID
        $message = $mode['message'];
        $mode    = $mode['mode'];

        // Strip user_id out of BBCode
        $uid = '[0-9a-z]{5,}';
        $message = preg_replace("#\[(\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?)(\:?$uid)\]#", '[\1]', $message);

        // Transform special BBCode characters into human-readable characters
        $str_from = array('<', '>', '&#91;', '&#93;', '&#46;', '&#58;');
        $str_to = array('<', '>', '[', ']', '.', ':');
        $message = str_replace($str_from, $str_to, $message);

        // If there is a URL between BBCode URL tags, then add spacing so
        // the email program won't think the BBCode is part of the URL.
        $message = preg_replace('#](http://.*?)\[/url]#', '] \1 [/url]', $message);

        // Remove HTML tags and remove backslashes that appear directly before single quotes
        $message = strip_tags($message);     
        $message = stripslashes(trim($message));
    }
//-- end: Prime Topic Notify ------------------------------------------------//

    $topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false;
    $forum_notification = ($mode == 'post') ? true : false;
  

Code: Select all

        $notify_rows[$row['user_id']] = array(
            'user_id'        => $row['user_id'],
            'username'        => $row['username'],
            'user_email'    => $row['user_email'],
            'user_jabber'    => $row['user_jabber'], 
            'user_lang'        => $row['user_lang'], 
            'notify_type'    => ($topic_notification) ? 'topic' : 'forum',
            'template'        => ($topic_notification) ? 'topic_notify' : 'newtopic_notify',
//-- mod: Prime Topic Notify ------------------------------------------------//
            'template'        => ($topic_notification) ? 'prime_topic_notify' : 'prime_newtopic_notify',
//-- end: Prime Topic Notify ------------------------------------------------//
            'method'        => $row['user_notify_type'], 
            'allowed'        => false
        );
  

Code: Select all

            $notify_rows[$row['user_id']] = array(
                'user_id'        => $row['user_id'],
                'username'        => $row['username'],
                'user_email'    => $row['user_email'],
                'user_jabber'    => $row['user_jabber'], 
                'user_lang'        => $row['user_lang'],
                'notify_type'    => 'forum',
                'template'        => 'forum_notify',
//-- mod: Prime Topic Notify ------------------------------------------------//
                'template'        => 'prime_forum_notify',
//-- end: Prime Topic Notify ------------------------------------------------//
                'method'        => $row['user_notify_type'], 
                'allowed'        => false
            );
  

Code: Select all

                $messenger->assign_vars(array(
                    'USERNAME'        => htmlspecialchars_decode($addr['name']),
                    'TOPIC_TITLE'    => htmlspecialchars_decode($topic_title),
                    'FORUM_NAME'    => htmlspecialchars_decode($forum_name),
//-- mod: Prime Topic Notify ------------------------------------------------//
                    'AUTHOR'        => isset($author)  ? htmlspecialchars_decode($author)  : '',
                    'MESSAGE'        => isset($message) ? htmlspecialchars_decode($message) : '',
//-- end: Prime Topic Notify ------------------------------------------------//

                    'U_FORUM'                => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
                    'U_TOPIC'                => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
                    'U_NEWEST_POST'            => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
                    'U_STOP_WATCHING_TOPIC'    => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic",
                    'U_STOP_WATCHING_FORUM'    => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum", 
                ));

  

Code: Select all

    // Send Notifications
    if ($mode != 'edit' && $mode != 'delete' && ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])))
    {
//-- mod: Prime Topic Notify ------------------------------------------------//
        $mode = array('mode' => $mode, 'author' => $user->data['username'], 'message' => $data['message']);
//-- end: Prime Topic Notify ------------------------------------------------//
        user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);
//-- mod: Prime Topic Notify ------------------------------------------------//
        $mode = $mode['mode'];
//-- end: Prime Topic Notify ------------------------------------------------//
    }
  
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
c4gamerz
Registered User
Posts: 161
Joined: Thu Aug 30, 2007 5:08 pm
Contact:

Re: [BETA] Prime Topic Notify (0.0.0) Add Msg to Notification Em

Post by c4gamerz » Thu Sep 06, 2007 8:37 am

Read my last message***

lolz finally working

thats the email i get

Topic: Great mod primehalo
Author: test
Message:
Great mod primehaloGreat mod primehaloGreat mod primehaloGreat mod
primehaloGreat mod primehaloGreat mod primehaloGreat mod primehaloGreat mod
primehaloGreat mod primehaloGreat mod primehaloGreat mod primehaloGreat mod
primehaloGreat mod primehaloGreat mod primehaloGreat mod primehaloGreat mod
primehaloGreat mod primehaloGreat mod primehaloGreat mod primehaloGreat mod
primehalo.

Thanks


lol ^^

Thanks for the mod and for your support ;)
Web Designing | Script Integration | Logo Designing | Web Development | ExtensiveWeb.com

Locked

Return to “[3.0.x] MODs in Development”