Revision [1834]
This is an old revision of GmBowenRecentEditCheck made by GmBowen on 2004-10-13 05:00:28.
Sorry the presentation isn't "fancy", but it's late and I have to teach tomorrow early in the morning.
++++++++++++++++++++++++++++++++++++++++++++++++ TABLE CODE ++++++++++++++++++++++++++++++++++++++++++++++++ CREATE TABLE `wikka_onlineusers` ( `ip` varchar(15) NOT NULL default '', `expire` int(10) unsigned NOT NULL default '0', `username` varchar(255) NOT NULL default '', `recentpage` varchar(50) NOT NULL default '', `recentpageedittime` int(10) unsigned default NULL, `recentpageeditname` varchar(50) default NULL, UNIQUE KEY `ip` (`ip`) ) TYPE=MyISAM; +++++++++++++++++++++++++++++++++++++++++++++++++ pageinuse.php (place in actions directory) +++++++++++++++++++++++++++++++++++++++++++++++++ <?php $thispagename = $this->getPageTag(); $usernameP = $this->GetUserName(); $table = $this->config["table_prefix"].onlineusers; $output = "SELECT * FROM ".$table." WHERE recentpageeditname='$thispagename' AND username NOT LIKE '$usernameP' ORDER BY username"; $result = mysql_query($output); while ($row = mysql_fetch_array($result)) { extract ($row); if (($recentpage == $recentpageeditname) && (($expire-$recentpageedittime)<600)) { echo "<a href='javascript:void(0);' onmouseover=\"this.T_DELAY=0;this.T_PADDING=10;this.T_WIDTH=130;this.T_BGCOLOR='#FF3300';this.T_FONTCOLOR='#000000';this.T_FONTWEIGHT='bold';return escape('File Edited in Last Ten Minutes')\"><B><font color=#ff0000>!!</font></B></A>"; echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./actions/wz_tooltip.js\"></script>"; break; } } ?> ++++++++++++++++++++++++++++++++++++++++++++++++++ Code modified in header.php (around line 40; notice that small graphic for reload is missing...I just captured and used the one from IE) ++++++++++++++++++++++++++++++++++++++++++++++++++ <h2><?php echo "<a href='".$this->GetConfigValue("base_url").$this->MiniHref($method, $tag)."' title=\"Refresh this page to see if editing is safe.\"><IMG SRC=\"./images/reload.gif\" BORDER=0></a>".$this->config["wakka_name"] ?> : <a href="<?php echo $this->href("", "TextSearch", "phrase=").urlencode($this->GetPageTag()); ?>"><?php echo $this->GetPageTag(); ?></a><? include("pageinuse.php"); ?></h2> ++++++++++++++++++++++++++++++++++++++++++++++++++ The wz_tooltip.js (referred to above), which allows "better" tooltips (in this case, more recognizable) is available at http://www.walterzorn.com/tooltip/tooltip_e.htm as a free download....put into actions directory ++++++++++++++++++++++++++++++++++++++++++++++++++ recentpageedit.php (put in actions directory) ++++++++++++++++++++++++++++++++++++++++++++++++++ <? $time2wait = 900; // Number of seconds $thispagenameX = $this->getPageTag(); $table = $this->config["table_prefix"]."onlineusers"; $REMOTE_ADDR = getenv("REMOTE_ADDR"); mysql_query("UPDATE ".$table." SET expire = '".(time()+$time2wait)."', recentpage = '".$thispagenameX."', recentpageedittime = '".(time()+$time2wait)."', recentpageeditname = '".$thispagenameX."' WHERE ip='".$REMOTE_ADDR."'"); echo "<center><B>Make sure you save your file at least every 10 Minutes!</b></center>"; ?> +++++++++++++++++++++++++++++++++++++++++++++++++++ edit.php (add the following line 4 on page) +++++++++++++++++++++++++++++++++++++++++++++++++++ include("./actions/recentpageedit.php");