You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 355 guest(s) and 24 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - NuCalendar Email Alerts [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
FosgateElite
Private
Private


Joined: Feb 15, 2006
Posts: 36


PostPosted: Fri Apr 27, 2007 4:58 am Reply with quoteBack to top

RavenNuke (phpnuke 7.6)

I'm trying to figure out how to customize NuCalendar to send out an email alert to the administrator when there is a new event submission. Much like the alert for a news submission or feedback modules.

I think this is the only portion relevant to the submission.
I do want to keep the code intact, i only want to make additions to get the email alert.

Any help would be appreciated.
Thanks.

Code:
function PostUserSubmitEvent()
{
   global $dbi, $user_prefix;
   $result = sql_query("SELECT * FROM ".$user_prefix."_nucal_options WHERE 1", $dbi);
   $row = sql_fetch_array($result, $dbi);
   if ($row[user_submitted_events_need_admin_aproval]) {
      include ('header.php');
          OpenTable();
          echo "<center><font class=\"title\">"._SUBSENT."</font><br><br>"
           ."<font class=\"content\"><b>"._THANKSSUB."</b><br><br>"
           .""._SUBTEXT;
          CloseTable();
          include ('footer.php');
   } else {
      header("Location: modules.php?name=NuCalendar");
   }
}

switch($op) {

    case "ShowMonth":
    default:
    ShowMonthlyView($month, $year, $printing);
    break;
   
    case "ShowDay":
    ShowDayView($month, $day, $year, $printing);
    break;

    case "ShowEvent":
    ShowEventView($eventid, $month, $day, $year, $recurring_event, $printing);
    break;

    case "SubmitEvent":
    include("header.php");
    OpenTable();
    echo "<center><font class=\"title\">"._SUBMIT_EVENT_INFO."</font></center><br><br>";
    ShowEventForm("modules.php?name=NuCalendar&op=AddEvent", "", "", "Submit Event", "1");
    CloseTable();
    include("footer.php");
    break;

    case "AddEvent":
   $onetime_date = $year."-".$month."-".$day;

   NuCalendar_User_Insert_Row($title, $location, $fulldesc, $start_hour, $start_min, $start_pm, $dur_hour, $dur_min, $isactive, $isrecurring, $categoryid, $onetime_date, $recur_weekday, $recur_schedule, $recur_period, $recur_month);
   PostUserSubmitEvent();
    break;
}
Find all posts by FosgateEliteView user's profileSend private message
FosgateElite
Private
Private


Joined: Feb 15, 2006
Posts: 36


PostPosted: Thu May 03, 2007 8:33 pm Reply with quoteBack to top

Anyone? Anyone?

Don't let the NuCalendar title throw you off if you don't know what NuCalendar is. I just need help making the form send out the notification email in addition to the stuff its doing there in that code.
Find all posts by FosgateEliteView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Thu May 03, 2007 10:09 pm Reply with quoteBack to top

Should be as simple as using the mail function
http://us.php.net/mail

There are many examples of that in phpNuke if you need to figure out how to use it

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
FosgateElite
Private
Private


Joined: Feb 15, 2006
Posts: 36


PostPosted: Sat May 05, 2007 5:33 pm Reply with quoteBack to top

Well, I wanted to integrate it with the nuke settings, so the message would be the same as it would with a news submission. And it would also send to whatever email is set in the preferences.

I guess, if you could point me in the direction where this is done on the news module, i could try to take it from there.
Find all posts by FosgateEliteView user's profileSend private message
djblade311
Nuke Soldier
Nuke Soldier


Joined: Jan 31, 2003
Posts: 14

Location: USA

PostPosted: Tue Feb 19, 2008 1:05 pm Reply with quoteBack to top

Here:
Code:

function PostUserSubmitEvent()
{
   global $dbi, $user_prefix, $notify_email, $notify_from;
   $result = sql_query("SELECT * FROM ".$user_prefix."_nucal_options WHERE 1", $dbi);
   $row = sql_fetch_array($result, $dbi);
   if ($row[user_submitted_events_need_admin_aproval]) {
         $notify_message = "Hey, someone submitted a new calendar event\n";
   mail($notify_email, "New Calendar Event", $notify_message, "From: $notify_from\nX-Mailer: PHP/" . phpversion());
      include ('header.php');
          OpenTable();
          echo "<center><font class=\"title\">"._SUBSENT."</font><br><br>"
           ."<font class=\"content\"><b>"._THANKSSUB."</b><br><br>"
           .""._SUBTEXT;
          CloseTable();
          include ('footer.php');
   } else {
      header("Location: modules.php?name=NuCalendar");
   }
}


_________________
DJ Josh Blade
The DJ Groove
www.thedjgroove.com
Find all posts by djblade311View user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.091 Seconds - 287 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::