Updating the webroot with addition to the OpenSimWiredux interface that some grids are using

In order for this to work, you need to have Search enabled and working, else it won't budge.

WARNING: This code is experimental, don't use it when you're not able to edit php files.

git-svn-id: http://forge.opensimulator.org/svn/ossearch/trunk@101 109abde3-1f22-4c10-b5d7-b6b0135cd00c
This commit is contained in:
fly-man-
2008-12-11 23:27:45 +00:00
parent f94e0415b2
commit ab77fae6df
8 changed files with 646 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
These are updates for the OpenSimWiredux to make Events and Classifieds work.
In order for this to work
1. Make a good backup of your database and website
2. Copy all the folders and files to your website
3. Open up the OpenSimWiredux in Admin mode (http://OpenSimWiredux/admin) and add 3 new items:
- Search
- Events
- Classifieds
4. Login as a normal user to check if the new items show up
5. Have fun using it
Fly Man-
Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

+149
View File
@@ -0,0 +1,149 @@
<?
/*
* Copyright (c) 2007, 2008 Contributors, http://opensimulator.org/
* See CONTRIBUTORS for a full list of copyright holders.
*
* See LICENSE for the full licensing terms of this file.
*
*/
switch($_SESSION[page])
{
case '':
include("./sites/home.php");
return;
case 'home':
include("./sites/home.php");
return;
case 'change':
include("./sites/changeacc.php");
return;
case 'forgotpass':
include("./sites/forgotpw.php");
return;
case 'pwreset':
include("./sites/pwreset.php");
return;
case 'activate':
include("./sites/activate.php");
return;
case 'gridstatus':
include("./sites/news/gridnews.php");
return;
case 'gridstatushistory':
include("./sites/news/newshistory.php");
return;
case 'smodul':
include("./sites/sitemodul.php");
return;
case 'create':
include("./sites/create.php");
return;
case 'transactions':
include("./sites/transactions.php");
return;
case 'regions':
include("./sites/region_list.php");
return;
case 'map':
include("./sites/map.php");
return;
// Additions for Search
case 'events':
include("./sites/events.php");
return;
case 'make-events':
include("./sites/make-events.php");
return;
case 'save-events':
include("./sites/save-events.php");
return;
case 'classifieds':
include("./sites/classifieds.php");
return;
// End Additions
case 'logout':
include("./sites/logout.php");
return;
default:
include("./sites/sitemodul.php");
return;
}
?>
+19
View File
@@ -0,0 +1,19 @@
<?
if($_SESSION[USERID] == ""){
echo "<script language='javascript'>
<!--
window.location.href='index.php?page=home';
// -->
</script>";
}else{
}
?>
+65
View File
@@ -0,0 +1,65 @@
<?
if($_SESSION[USERID] == ""){
echo "<script language='javascript'>
<!--
window.location.href='index.php?page=home';
// -->
</script>";
}else{
?>
<CENTER>
<H5>These are the upcoming events at this moment.To add a new event, <a href = index.php?page=make-events>click here</a></H5>
<TABLE width=600px border=1>
<TR>
<TD align=center width=150px><b><u>Time</u></b></TD>
<TD align=center width=50px><b><u>Type</u></b></TD>
<TD align=center width=200px><b><u>Event</u></b></TD>
<TD align=center width=200px><b><u>Host</u></b></TD>
</TR>
<?
function Convert($input)
{
// This needs to convert the UUID to a Name LastName combination
$host = "Unknown";
return $host;
}
# Make a new UNIX_TIMESTAMP
$now = time();
# Get all events that are in the future
$DbLink->query("select creatoruuid,dateUTC,eventid,name,eventflags from ossearch.events where dateUTC > $now ORDER BY dateUTC LIMIT 0,10");
while(list($creator,$time,$eventid,$eventname,$event_type) = $DbLink->next_record())
{
$event_time = date("m/d/Y, h:i a",$time);
$event_host = Convert($creator);
if ($event_type == 0) $event_type = "<img height=25px width=25px title='PG Event' src = ./images/events/pink_star.gif>";
if ($event_type == 1) $event_type = "<img height=25px width=25px title='Mature Event' src = ./images/events/blue_star.gif>";
?>
<TR>
<TD><B><?=$event_time?></B></TD>
<TD align=center><B><?=$event_type?></B></TD>
<TD><B><?=$eventname?></B></TD>
<TD><B><?=$event_host?></B></TD>
</TR>
<?
}
}
?>
</TABLE>
</CENTER>
+312
View File
@@ -0,0 +1,312 @@
<?
if($_SESSION[USERID] == ""){
echo "<script language='javascript'>
<!--
window.location.href='index.php?page=home';
// -->
</script>";
}else{
?>
<script>
function checklength(obj,warning_div){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength){
obj.blur();
obj.value=obj.value.substring(0,mlength);
document.getElementById(warning_div).innerHTML = "<span style='color:red;font-weight:bold;'>max. "+mlength+"</span>";
}
else {
warning_div.innerHTML = "";
}
document.getElementById('counter').innerHTML = obj.value.length;
}
</script>
<FORM METHOD="POST" ACTION="index.php?page=save-events">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td>Event Name:</td>
<td><input type="text" id="event_name" name="event_name" size="35" value="" /></td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td valign="top">Description:</td>
<td>
<textarea name="event_desc" rows="7" cols="" style="width:90%" wrap="virtual" maxlength="1024" onfocus="return checklength(this,'contact_max_warning')" onkeyup="return checklength(this,'contact_max_warning')"/></textarea><br/>
</td>
</tr>
<tr>
<td></td>
<td> <div>
<div >
<em id="contact_max_warning">max. <strong>1024</strong> </em>
Characters typed: <em id="counter"></em>
</div>
</div>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>Date:</td>
<td>
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<select name="event_day">
<option value="1" >01</option>
<option value="2" >02</option>
<option value="3" >03</option>
<option value="4" >04</option>
<option value="5" >05</option>
<option value="6" >06</option>
<option value="7" >07</option>
<option value="8" >08</option>
<option value="9" >09</option>
<option value="10" >10</option>
<option value="11" >11</option>
<option value="12" >12</option>
<option value="13" >13</option>
<option value="14" >14</option>
<option value="15" >15</option>
<option value="16" >16</option>
<option value="17" >17</option>
<option value="18" >18</option>
<option value="19" >19</option>
<option value="20" >20</option>
<option value="21" >21</option>
<option value="22" >22</option>
<option value="23" >23</option>
<option value="24" >24</option>
<option value="25" >25</option>
<option value="26" >26</option>
<option value="27" >27</option>
<option value="28" >28</option>
<option value="29" >29</option>
<option value="30" >30</option>
<option value="31" >31</option>
</select>
</td>
<td>
<select name="event_month">
<option value="1" >January</option>
<option value="2" >February</option>
<option value="3" >March</option>
<option value="4" >April</option>
<option value="5" >May</option>
<option value="6" >June</option>
<option value="7" >July</option>
<option value="8" >August</option>
<option value="9" >September</option>
<option value="10" >October</option>
<option value="11" >November</option>
<option value="12" >December</option>
</select>
</td>
<td>
<select name="event_year">
<option value="2008" >2008</option>
<option value="2009" >2009</option>
<option value="2010" >2010</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>Starts at:</td>
<td>
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<select name="time_hour">
<option value="0" >12 am</option>
<option value="1" >1 am</option>
<option value="2" >2 am</option>
<option value="3" >3 am</option>
<option value="4" >4 am</option>
<option value="5" >5 am</option>
<option value="6" >6 am</option>
<option value="7" >7 am</option>
<option value="8" >8 am</option>
<option value="9" >9 am</option>
<option value="10" >10 am</option>
<option value="11" >11 am</option>
<option value="12" >12 pm</option>
<option value="13" >1 pm</option>
<option value="14" >2 pm</option>
<option value="15" >3 pm</option>
<option value="16" >4 pm</option>
<option value="17" >5 pm</option>
<option value="18" >6 pm</option>
<option value="19" >7 pm</option>
<option value="20" >8 pm</option>
<option value="21" >9 pm</option>
<option value="22" >10 pm</option>
<option value="23" >11 pm</option>
</select>
</td>
<td>
<select name="time_minutes" >
<option value="0" >: 00</option>
<option value="15" >: 15</option>
<option value="30" >: 30</option>
<option value="45" >: 45</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>Duration:</td>
<td>
<table border="0" cellspacing="0" cellspadding="1">
<tr>
<td>
<select name="duration">
<option value="10" >10 minutes</option>
<option value="15" >15 minutes</option>
<option value="20" >20 minutes</option>
<option value="25" >25 minutes</option>
<option value="30" >30 minutes</option>
<option value="45" >45 minutes</option>
<option value="60" >1 hour</option>
<option value="90" >1.5 hours</option>
<option value="120" >2 hours</option>
<option value="150" >2.5 hours</option>
<option value="180" >3 hours</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>Category:</td>
<td>
<select name="category">
<option value="">- Select Category -</option>
<option value="27" >Arts and Culture</option>
<option value="28" >Charity/Support Groups</option>
<option value="22" >Commercial</option>
<option value="18" >Discussion</option>
<option value="26" >Education</option>
<option value="24" >Games/Contests</option>
<option value="20" >Live Music</option>
<option value="29" >Miscellaneous</option>
<option value="23" >Nightlife/Entertainment</option>
<option value="25" >Pageants</option>
<option value="19" >Sports</option>
</select>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td nowrap>Cover Charge?</td>
<td>
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<select name="cover_charge">
<option value="Y" >Yes</option>
<option value="N" >No</option>
</select>
</td>
<td>Amount (L$):</td>
<td><input type="text" name="amount" size="3" maxlength="5" value="" /></td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>Location:</td>
<td>
<select name="parcel_chosen">
<option>Pick a parcel</option>
<?
// Getting the regions you have access to
$DbLink->query("SELECT regionUUID, parcelname, landingpoint FROM ossearch.allparcels WHERE owneruuid = '".$_SESSION[USERID]."'");
while(list($regionUUID,$parcelname,$landingpoint) = $DbLink->next_record()){
echo "<OPTION value = $landingpoint|$regionUUID>".$parcelname."</OPTION>";
}
?>
</select>
</tr>
<tr><td colspan=2><br/></td></tr>
<tr>
<td>Mature Event?:</td>
<td>
<table border="0" cellspacing="0" cellspadding="1">
<tr>
<td><input type="checkbox" name="access" value="21" /></td>
<td>Yes, this will be a mature event.</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>&nbsp;</td>
<td><br/><input type="button" name="action" value="Save Event" onclick="form.submit()"/></td>
</tr>
</table>
</form>
</div>
</td></tr>
</table>
</FORM>
<?
}
?>
+82
View File
@@ -0,0 +1,82 @@
<?
##
## This will make the Event go into the database
##
$event_name = $_POST['event_name'];
$event_desc = $_POST['event_desc'];
## Make a UNIX_TIMESTAMP of the date/time
$event_date = mktime($_POST['time_hour'], $_POST['time_minutes'], 0, $_POST['event_month'],$_POST['event_day'], $_POST['event_year']);
$duration = $_POST['duration'];
$category = $_POST['category'];
$cover_charge = $_POST['cover_charge'];
## Checking if a Cover Charge is asked
if ($cover_charge == "Y")
{
$cover_charge = 1;
$cover_amount = $_POST['amount'];
}
else
{
$cover_charge = 0;
$cover_amount = 0;
}
# The hard part, getting the region and converting that to a GlobalPosition
$position = $_POST['parcel_chosen'];
list($location, $region) = explode("|", $position);
list($valX, $valY, $valZ) = explode("/", $location);
$ParcelX = intval($valX);
$ParcelY = intval($valY);
$ParcelZ = intval($valZ);
$DbLink->query("SELECT regionName, locX, locY FROM ".C_REGIONS_TBL." WHERE uuid = '".$region."'");
while(list($regionname,$locX,$locY) = $DbLink->next_record())
{
$RegionX = ($locX * 256);
$RegionY = ($locY * 256);
$GlobalX = $RegionX + $ParcelX;
$GlobalY = $RegionY + $ParcelY;
$GlobalZ = $ParcelZ;
$sim_name = $regionname;
}
$GlobalPos = "<".$GlobalX.",".$GlobalY.",".$GlobalZ.">";
# Checking if it's a event with Maturity
$access = $_POST['access'];
if ($access == 21)
{
$access = "true";
$eventflags = 1;
}
else
{
$access = "false";
$eventflags = 0;
}
# Check if we have all the info and that there's no fault stuff here
if ($event_name != "" && $event_desc != "" && $sim_name != "" && $GlobalPos != "")
{
$query = 'INSERT INTO ossearch.events (owneruuid,name,creatoruuid,category,description,dateUTC,duration,covercharge,coveramount,simname,globalPos,eventflags,mature) VALUES("'.$_SESSION[USERID].'","'.$event_name.'","'.$_SESSION[USERID].'",'.$category.',"'.$event_desc.'",'.$event_date.','.$duration.','.$cover_charge.','.$cover_amount.',"'.$sim_name.'","'.$GlobalPos.'",'.$eventflags.',"'.$access.'")';
$DbLink->query($query);
# Do some nice output for people to know that their event has been handled
echo "<CENTER>Your event has been submitted to the database<p>Click on the left menu to find your event</CENTER>";
}
else
{
echo "<CENTER>Your event could not be saved, please check your event submission again<p><a href=# onClick=history.back()>Click here to go back to the page</a></CENTER>";
}
?>