Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: [Mccodes Version 2] Events  (Read 339 times)

MonoD

  • Basic Member
  • *
  • Reputation Power: 23
  • MonoD has no influence.
  • Offline Offline
  • Posts: 34
    • MSN Messenger - Contact@Monodistrict.com
    • View Profile
    • WWW
    • Email
[Mccodes Version 2] Events
« on: July 08, 2011, 07:04:05 AM »
Hi again, Here i am just finished updating the events page for Mccodes version 2!
Extremely simple stuff...

Screenshots:




events.php:
Code: [Select]
<?php
include_once(DIRNAME(__FILE__) . '/globals.php');
echo 
"<h3>Your Events</h3><h4>Below are your 10 latest events/notifications involving yourself!</h4><br />";
$_GET['delete'] = abs((int) $_GET['delete']);
if (
$_GET['delete']) {
        
$db->query("DELETE FROM events WHERE evID={$_GET['delete']} AND evUSER=$userid");
        echo 
"<b>Success:</b> You have deleted your selected event.<br /><br />
        <a href='index.php'>Home</a> | <a href='events.php'>Back</a>"
;
        
$h->endpage();
        exit;
}
$q $db->query("SELECT * FROM events WHERE evUSER=$userid ORDER BY evTIME DESC LIMIT 10;");
echo 
"<table width='85%' class='table' cellspacing='1'><tr><th width='25%'>Information</th><th>Event</th></tr>";
while (
$r $db->fetch_row($q)) {
        echo 
"<tr><td><small> " date('l, d M Y H:i:s'$r['evTIME']);
        if (!
$r['evREAD']) {
                echo 
"<b>!</b>";
        }
        echo 
"<br />[<a href='events.php?delete={$r['evID']}'>Delete</a>]</small></td><td>{$r['evTEXT']}</td></tr>";
}
echo 
"</table>";
if (
$ir['new_events'] > 0) {
        
$db->query("UPDATE events SET evREAD=1 WHERE evUSER=$userid");
        
$db->query("UPDATE users SET new_events=0 WHERE userid=$userid");
}
$h->endpage();
?>

That's it enjoy!
Logged

Hedge

  • Basic Member
  • *
  • Reputation Power: 0
  • Hedge has no influence.
  • Offline Offline
  • Posts: 1
    • View Profile
    • Email
Re: [Mccodes Version 2] Events
« Reply #1 on: November 21, 2011, 03:59:24 AM »
nice...i like it...thanks
Logged

MonoD

  • Basic Member
  • *
  • Reputation Power: 23
  • MonoD has no influence.
  • Offline Offline
  • Posts: 34
    • MSN Messenger - Contact@Monodistrict.com
    • View Profile
    • WWW
    • Email
Re: [Mccodes Version 2] Events
« Reply #2 on: November 23, 2011, 07:07:47 AM »
nice...i like it...thanks

Thanks buddy!
Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.