Post by Kristal Rose Phoenix McKinstry on Oct 24, 2005 8:02:19 GMT -5
<?php
##########################################################################################
######################### SMC CS85 CHESS PROGRAM #########################################
##########################################################################################
if ($ulShowVersions) print('
#### oForum.rpq ##########################################################################<br />
#### 2005.11.09 23:55 - km forum now has output. ############<br />
#### 2005.11.09 22:00 - km Table qtForum now supports unicode. ############<br />
#### 2005.11.09 21:30 - km protects against malicious postings. ############<br />
#### 2005.11.09 21:00 - km Now gets to and from postings. ############<br />
#### 2005.11.03 05:45 - km added, working on fGetPostingsHtml(&$loCFV). ###############<br />
#### 2005.10.30 04:00 - km got PostComment half working. ###############<br />');
#### 2005.10.30 02:15 - km added fGetOwner, working on oForum meth. ###############
#### 2005.10.29 08:00 - km added $vhLastState for refresh of forum. ###############
#### 2005.10.26 22:40 - km modified to support new oServer object ! ! ###############
#### 2005.10.26 19:40 - km added $ulShowVersions for testing. ###############
#### 2005.10.26 18:10 - km layed out function skeleton. ###############
#### 2005.10.24 11:25 - km altered displayed html text. ###############
#### 2005.10.24 05:55 - km Added Forum Features. ###############
#### 2005.10.24 02:40 - km CREATED THIS PAGE ###############
##########################################################################################
##########################################################################################
#### Status: !! LOCKED !! by KM ##########################################################
##########################################################################################
##########################################################################################
#### Description: #####################################################################
#### ###########
#### methods: ###########
#### fGetFormHtml($laSettings) - Not Finished ###########
#### fGetScroll($laPlayerOneId, $laPlayerTwoId, $llWantPublic) ###########
#### - Not Started ###########
#### fPostComment($laPlayerOneId, $lsComment, $llMakePublic, $lsDate) ###########
#### - Not Started ###########
#### function fPostComment($laPostValues) {####// $laPostValues = ?oCFV->fGetForumSettings()
#### //adds comment to sql table.
#### }
####//function fModifyComment(??: player_id, post-datetime) // an sql function.
####//function fDeleteComment(??: player_id, post-datetime) // an sql function.
####//function fGetPosts(??: player_id, get_public, from-datetime, to-datetime) // an sql function.
// Gets posts in which player_id was from or to column player
#### ###########
#### ###########
##########################################################################################
##########################################################################################
#### Application installation: ###########
#### ###########
#### Insert vars in Form variables collector: ###########
#### // Forum Variables // ###########
#### var $lsvcIsPublic = 'zilch'; // zilch or yes ###########
#### var $lsvcShowPublic = 'zilch'; // zilch or yes ###########
#### var $lsvsBegin = "0"; // "0" default ###########
#### var $lsvsEnd = "0"; // "0" default ###########
#### var $lsvaComment = ""; // empty string ###########
#### var $lsvsDelete = "0"; // "0" default ###########
#### var $lsvsModify = "0"; // "0" default ###########
#### var $lsvbForumPost = 'zilch'; // zilch or "Post comment" ###########
#### // end-Forum Variables // ###########
#### ###########
#### Create 'PostComment' return for fGetRequestType ###########
#### Create 'PostComment' function in main app control which calls this-> ###########
##########################################################################################
##########################################################################################
#### CREATE TABLE `qtForum` (
#### `qfUID` INT( 9 ) NOT NULL AUTO_INCREMENT ,
#### `qfFromId` CHAR( 6 ) DEFAULT 'zilch' NOT NULL ,
#### `qfToId` CHAR( 6 ) DEFAULT 'zilch' NOT NULL ,
#### `qfPublic` INT( 1 ) DEFAULT '0' NOT NULL ,
#### `qfDateTime` INT( 10 ) DEFAULT '0' NOT NULL ,
#### `qfComment` MEDIUMTEXT UNICODE NOT NULL ,
#### PRIMARY KEY ( `qfUID` )
#### ) TYPE = MYISAM ;
##########################################################################################
##########################################################################################
#### Ver. 1.0 - Incomplete stub code #####################################################
##########################################################################################
#### Agenda: #############################################################################
#### #############################################################################
#### ###########################
#### [ ] Get fGetFormHtml to use it's setting argument. #############################
#### [ ] Complete other functions. #############################
#### #############################
##########################################################################################
##########################################################################################
############################################ TEST STATUS: #################
############################################ No testing has been done. #################
##########################################################################################
##########################################################################################
#### Programmers: Kristal McKinstry, #################
##########################################################################################
##########################################################################################
#~~~~PROGRAMMER NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~ K McKinstry~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##########################################################################################
##########################################################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class oForum {
##var $vsOwner;
##var $vsPartner;
// vars Player IDs and other settings from Form Requests.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
##function oForum ($lsId){ // a new forum object can be created on each screen refresh.
function oForum (){ // a new forum object can be created on each screen refresh.
##$this->vsOwner = $lsId;
}//end-meth oForum
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fPostComment(&$loCFV, &$loServer) {
$laPostValues = $loCFV->fGetForumSettings();
$lsPlayerId = $loCFV->fGetVal('vhPlayer');
$oR = new oRegistration($loServer);
$lsPlayerTwoId = $oR->fGetOtherId($lsPlayerId);
if ($laPostValues['xvcIsPublic'] != 'zilch') $liPublic = 1;
else $liPublic = 0;
$liTime = time();
$lsComment = $laPostValues['xvaComment'];
$lsComment = str_replace('\'', chr(202), $lsComment); //unicode0167 - so quotes dont crash sql.
$lsComment = str_replace('<', '[', $lsComment);
$lsComment = str_replace('>', ']', $lsComment);
$lsComment = utf8_encode($lsComment);
$query = "INSERT INTO `qtForum` (qfFromId, qfToId, qfPublic, qfDateTime, qfComment) VALUES ('$lsPlayerId', '$lsPlayerTwoId', $liPublic, $liTime, '$lsComment')";
$loServer->fSelectDB();
mysql_query($query);
}
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
####//function fModifyComment(??: player_id, post-datetime) // an sql function.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
####//function fDeleteComment(??: player_id, post-datetime) // an sql function.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fGetFormHtml($laSettings) {
// FORUM Form building SECTION BELOW
$lsForumSection = '<p class="forumhead">Chat feature:</p>';
$lsForumSection .= '<p align="center"><span class="forumcontrols">Public comment?</span><input type="checkbox" name="vcIsPublic" value="yes"';
if ($laSettings['xvcIsPublic'] == 'yes') $lsForumSection .= ' checked';
$lsForumSection .= '>';
$lsForumSection .= '<span class="forumcontrols">, Show public comments? </span><input type="checkbox" name="vcShowPublic" value="yes"';
if ($laSettings['xvcShowPublic'] == 'yes') $lsForumSection .= ' checked';
$lsForumSection .= '>';
$lsForumSection .= ' <span class="forumcontrols">, Display from: </span>';
$lsForumSection .= ' <select name="vsBegin">';
$lsForumSection .= ' <option value="0"';
if ($laSettings['xvsBegin'] == 0) $lsForumSection .= ' selected';
$lsForumSection .= '>Beginning</option>';
$lsForumSection .= ' <option value="1"';
if ($laSettings['xvsBegin'] == 1) $lsForumSection .= ' selected';
$lsForumSection .= '>Two hours ago</option>';
$lsForumSection .= ' <option value="2"';
if ($laSettings['xvsBegin'] == 2) $lsForumSection .= ' selected';
$lsForumSection .= '>Last midnight</option>';
$lsForumSection .= ' <option value="3"';
if ($laSettings['xvsBegin'] == 3) $lsForumSection .= ' selected';
$lsForumSection .= '>Three days ago</option>';
$lsForumSection .= ' <option value="4"';
if ($laSettings['xvsBegin'] == 4) $lsForumSection .= ' selected';
$lsForumSection .= '>A week ago</option>';
$lsForumSection .= ' <option value="5"';
if ($laSettings['xvsBegin'] == 5) $lsForumSection .= ' selected';
$lsForumSection .= '>A month ago</option>';
$lsForumSection .= ' <option value="6"';
if ($laSettings['xvsBegin'] == 6) $lsForumSection .= ' selected';
$lsForumSection .= '>Six months ago</option>';
$lsForumSection .= ' <option value="7"';
if ($laSettings['xvsBegin'] == 7) $lsForumSection .= ' selected';
$lsForumSection .= '>A year ago</option>';
$lsForumSection .= ' </select>';
$lsForumSection .= ' <span class="forumcontrols">, Display to: </span>';
$lsForumSection .= ' <select name="vsEnd">';
$lsForumSection .= ' <option value="0"';
if ($laSettings['xvsEnd'] == 0) $lsForumSection .= ' selected';
$lsForumSection .= '>End</option>';
$lsForumSection .= ' <option value="1"';
if ($laSettings['xvsEnd'] == 1) $lsForumSection .= ' selected';
$lsForumSection .= '>till two hours ago</option>';
$lsForumSection .= ' <option value="2"';
if ($laSettings['xvsEnd'] == 2) $lsForumSection .= ' selected';
$lsForumSection .= '>till midnight midnight</option>';
$lsForumSection .= ' <option value="3"';
if ($laSettings['xvsEnd'] == 3) $lsForumSection .= ' selected';
$lsForumSection .= '>till three days ago</option>';
$lsForumSection .= ' <option value="4"';
if ($laSettings['xvsEnd'] == 4) $lsForumSection .= ' selected';
$lsForumSection .= '>till a week ago</option>';
$lsForumSection .= ' <option value="5"';
if ($laSettings['xvsEnd'] == 5) $lsForumSection .= ' selected';
$lsForumSection .= '>till a month ago</option>';
$lsForumSection .= ' <option value="6"';
if ($laSettings['xvsEnd'] == 6) $lsForumSection .= ' selected';
$lsForumSection .= '>till six months ago</option>';
$lsForumSection .= ' <option value="7"';
if ($laSettings['xvsEnd'] == 7) $lsForumSection .= ' selected';
$lsForumSection .= <<<FORUMSECTION
>Last year</option>
</select></p>
<p align="center">
<textarea name="vaComment" cols="78" rows="11"></textarea>
</p>
<p align="center"><span class="forumedit">Delete: </span>
<select name="vsDelete">
<option value="0" selected>None</option>
</select>
<span class="forumedit">Modify: </span>
<select name="vsModify">
<option value="0" selected>None</option>
</select>
<input name="vbForumPost" type="submit" id="vbForumPost" value="Post comment">
</p>
FORUMSECTION;
return($lsForumSection);
} //end-meth fGetFormHtml
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fGetPostingsHtml(&$loCFV){
// Gets posts in which player_id was from or to column player
$laPostValues = $loCFV->fGetForumSettings();
$lsPlayerId = $loCFV->fGetVal('vhPlayer');
$liShowPublic = $laPostValues['xvcShowPublic'];
$loServer = new oServer();
$loReg = new oRegistration($loServer);
$lsOtherPlayerId = $loReg->fGetOtherId($lsPlayerId);
if ($liShowPublic != 1) $query = "SELECT ALL * FROM qtForum WHERE (qfFromId = '$lsPlayerId' AND qfToId = '$lsOtherPlayerId') OR (qfFromId = '$lsOtherPlayerId' AND qfToId = '$lsPlayerId') ORDER BY qfDateTime DESC;";
else $query = "SELECT ALL * FROM qtForum WHERE (qfFromId = '$lsPlayerId' AND qfToId = '$lsOtherPlayerId') OR (qfFromId = '$lsOtherPlayerId' AND qfToId = '$lsPlayerId') OR qfPublic = 1 ORDER BY qfDateTime DESC;";
$loServer->fSelectDB();
list($liX, $laPostings) = mysql_fetch_table_array(mysql_query($query));
if ($liX<1) echocall ('forum postings was empty');
print('<p></p>');
print('<p></p>');
$liX--;
For ($liN=0; $liN<=$liX; $liN++){
$lsFrom = $loReg->fGetNameFromId($laPostings[$liN][1]);
$lsTo = $loReg->fGetNameFromId($laPostings[$liN][2]);
$lsTime = date("F d, Y H:i", $laPostings[$liN][4]);
$lsComment = utf8_decode($laPostings[$liN][5]);
$lsComment = str_replace(chr(202), '\'', $lsComment);
print('<p align="center" class="forumtext">'.
'<span class="forumlabel">'.'From: '.'</span>'.
'<span class="forumval">'.$lsFrom.'</span>'.
'<span class="forumlabel">'.' To: '.'</span>'.
'<span class="forumval">'.$lsTo .'</span>'.
'<span class="forumlabel">'.' Date: '.'</span>'.
'<span class="forumval">'.$lsTime.'</span></p>');
print('<p align="left" class="forumtext">'.' '.$lsComment.'</p>');
}//end-for
}//end-meth fGetPostingsHtml
} //end-class oForum
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?>
##########################################################################################
######################### SMC CS85 CHESS PROGRAM #########################################
##########################################################################################
if ($ulShowVersions) print('
#### oForum.rpq ##########################################################################<br />
#### 2005.11.09 23:55 - km forum now has output. ############<br />
#### 2005.11.09 22:00 - km Table qtForum now supports unicode. ############<br />
#### 2005.11.09 21:30 - km protects against malicious postings. ############<br />
#### 2005.11.09 21:00 - km Now gets to and from postings. ############<br />
#### 2005.11.03 05:45 - km added, working on fGetPostingsHtml(&$loCFV). ###############<br />
#### 2005.10.30 04:00 - km got PostComment half working. ###############<br />');
#### 2005.10.30 02:15 - km added fGetOwner, working on oForum meth. ###############
#### 2005.10.29 08:00 - km added $vhLastState for refresh of forum. ###############
#### 2005.10.26 22:40 - km modified to support new oServer object ! ! ###############
#### 2005.10.26 19:40 - km added $ulShowVersions for testing. ###############
#### 2005.10.26 18:10 - km layed out function skeleton. ###############
#### 2005.10.24 11:25 - km altered displayed html text. ###############
#### 2005.10.24 05:55 - km Added Forum Features. ###############
#### 2005.10.24 02:40 - km CREATED THIS PAGE ###############
##########################################################################################
##########################################################################################
#### Status: !! LOCKED !! by KM ##########################################################
##########################################################################################
##########################################################################################
#### Description: #####################################################################
#### ###########
#### methods: ###########
#### fGetFormHtml($laSettings) - Not Finished ###########
#### fGetScroll($laPlayerOneId, $laPlayerTwoId, $llWantPublic) ###########
#### - Not Started ###########
#### fPostComment($laPlayerOneId, $lsComment, $llMakePublic, $lsDate) ###########
#### - Not Started ###########
#### function fPostComment($laPostValues) {####// $laPostValues = ?oCFV->fGetForumSettings()
#### //adds comment to sql table.
#### }
####//function fModifyComment(??: player_id, post-datetime) // an sql function.
####//function fDeleteComment(??: player_id, post-datetime) // an sql function.
####//function fGetPosts(??: player_id, get_public, from-datetime, to-datetime) // an sql function.
// Gets posts in which player_id was from or to column player
#### ###########
#### ###########
##########################################################################################
##########################################################################################
#### Application installation: ###########
#### ###########
#### Insert vars in Form variables collector: ###########
#### // Forum Variables // ###########
#### var $lsvcIsPublic = 'zilch'; // zilch or yes ###########
#### var $lsvcShowPublic = 'zilch'; // zilch or yes ###########
#### var $lsvsBegin = "0"; // "0" default ###########
#### var $lsvsEnd = "0"; // "0" default ###########
#### var $lsvaComment = ""; // empty string ###########
#### var $lsvsDelete = "0"; // "0" default ###########
#### var $lsvsModify = "0"; // "0" default ###########
#### var $lsvbForumPost = 'zilch'; // zilch or "Post comment" ###########
#### // end-Forum Variables // ###########
#### ###########
#### Create 'PostComment' return for fGetRequestType ###########
#### Create 'PostComment' function in main app control which calls this-> ###########
##########################################################################################
##########################################################################################
#### CREATE TABLE `qtForum` (
#### `qfUID` INT( 9 ) NOT NULL AUTO_INCREMENT ,
#### `qfFromId` CHAR( 6 ) DEFAULT 'zilch' NOT NULL ,
#### `qfToId` CHAR( 6 ) DEFAULT 'zilch' NOT NULL ,
#### `qfPublic` INT( 1 ) DEFAULT '0' NOT NULL ,
#### `qfDateTime` INT( 10 ) DEFAULT '0' NOT NULL ,
#### `qfComment` MEDIUMTEXT UNICODE NOT NULL ,
#### PRIMARY KEY ( `qfUID` )
#### ) TYPE = MYISAM ;
##########################################################################################
##########################################################################################
#### Ver. 1.0 - Incomplete stub code #####################################################
##########################################################################################
#### Agenda: #############################################################################
#### #############################################################################
#### ###########################
#### [ ] Get fGetFormHtml to use it's setting argument. #############################
#### [ ] Complete other functions. #############################
#### #############################
##########################################################################################
##########################################################################################
############################################ TEST STATUS: #################
############################################ No testing has been done. #################
##########################################################################################
##########################################################################################
#### Programmers: Kristal McKinstry, #################
##########################################################################################
##########################################################################################
#~~~~PROGRAMMER NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~ K McKinstry~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##########################################################################################
##########################################################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class oForum {
##var $vsOwner;
##var $vsPartner;
// vars Player IDs and other settings from Form Requests.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
##function oForum ($lsId){ // a new forum object can be created on each screen refresh.
function oForum (){ // a new forum object can be created on each screen refresh.
##$this->vsOwner = $lsId;
}//end-meth oForum
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fPostComment(&$loCFV, &$loServer) {
$laPostValues = $loCFV->fGetForumSettings();
$lsPlayerId = $loCFV->fGetVal('vhPlayer');
$oR = new oRegistration($loServer);
$lsPlayerTwoId = $oR->fGetOtherId($lsPlayerId);
if ($laPostValues['xvcIsPublic'] != 'zilch') $liPublic = 1;
else $liPublic = 0;
$liTime = time();
$lsComment = $laPostValues['xvaComment'];
$lsComment = str_replace('\'', chr(202), $lsComment); //unicode0167 - so quotes dont crash sql.
$lsComment = str_replace('<', '[', $lsComment);
$lsComment = str_replace('>', ']', $lsComment);
$lsComment = utf8_encode($lsComment);
$query = "INSERT INTO `qtForum` (qfFromId, qfToId, qfPublic, qfDateTime, qfComment) VALUES ('$lsPlayerId', '$lsPlayerTwoId', $liPublic, $liTime, '$lsComment')";
$loServer->fSelectDB();
mysql_query($query);
}
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
####//function fModifyComment(??: player_id, post-datetime) // an sql function.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
####//function fDeleteComment(??: player_id, post-datetime) // an sql function.
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fGetFormHtml($laSettings) {
// FORUM Form building SECTION BELOW
$lsForumSection = '<p class="forumhead">Chat feature:</p>';
$lsForumSection .= '<p align="center"><span class="forumcontrols">Public comment?</span><input type="checkbox" name="vcIsPublic" value="yes"';
if ($laSettings['xvcIsPublic'] == 'yes') $lsForumSection .= ' checked';
$lsForumSection .= '>';
$lsForumSection .= '<span class="forumcontrols">, Show public comments? </span><input type="checkbox" name="vcShowPublic" value="yes"';
if ($laSettings['xvcShowPublic'] == 'yes') $lsForumSection .= ' checked';
$lsForumSection .= '>';
$lsForumSection .= ' <span class="forumcontrols">, Display from: </span>';
$lsForumSection .= ' <select name="vsBegin">';
$lsForumSection .= ' <option value="0"';
if ($laSettings['xvsBegin'] == 0) $lsForumSection .= ' selected';
$lsForumSection .= '>Beginning</option>';
$lsForumSection .= ' <option value="1"';
if ($laSettings['xvsBegin'] == 1) $lsForumSection .= ' selected';
$lsForumSection .= '>Two hours ago</option>';
$lsForumSection .= ' <option value="2"';
if ($laSettings['xvsBegin'] == 2) $lsForumSection .= ' selected';
$lsForumSection .= '>Last midnight</option>';
$lsForumSection .= ' <option value="3"';
if ($laSettings['xvsBegin'] == 3) $lsForumSection .= ' selected';
$lsForumSection .= '>Three days ago</option>';
$lsForumSection .= ' <option value="4"';
if ($laSettings['xvsBegin'] == 4) $lsForumSection .= ' selected';
$lsForumSection .= '>A week ago</option>';
$lsForumSection .= ' <option value="5"';
if ($laSettings['xvsBegin'] == 5) $lsForumSection .= ' selected';
$lsForumSection .= '>A month ago</option>';
$lsForumSection .= ' <option value="6"';
if ($laSettings['xvsBegin'] == 6) $lsForumSection .= ' selected';
$lsForumSection .= '>Six months ago</option>';
$lsForumSection .= ' <option value="7"';
if ($laSettings['xvsBegin'] == 7) $lsForumSection .= ' selected';
$lsForumSection .= '>A year ago</option>';
$lsForumSection .= ' </select>';
$lsForumSection .= ' <span class="forumcontrols">, Display to: </span>';
$lsForumSection .= ' <select name="vsEnd">';
$lsForumSection .= ' <option value="0"';
if ($laSettings['xvsEnd'] == 0) $lsForumSection .= ' selected';
$lsForumSection .= '>End</option>';
$lsForumSection .= ' <option value="1"';
if ($laSettings['xvsEnd'] == 1) $lsForumSection .= ' selected';
$lsForumSection .= '>till two hours ago</option>';
$lsForumSection .= ' <option value="2"';
if ($laSettings['xvsEnd'] == 2) $lsForumSection .= ' selected';
$lsForumSection .= '>till midnight midnight</option>';
$lsForumSection .= ' <option value="3"';
if ($laSettings['xvsEnd'] == 3) $lsForumSection .= ' selected';
$lsForumSection .= '>till three days ago</option>';
$lsForumSection .= ' <option value="4"';
if ($laSettings['xvsEnd'] == 4) $lsForumSection .= ' selected';
$lsForumSection .= '>till a week ago</option>';
$lsForumSection .= ' <option value="5"';
if ($laSettings['xvsEnd'] == 5) $lsForumSection .= ' selected';
$lsForumSection .= '>till a month ago</option>';
$lsForumSection .= ' <option value="6"';
if ($laSettings['xvsEnd'] == 6) $lsForumSection .= ' selected';
$lsForumSection .= '>till six months ago</option>';
$lsForumSection .= ' <option value="7"';
if ($laSettings['xvsEnd'] == 7) $lsForumSection .= ' selected';
$lsForumSection .= <<<FORUMSECTION
>Last year</option>
</select></p>
<p align="center">
<textarea name="vaComment" cols="78" rows="11"></textarea>
</p>
<p align="center"><span class="forumedit">Delete: </span>
<select name="vsDelete">
<option value="0" selected>None</option>
</select>
<span class="forumedit">Modify: </span>
<select name="vsModify">
<option value="0" selected>None</option>
</select>
<input name="vbForumPost" type="submit" id="vbForumPost" value="Post comment">
</p>
FORUMSECTION;
return($lsForumSection);
} //end-meth fGetFormHtml
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
function fGetPostingsHtml(&$loCFV){
// Gets posts in which player_id was from or to column player
$laPostValues = $loCFV->fGetForumSettings();
$lsPlayerId = $loCFV->fGetVal('vhPlayer');
$liShowPublic = $laPostValues['xvcShowPublic'];
$loServer = new oServer();
$loReg = new oRegistration($loServer);
$lsOtherPlayerId = $loReg->fGetOtherId($lsPlayerId);
if ($liShowPublic != 1) $query = "SELECT ALL * FROM qtForum WHERE (qfFromId = '$lsPlayerId' AND qfToId = '$lsOtherPlayerId') OR (qfFromId = '$lsOtherPlayerId' AND qfToId = '$lsPlayerId') ORDER BY qfDateTime DESC;";
else $query = "SELECT ALL * FROM qtForum WHERE (qfFromId = '$lsPlayerId' AND qfToId = '$lsOtherPlayerId') OR (qfFromId = '$lsOtherPlayerId' AND qfToId = '$lsPlayerId') OR qfPublic = 1 ORDER BY qfDateTime DESC;";
$loServer->fSelectDB();
list($liX, $laPostings) = mysql_fetch_table_array(mysql_query($query));
if ($liX<1) echocall ('forum postings was empty');
print('<p></p>');
print('<p></p>');
$liX--;
For ($liN=0; $liN<=$liX; $liN++){
$lsFrom = $loReg->fGetNameFromId($laPostings[$liN][1]);
$lsTo = $loReg->fGetNameFromId($laPostings[$liN][2]);
$lsTime = date("F d, Y H:i", $laPostings[$liN][4]);
$lsComment = utf8_decode($laPostings[$liN][5]);
$lsComment = str_replace(chr(202), '\'', $lsComment);
print('<p align="center" class="forumtext">'.
'<span class="forumlabel">'.'From: '.'</span>'.
'<span class="forumval">'.$lsFrom.'</span>'.
'<span class="forumlabel">'.' To: '.'</span>'.
'<span class="forumval">'.$lsTo .'</span>'.
'<span class="forumlabel">'.' Date: '.'</span>'.
'<span class="forumval">'.$lsTime.'</span></p>');
print('<p align="left" class="forumtext">'.' '.$lsComment.'</p>');
}//end-for
}//end-meth fGetPostingsHtml
} //end-class oForum
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?>