Jump to content

Problem passing selected value (Value


Chezshire

Recommended Posts

I've been struggling with this all weekend and I've tried 6 different methods and each method always seems to come to the same result, which is that the value can be selected from the pull down menu, but the value is not being being stored in the database -- So i must be doing something wrong with how i'm handing off the selected value. Below is the current version of code i'm working with trying to get to work:

	<tr>

	<td style="text-align: right"><p>RATING:</p></td>
	<td><select name="rating">
		<option value="1">1</option>
		<option value="2"<?php if ($record["rating"]=="2"){ echo " selected='selected'"; } ?>>2</option>
		<option value="3"<?php if ($record["rating"]=="3"){ echo " selected='selected'"; } ?>>3</option>
		</select>
	</td>

</tr>

 

 

I'm using mySql (4.3) I believe. The table cell is set up as so:

Field: rating	
Type: enum ('1', '2', '3')		
Null: Yes	
Default: NULL	

 

 

I've no idea what I'm doing wrong. I thought this would be really easy, but it's been vexing me all weekend long. I will gladly sacrifice a twinkie on the alter of whatever god can help me resolve this grand annoyance.

Thanks!

Link to comment
Share on other sites

Yes I can, but it's huge (so you know) and ironically, the line where my problem seems to start is #666 <talk about a well number line of code> I'm very new so you know, so I hope this is what you were asking for. I've only been at this a few months and I just do it as a hobby (it's more fun the crosswords I tell myself. Over and over again I tell myself this ;)

 

Thank you for any help!

 

 

 

 

<?php
$restricted="login";
$notifyTest = array();

include ("../functions.php");

$timeoptions=array("Pre-dawn", "Early Morning", "Morning", "Midday", "Early Afternoon", "Afternoon", "Early Evening", "Evening", "Late Night");

approveVars(array("submit", "id", "thread", "continuedfrom", "deletethread"));

$post=array();
$errorText="";

$fields = array("subject", "content", "charid", "summary", "previously", "rating", "thread", "thread2", "action", "notification", "ooc", "featuring", "tags", "timeofday", "location", "oocbox", "gamedate", "userid", "continuedfrom", "storyteller", "approved");
$patterns = array ("/([^\n\r\f])[\n\r\f]+([^\n\r\f])/");
$replace = array ("\\1\n\\2");

FOREACH ($fields as $thisField) {
$post[$thisField] = "";
$THISFIELD = strtoupper($thisField);

if (isset($_POST[$THISFIELD])) { ${$THISFIELD} = trim($_POST[$THISFIELD]);

${$THISFIELD} = preg_replace ($patterns, $replace, ${$THISFIELD});
${$THISFIELD} = preg_replace ("/\\'/", "'", ${$THISFIELD});

if ($THISFIELD == "CONTENT") { ${$THISFIELD} = preg_replace("/<+([Tt]ag[^<>\n]+)>+/","[$1]",${$THISFIELD}); }

if ($THISFIELD != "CONTENT" && $THISFIELD != "SUMMARY" && $THISFIELD != "PREVIOUSLY" && $THISFIELD != "OOC") {
$patterns2 = array ("/<+[^<>\n]+>+/");
$replace2 = array ("");
${$THISFIELD} = preg_replace($patterns2,$replace2,${$THISFIELD});
} // end if stripping tags from non-blob areas.

$older = ${$THISFIELD}; ${$THISFIELD} = preg_replace("/<+[^<>][^<>][^<>]+>+/","",$older);
$older = ${$THISFIELD}; ${$THISFIELD} = preg_replace("/<+\/*[ou]*l[i]*>+/","", $older);

if ($older != ${$THISFIELD}) { $errorText = "You may only use simple HTML tags such as <b>, <i>, <u>, etc, and only in the "Message", "Previously", "Summary" and "OOC" fields. Longer tags have been stripped out of your post. Please check the message and resubmit.\n\n<!-- $older -->\n<!-- " . ${$THISFIELD} . " -->"; }

} else { ${$THISFIELD} = ""; }

} // end foreach

if (!$thread && $THREAD) { $thread=$THREAD; }

// DEFAULT DATE WRANGLING

// THE DEFAULT DATE SHOULD BE September 16, 2004
// the real date for that is Sunday, February 13, 2005

// to get the default date: CURRENT NUMBER OF DAYS

$gamedateFile = "$basefile/gamedate/gamedate.txt";
$tempy = file($gamedateFile);
$gameDate = trim($tempy[0]);
$realDate = trim($tempy[1]);

$sql  = "DATE_FORMAT(NOW(),'%Y%m%d%H%i%s') as currentTime, FROM_DAYS(TO_DAYS('$gameDate') + FLOOR((TO_DAYS(NOW()) - TO_DAYS('$realDate')) /14)) as defaultdate, (TO_DAYS(NOW()) - TO_DAYS('$realDate'))/14 - FLOOR((TO_DAYS(NOW()) - TO_DAYS('$realDate'))/14) as gameremainder";

if (!$id && $thread) {
$sql = "SELECT subject, charid, storyteller, featuring, rating, timeofday, gamedate, location, summary, thread, notification," . $sql  . " FROM board WHERE thread=$thread AND approved!='' ORDER BY dateadded DESC LIMIT 1";
} else if ($id) {
$sql = "SELECT *, " . $sql  . " FROM board WHERE id=$id";
} else {
$sql = "SELECT " . $sql;
} // end if ID and THREAD

// echo "<!-- SQL: $sql -->\n";

$result=mysql_query($sql);
$post = mysql_fetch_assoc($result); 

if (isset($post["thread"])) {
if ($post["thread"]) { $locked=threadLocked($post["thread"]); }
} // end if thread to check for locked-ness

$patterns = array ("/<\/*p>/","/[\r\f\n]+/");
$replace = array ("\n","\n\n");
$post = preg_replace($patterns,$replace,$post);
$currentTime = $post["currentTime"];
$defaultdate = $post["defaultdate"];

$post["defaulttime"] = floor($post["gameremainder"] * 9);

$defaulttime = $timeoptions[$post["defaulttime"]];

// echo "<!-- Game Remainder: $post[gameremainder] -->\n";
// echo "<!-- Default Time: $post[defaulttime] -->\n";
// echo "<!-- Default Time: $defaulttime -->\n";

FOREACH ($fields as $thisField) {
if (isset($post[$thisField])) { ${$thisField} = trim($post[$thisField]); } else { ${$thisField} = "";

// echo "<!-- Line 82 \$thread? $thread -->\n";

if ($thisField != "content" && $thisField != "summary" && $thisField != "previously" && $thisField != "ooc") {
${$thisField} = htmlspecialchars(${$thisField});
} // end if swapping quotes

} // end if set

} // end foreach

if ($submit && ($OOCBOX == "true" || (!$CHARID && !$STORYTELLER))) {
if (!$OOC && $CONTENT) { $OOC = $CONTENT; }
$CONTENT = "";
$CHARID = "";
$TIMEOFDAY = $timeofday;
} // end

if (!$continuedfrom && isset($_REQUEST["continuedfrom"])) { $continuedfrom = $_REQUEST["continuedfrom"]; }

if ($STORYTELLER) {
$CHARID="";
} // end if storyteller

// IF THEY'VE SUBMITTED A POST...

if ($submit) {

echo "<!-- Already approved? " . $post["approved"] . " -->\n";
echo "<!-- APPROVING? " . $APPROVED . " -->\n";
// die;

if ($ACTION == "approved" AND !$post["approved"]) { $modDate = "NOW()"; } else { $modDate = "dateadded"; }

if (!$GAMEDATE) { $GAMEDATE = $defaultdate; }

//realtime - 56 days = gametime;
// NOW() - 732006 / 14 - 56 = Gametime.

if (!$OOCBOX && !$STORYTELLER) {
$CODENAME = getChar($CHARID);
if (!$FEATURING) { $FEATURING = $CODENAME;
} else if (!preg_match("/$CODENAME/", $FEATURING)) { $FEATURING .= ", $CODENAME"; }
} // end if they didn't include themselves in "featuring"

if ($CONTINUEDFROM) {
$continueTest = readDatabase("SELECT thread FROM board WHERE id=$CONTINUEDFROM LIMIT 1");
if ($continueTest["thread"] == $THREAD) { $CONTINUEDFROM=""; }
} // end if continued from

$FEATURING = preg_replace("/, *,/",",",$FEATURING);
$FEATURING = preg_replace("/^,/","",$FEATURING);
$FEATURING = preg_replace("/,$/","",$FEATURING);

if ($THREAD2 && $THREAD2 != $THREAD) { $THREAD = $THREAD2; }

if (!$id) {
$sql = "INSERT INTO board (userid,
charid,
storyteller,
subject,
previously,
rating,
content,
summary,
dateadded, lastmodified,
ooc,
featuring,
tags,
timeofday,
location,
thread,
gamedate,
continuedfrom,
notification,
approved) VALUES (\"$login\",
\"$CHARID\",
\"$STORYTELLER\",
\"$SUBJECT\",
\"$PREVIOUSLY\",
\"$RATING\",
\"$CONTENT\",
\"$SUMMARY\",
NOW(),
NOW(),
\"$OOC\",
\"$FEATURING\",
\"$TAGS\",
\"$TIMEOFDAY\",
\"$LOCATION\",
\"$THREAD\",
\"$GAMEDATE\",
\"$CONTINUEDFROM\",
\"$NOTIFICATION\",
\"$ACTION\")";
} else {
if (!$THREAD) { $THREAD = $id; }
$sql = "UPDATE board SET charid=\"$CHARID\", 
storyteller=\"$STORYTELLER\",
thread=\"$THREAD\", 
subject=\"$SUBJECT\",
previously=\"$PREVIOUSLY\",
rating=\"$RATING\",
summary=\"$SUMMARY\", 
content=\"$CONTENT\",
ooc=\"$OOC\",
featuring=\"$FEATURING\",
tags=\"$TAGS\",
timeofday=\"$TIMEOFDAY\", 
location=\"$LOCATION\",
gamedate=\"$GAMEDATE\",
continuedfrom=\"$CONTINUEDFROM\", 
notification=\"$NOTIFICATION\", 
approved=\"$ACTION\",
dateadded=$modDate WHERE id=$id";
} // end if ID

if (!$SUBJECT) { $errorText="You have not entered a Subject line for this message. Please submit the form again after making changes."; }

// echo "<!-- CONTINUEDFROM: $CONTINUEDFROM -->\n";

if ($CONTINUEDFROM) {
if (threadLocked($CONTINUEDFROM)) { $errorText= "You cannot branch off from that thread, because it is locked."; }
} // end if CONTINUEDFROM

if (!$OOCBOX) {
if (!$CONTENT) { $errorText = "You cannot submit an empty message. Please submit the form again after making changes."; }
if ($CHARID=='---') { $errorText = "You must choose a main character from the list. Please submit the form again after making changes."; }
if (!$FEATURING && $CHARID) { $errorText = "You must specify the characters this post features. Please submit the form again after making changes."; }
} else {
if (!$OOC) { $errorText = "You cannot submit an empty message. Please submit the form again after making changes."; }
} // end if not OOC-only

if ($ACTION == "delete") { $sql = "DELETE from board WHERE id=$id"; $errorText=""; $jumpto="/messages.php"; }
if ($ACTION == "deletethread") { $sql = "DELETE from board WHERE thread=$id OR id=$id"; $errorText=""; $jumpto="/messages.php"; }

if (!$errorText) {

if ($id) {
if ($ACTION=="locked") { $lockThread = mysql_query("UPDATE board set approved='locked' WHERE id=$THREAD LIMIT 1"); $ACTION = "approved"; }
// echo "<!-- LOCKED:  UPDATE board set approved='locked' WHERE id=$THREAD LIMIT 1  -->\n";
if ($ACTION=="approved") { $lockThread = mysql_query("UPDATE board set approved='approved' WHERE id=$THREAD LIMIT 1"); $ACTION = "approved"; }
// echo "<!-- UNLOCKED:  UPDATE board set approved='approved' WHERE id=$THREAD LIMIT 1 -->\n";
} // end if id

$result = mysql_query($sql);

if (mysql_errno()) { errorPage("MYSQL Error #" . mysql_errno() . " when updating Cerebra: <b>" . mysql_error() . "</b>. Please check with the system administrator and inform her/him of the error.<br><br><span class='fineprint'>$sql</span>"); die; }

$notifyThis='';
if (!$id) { $notifyThis='true'; $id = mysql_insert_id(); }
if (!$THREAD) { $sql = "UPDATE board SET thread=$id WHERE id=\"$id\""; $result2 = mysql_query($sql); $THREAD=$id; }

if ($notifyThis) { notify($THREAD); }

if ($ACTION != "delete" && $ACTION != "deletethread") { $jumpto = "/messages/display.php?id=$id"; }

header ("Location: $jumpto");
die;

} // end if no error text

} // end if SUBMITTED

echo "<!-- Main SQL: $sql -->\n\n";

echo "<!-- ID: $id -->\n";
echo "<!-- Thread: $thread -->\n";
echo "<!-- Login: $login -->\n";

if ($errorText) {
FOREACH ($fields as $thisField) {
$THISFIELD = strtoupper($thisField);
if ((!preg_match("/which character/",$errorText) && $thisField=="charid") || $thisField != "charid" ) { ${$thisField} = ${$THISFIELD}; }
} // end foreach
} // end if error text

FOREACH ($fields as $thisField) {
if ($thisField != "content" && $thisField != "summary" && $thisField != "previously" && $thisField != "ooc") {
${$thisField} = preg_replace("/\"/",""",${$thisField});
} // end if swapping quotes
} // end foreach

// IF THEY HAVEN'T SUBMITTED, SHOW 'EM THE FORM!

echo "<!-- 190 - Thread: $thread -->\n\n";

$bodyScript = "onLoad = \"setButtonText()\"";
include ("../header.php");
// include ("/Library/WebServer/Documents/sphpell/spellcheckpageinc.php");

echo "<!-- 195 - Thread: $thread -->\n\n";
?>

<SCRIPT language="javascript">

function makeOOC(force) {

if (force=='force') { window.document.postMessage.OOCBOX.checked = true; }

if (window.document.postMessage.OOCBOX.checked == true) {
if (!window.document.postMessage.OOC.value && window.document.postMessage.CONTENT.value != '== DISABLED ==') { window.document.postMessage.OOC.value = window.document.postMessage.CONTENT.value; }

window.document.postMessage.CHARID.disabled = true;
window.document.postMessage.RATING.disabled = true;
window.document.postMessage.FEATURING.readonly = true;
window.document.postMessage.TIMEOFDAY.disabled = true;
window.document.postMessage.GAMEDATE.readonly = true;
window.document.postMessage.LOCATION.readonly = true;
window.document.postMessage.CONTENT.readonly = true;

window.document.postMessage.CONTENT.value = "== DISABLED ==";

window.document.postMessage.CONTENT.style.color = String ('#333333');

window.document.postMessage.CONTENT.style.background = String ('#888888');
window.document.postMessage.FEATURING.style.background = String ('#888888');
window.document.postMessage.LOCATION.style.background = String ('#888888');
window.document.postMessage.GAMEDATE.style.background = String ('#888888');

window.document.postMessage.OOC.focus();
} else { 
window.document.postMessage.CHARID.disabled = false;
window.document.postMessage.FEATURING.readonly = false;
window.document.postMessage.TIMEOFDAY.disabled = false;
window.document.postMessage.GAMEDATE.readonly = false;
window.document.postMessage.LOCATION.readonly = false;
window.document.postMessage.CONTENT.readonly = false;

window.document.postMessage.CONTENT.value = window.document.postMessage.OOC.value;

window.document.postMessage.OOC.value = "";

window.document.postMessage.CONTENT.style.color = String ('#000000');

window.document.postMessage.CONTENT.style.background = String ('#FFFFFF');
window.document.postMessage.FEATURING.style.background = String ('#FFFFFF');
window.document.postMessage.LOCATION.style.background = String ('#FFFFFF');
window.document.postMessage.GAMEDATE.style.background = String ('#FFFFFF');

window.document.postMessage.CONTENT.focus();
}

}

function postWarning() {

var postCheck = false;

<?php

if (!$id) {

$threadCheck = mysql_query("SELECT thread from board WHERE userid=$login AND UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 2 HOUR)) <= UNIX_TIMESTAMP(dateadded) GROUP BY thread");

// it's within a day and within 2 hours.

WHILE ($checker = mysql_fetch_assoc($threadCheck)) {
echo "if (window.document.postMessage.THREAD.value == " . $checker["thread"] . ") {\n";
echo "postCheck = true;\n";
echo "}\n";
} // end WHILE

} // end if ID
?>

if (postCheck==true) {
window.document.postMessage.submit.value = 'Submit ANYWAY';
alert("You have posted to the selected thread within the past four hours. Only submit this new post if you're sure you've given tagged players time to respond.");
window.document.getElementById('threadCheck').innerHTML="<font color='red'>You have posted to this thread in the last four hours.</font>";
} else {
window.document.postMessage.submit.value = 'Submit';
window.document.getElementById('threadCheck').innerHTML="Click to continue...";
}

}


function setButtonText() {
if (window.document.postMessage.action3.checked == true) { window.document.postMessage.submit.value = 'DELETE Post';
} else if (window.document.postMessage.action4.checked == true) { window.document.postMessage.submit.value = 'DELETE ENTIRE THREAD';
  } else { window.document.postMessage.submit.value = '<?php
if ($id) { $buttonText = "Edit Post"; } else { $buttonText = "Add Post"; }
echo $buttonText; ?>';
}

}

</SCRIPT>


<SCRIPT language="javascript">
//  Live Word Count Script - added May 2nd -->


function wordCounter(field, countfield, maxlimit) {
wordcounter=0;
for (x=0;x<field.value.length;x++) {
      if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {wordcounter++}  // Counts the spaces while ignoring double spaces, usually one in between each word.
      if (wordcounter > 9999) {field.value = field.value.substring(0, x);}
      else {countfield.value = maxlimit - wordcounter;}
      }
   }

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
  }
//  End -->
</script>


<table border="0" cellpadding="6" cellspacing="0" width="95%">
<form name="postMessage" action="/messages/post.php" method="post" enctype="multipart/form-data">
<tr><td colspan="2">
<center>
<h1><font color="#A5B9D5">

<?php					
if (!$id) { echo "Post New Message"; } else { echo "Edit Message"; }
?>

</font></h1>
<p>Please allow at least 2 hours for tagged players to respond to your posts before posting to the same thread again. 

<?php
if ($thread) { echo "<a href=\"javascript:openimage('thread.php?hideHeaders=true&thread=$thread',400,500,1)\"
>Review this thread in a new window.</a>"; }

echo "</p></center>\n";

if ($errorText) { echo "<p><font color='red'>$errorText</font> <a href='/messages.php'>Click here to cancel and return to the Messages area.</a></p>\n"; }					
?>
</td>
</tr>


<tr>
<td colspan="2" valign="middle" height="20" align="center">
<hr color="#050F1D" size="5">
</td>
</tr>

<tr>
<td align="right"><p><b>POST AS:</b></p></td>
<td>

<?php
if (!$moderator && $storyteller) {
echo "<p>$storyteller<input type='hidden' name='STORYTELLER' value=\"" . htmlspecialchars($storyteller) . "\"></p>";
} else {

echo "<select name=\"CHARID\">\n";

echo "<option value=''> -- Select character -- </option>\n";

if (!$id) { $charid = 0; }

echo "<!-- 243 - Thread: $thread -->\n\n";
$selecty = false;

$sql = "SELECT id,codename,name,player from cerebra WHERE player=$login AND approved='true' ORDER BY codename";
$charResult = mysql_query($sql);

echo "\n\n<!-- FIND CHARS: $sql -->\n\n";

$usedCharacters = array() ;

if (mysql_num_rows($charResult)) {

echo "<optgroup label='My Characters'>\n";

WHILE ($character = mysql_fetch_assoc($charResult)) {
echo "<option value='" . $character["id"] . "'";

if ($character["id"] == $charid || (!$charid && $pref["primarychar"] == $character["id"] && !$storyteller)) { echo " selected"; $selecty = true; }

$usedCharacters[] = $character["id"];
echo ">";

echo strtoupper($character["codename"]);
if ($character["name"]) { echo " (" . $character["name"] . ")"; }
echo "</option>\n";
} // end WHILE

echo "</optgroup>\n";
} // end if any characters to post as


// recently used characters

$char_criteria="";
if (count($usedCharacters)) { $char_criteria = "AND (charid !=" . implode(") AND (charid!=", $usedCharacters) . ")"; }

$sql = "SELECT charid, cerebra.id, codename, cerebra.name FROM board LEFT JOIN cerebra ON cerebra.id = charid WHERE TO_DAYS(NOW()) - TO_DAYS(dateadded) < 14 AND charid > 0 $char_criteria AND board.userid=$login GROUP BY charid ORDER BY codename";
$charResult = mysql_query($sql);

if (mysql_num_rows($charResult)) {

echo "<optgroup label='Recent Characters'>\n";

WHILE ($character = mysql_fetch_assoc($charResult)) {

if (!in_array($character["id"], $usedCharacters)) {

echo "<option value='" . $character["id"] . "'";

if ($character["id"] == $charid || (!$charid && $pref["primarychar"] == $character["id"] && !$storyteller)) { echo " selected"; $selecty = true; }

echo ">";

echo strtoupper($character["codename"]);
if ($character["name"]) { echo " (" . $character["name"] . ")"; }
echo "</option>\n";
} // end if not already placed
} // end WHILE

echo "</optgroup>\n";
} // end if any characters to post as


$sql = "SELECT id,npc,codename,name,player from cerebra WHERE (npc=$login OR npc='general' OR npc='modonly') AND approved='true' ORDER BY codename";
$charResult = mysql_query($sql);

echo "\n\n<!-- FIND NPCs: $sql -->\n\n";

if (mysql_num_rows($charResult)) {

echo "<optgroup label='NPCs'>\n";

WHILE ($character = mysql_fetch_assoc($charResult)) {
if ($character["npc"] != "modonly" || $moderator) {
echo "<option value='" . $character["id"] . "'";
if ($character["id"] == $charid) { echo " selected"; $selecty=true; }
echo ">";

echo strtoupper($character["codename"]);
if ($character["name"]) { echo " (" . $character["name"] . ")"; }
echo "</option>\n";
} // end if modonly
} // end WHILE

echo "</optgroup>\n";

} // end if num rows

echo "<!-- 365 - Thread: $thread -->\n\n";

if ($moderator) { 
echo "<optgroup label='PCs'>\n";

$sql = "SELECT id,codename,name,player from cerebra WHERE approved='true' AND npc = '' OR npc IS NULL ORDER BY codename";
$charResult = mysql_query($sql);

WHILE ($character = mysql_fetch_assoc($charResult)) {
echo "<option value='" . $character["id"] . "'";

if ($character["id"] == $charid) { echo " selected"; $selecty=true; }

echo ">";

echo strtoupper($character["codename"]);
if ($character["name"]) { echo " (" . $character["name"] . ")"; }
echo "</option>\n";
} // end WHILE

echo "</optgroup>\n";

} // end if moderator

if (!$selecty && $charid) {

echo "<optgroup label='Current Selection'>\n";
echo "<option value='$charid' selected>" . strtoupper(htmlspecialchars(getChar($charid)));
if (getRealName($charid) != "(Unrevealed)") { echo " (" . htmlspecialchars(getRealName($charid)) . ")"; }
echo "</option>\n";
echo "</optgroup>\n";

} // end if not already listed

echo "</select>";

} // end if not moderator and it's a storyteller post

echo "</td></tr>\n\n";



if ($moderator) {

?><tr>
<td valign="top" align="right"><p><b>...or, enter here:</b><br>
<span class='fineprint'>specify character posting here if not found in above pulldown.</span></p></td>
<td valign="top"><input type="text" name="STORYTELLER" size="80" value="<?php
if  ($id) { echo $storyteller; } ?>"></td>
</tr>

<?php
} // end if moderator

?>

<tr>
<td valign="top" align="right"><p><b>THREAD:</b></p></td>
<td valign="top"><select name="THREAD" onChange="postWarning();">
<option value="">-- New Thread --</option>

<?php
$currDate = "";

echo "<!-- 407 - Thread: $thread -->\n\n";

$sql = "SELECT id,thread,subject,DATE_FORMAT(MAX(dateadded), \"%c/%e/%y\") as dateformat, MAX(dateadded) as dateaddedm, MAX(approved) as locked from board GROUP BY thread HAVING locked <> \"locked\" ORDER BY dateaddedm DESC LIMIT 50";
$threadResult = mysql_query($sql);
$threadArray = array();

echo "\n\n<!-- THREAD: $THREAD -->\n";
echo "\n\n<!-- thread: $thread -->\n";

echo "\n\n<!-- FIND THREADS: $sql -->\n\n";

$alreadyDone = "";
WHILE ($threadArray = mysql_fetch_assoc($threadResult)) {
if ($threadArray["dateformat"] != $currDate) {
$currDate = $threadArray["dateformat"];
if ($currDate) { echo "</optgroup>\n"; }
echo "<optgroup label='$currDate'>";
} // end if not the same date

echo "<option value=\"" . $threadArray["thread"] . "\"";
if ($threadArray["thread"] == $thread) { echo " selected"; $alreadyDone = "true"; }
echo ">";
$newText = shortenText(getThreadName($threadArray["thread"]),32);
if ($newText != getThreadName($threadArray["thread"])) { $newText = $newText . "&#8230;"; }
echo "$newText</option>\n";
} // end WHILE

if (mysql_errno()) { echo mysql_errno().": (THREAD) error: " . mysql_error(); }


if ($thread && !$alreadyDone ) {

$sql = "SELECT id,thread,subject,DATE_FORMAT(MAX(dateadded), \"%c/%e/%y\") as dateformat, MAX(dateadded) as dateaddedm from board WHERE thread=$thread GROUP BY thread";

$threadResult = mysql_query($sql);
WHILE ($threadArray = mysql_fetch_assoc($threadResult)) {
$currDate = $threadArray["dateformat"];
echo "<optgroup label='$currDate'>";
echo "<option value='$thread' SELECTED>";
$newText = shortenText(getThreadName($thread),32);
if ($newText != getThreadName($thread)) { $newText = $newText . "&#8230;"; }
echo $newText . "</option>\n";
} // end WHILE
} // end if thread
?>
</select>

		<?php
		if ($moderator) { echo "<br><p>Manual thread entry: <input name='THREAD2' value='$thread'></p>"; }
		?>
	</td>

</tr>
<tr>

	<td valign="top" align="right"><p><b>SUBJECT:</b></p></td>
	<td valign="top"><input type="text" name="SUBJECT" size="80" value="<?php echo $subject; ?>"></td>

</tr>
<tr>

	<td style="text-align: right"><p>RATING:</p></td>
	<td><select name="rating">
		<option value="1">1</option>
		<option value="2"<?php if ($record["rating"]=="2"){ echo " selected='selected'"; } ?>>2</option>
		<option value="3"<?php if ($record["rating"]=="3"){ echo " selected='selected'"; } ?>>3</option>
		</select>
	</td>

</tr>
<tr>

	<td align="right" valign="top"><p><b>OOC?</b></p></td>
	<td><p><input type="checkbox" value="true" id="OOCBOX" name="OOCBOX" onClick="makeOOC()"><label for="OOCBOX" name="OOCBoxlabel"> OOC-only post. Some fields will be disabled.</label></p></td>

</tr>
<tr>

	<td align="right" valign="top"><p><b>FEATURING:</b><br>
	<span class='fineprint'>Codenames of characters in this post.</span></p></td>
	<td valign="top"><input type="text" name="FEATURING" size="80" value="<?php echo $featuring; ?>"></td>
</tr>
<tr>
<td align="right" valign="top"><p><b>TIME OF DAY:</b></p></td>
<td valign="top"><select name="TIMEOFDAY">

<?php
echo "<!-- Time of Day: '$timeofday' -->\n";
FOREACH ($timeoptions as $thisone) {
echo "<option value='$thisone'";
if ($thisone == $timeofday || (!$timeofday && $thisone == $defaulttime)) { echo " selected"; }
echo ">$thisone</option>\n";
} // end FOREACH
?>
</select></td>
</tr>

<tr>
<td align="right" valign="top"><p><b>GAME DATE:</b><br>
<span class='fineprint'><i>YYYY-MM-DD</i></span></p></td>
<td valign="top"><input type="text" name="GAMEDATE" size="12" value="<?php
if ($gamedate) { echo $gamedate; } else { echo $defaultdate; } ?>"></td>
</tr>

<tr>
<td align="right" valign="top"><p><b>LOCATION:</b></p></td>
<td valign="top"><input type="text" name="LOCATION" size="80" value="<?php echo $location; ?>"></td>
</tr>

<tr><td colspan="2"><hr color="#050F1D" size="5"></td></tr>

<tr>
<td valign="top" align="right"><p><b>Continued from...</b><br>
<span class='fineprint'>If this message continues from a message in another thread, enter its unique id number here. Check that it's the right one by clicking "Check".</p></td>
<td valign="top"><p><nobr>#<INPUT name="CONTINUEDFROM" size=25 value="<?php echo $continuedfrom; ?>"> <input type="submit" name="linkCheck" value="Check" onclick="javascript: if (window.document.postMessage.CONTINUEDFROM.value > 0) { openimage('/messages/display.php?hideHeaders=true&id=' + window.document.postMessage.CONTINUEDFROM.value,400,500,true); } return false;"></nobr></p></td>
</tr>

<tr>
<td align="right" valign="top"><p><b>PREVIOUSILY:</b></p></td>
<td><textarea name=PREVIOUSLY rows=3 cols=80 wrap=virtual><?php

if (!$id && $thread) { echo $summary; } else { echo $previously; } ?></textarea></td>
</tr>


<tr>
<td align="right" valign="top">
<p><b>MESSAGE:</b><br>
<span class='fineprint'>Before posting, please read and spellcheck your post first. If you mention someone please add them to your tags.</span>
<td><textarea name=CONTENT rows=22 cols=80 wrap=virtual 
onKeyDown="wordCounter(this.form.Q3367,this.form.remLen,200);" 
onKeyUp="wordCounter(this.form.CONTENT,this.form.remLen,200);">
<?php echo $content;
?></textarea>
<br><span class='fineprint'>Words remaining: 
<input type='text' readonly name='remLen' size='5' value='200'></span><br>
<INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1></td></tr>
</textarea></td>
</tr>

<tr>
<td align="right" valign="top"><p><b>SUMMARY:</b></p></td>
<td><textarea name=SUMMARY rows=3 cols=80 wrap=virtual>
<?php
if ($id) { echo $summary; } 
?>
</textarea></td>
</tr>

<tr><td colspan="2"><hr color="#050F1D" size="5"></td></tr>

<tr>
<td align="right" valign="top"><p><b>OOC:</b></p></td>
<td><textarea name=OOC rows=6 cols=80 wrap=virtual style="color:000000"><?php echo stripslashes($ooc); ?></textarea></td>
</tr>

<tr>
<td align="right" valign="top"><p><b>TAGS:</b></p></td>
<td><input type="text" name="TAGS" size="82" value="<?php echo $tags; ?>"></td>
</tr>

<tr><td colspan="2"><hr color="#050F1D" size="5"></td></tr>

<tr>
<td align="right" valign="top"><a name='status'></a>
<p><b>Options:</b></p></td>
<td><p>

<?php
if ($moderator && $id) {
echo "<!-- APPROVED? $approved -->\n";
echo "<input type='radio' value='' id='action0' name='ACTION' onClick='setButtonText()'";
if ($approved == "") { echo " checked "; }
echo "><label for='action0' name='action0label'> Not Approved</label><br>\n";

echo "<input type='radio' name='ACTION' name='action1' value='approved'";
if (!$deletethread && $approved == "approved") { echo " checked "; }
echo "id='action1' onClick='setButtonText()'><label for='action1'> Approved for posting</label><br>\n";

echo "<input type='radio' value='locked' id='action2' name='ACTION' onClick='setButtonText()'";
if ($locked && !$deletethread) { echo " checked"; }
echo "><label for='action2'> Lock Thread</label><br>\n";

echo "<input type='radio' value='delete' id='action3' name='ACTION' onClick='setButtonText()'><label for='action3'> REMOVE MESSAGE</label><br>\n";

echo "<input type='radio' value='deletethread' id='action4' name='ACTION' onClick='setButtonText()'";
if ($deletethread) { echo " checked"; }
echo "><label for='action4'> <font color='red'><b>REMOVE THREAD</b></font></label><br>\n";
echo "</p>\n<p>";

} else if ($moderator) {

echo "<input type='checkbox' name='ACTION' name='action1' value='approved' checked id='action1' onClick='setButtonText()'><label for='action1'> Approved for posting</label><br>\n";
echo "</p>\n<p>";

} else if (!$moderator) {

$tempy = readDatabase("SELECT moderated from login WHERE id=$login");
if (!$tempy["moderated"] && !$id) { $approved="approved"; }
echo "<input type='hidden' name='ACTION' value='$approved'>";

} // end if moderator

echo "<input type=hidden name=id value=$id>\n"; 


$notifyTest["notification"] = "";
$notifyCheck = "";

if ($id) {
$notifySQL = "SELECT notification from board WHERE (userid=$login AND thread=$thread) OR id=$id ORDER BY dateadded DESC LIMIT 1";
echo "<!-- Notify with ID: $notifySQL -->\n";
$notifyTest = readDatabase($notifySQL);
} else if ($thread) {
$notifySQL = "SELECT notification from board WHERE (userid=$login AND thread=$thread) ORDER BY dateadded DESC LIMIT 1";
echo "<!-- Notify with thread: $notifySQL -->\n";
$notifyTest = readDatabase($notifySQL);
} // end if id

if ($notifyTest["notification"]) { $notifyCheck = " checked"; }

echo "<!-- NOTIFY SET? " . $notifyTest["notification"] . " -->\n";
?><input type="checkbox" name="NOTIFICATION" value="true"<?php echo $notifyCheck; ?> id="notifycheck"><label for="notifycheck"> Notify me when this thread is updated</label><?php
?></p></td>
</tr>

<tr>
<td align="right"><p><span id="threadCheck" class="fineprint">Click to post.</span></td>
<td><p><input type=submit name=submit value="<?php echo $buttonText; ?>" style="background-color:#022755;color:#FFFFFF;"></form></td>
</tr>
</table>

<?php

if (($id && !$charid) || checkOOC($thread)) {
echo "<!-- WE'RE FORCING OOC FOR SOME REASON. -->\n";
echo "<!-- ID: $id      THREAD: $thread -->\n";
echo "<SCRIPT LANGUAGE=\"javascript\">\n";
if ((!$charid && !$storyteller) || checkOOC($thread)) { echo "makeOOC('force');\n"; } else { echo "postWarning();\n"; }
echo "</SCRIPT>\n\n";
} // end if thread

include("../countdownUniversal.php");
include("../footer.php"); ?>

 

 

 

Link to comment
Share on other sites

Hi

 

Would that be in this? This is the Thread PHP which handles the Posts PHP (i'm working on something which another person began -- so i'm learning as I go and I have very little idea of how PHP, Java, etc work at this point. But I'm now googling out about insert queries to understand what your saying (thanks)

 

 

 

<?php
include ("../functions.php");

approveVars(array("thread", "page", "hideHeaders"));

$start=0;
$limit = $pref["postsperpage"];
if (!$limit) { $limit = 25; }
if ($limit == "All") { $limit = "9999999"; }

if (!$thread) { errorPage("That thread does not exist! Please check the link you used to arrive at this page and try again."); die; }

$locked = threadLocked($thread);

$threadCount = mysql_query("SELECT id FROM board WHERE thread=$thread AND approved <> '' AND approved IS NOT NULL"); 
$total = mysql_num_rows($threadCount);
$totalPages = ceil($total/$limit);

$order="";
$mostrecentfirst = "";
if ($pref["mostrecentfirst"]) { $mostrecentfirst = "true"; $order=" DESC";  }

if (!$page) { $page=1; }
if ($page>1) { $start = ($page-1)*$limit; }

$allChars = array();

function threadNav() {
global $totalPages;
global $total;
global $page;
global $thread;
global $limit;
global $mostrecentfirst;
global $hideHeaders;
global $allChars;

if (!isset($hideHeaders)) { $hideHeaders=""; }

for ($x=0; $x < $totalPages; $x++) {

echo "<!-- 42: x is $x -->\n";

if (!$mostrecentfirst) {
if ($x == 0) { $start=1; } else { $start = $x*$limit; }
$ender = $start+$limit-1;
if ($ender > $total) { $ender = $total; }
} else {
if ($x == 0) { $start=$total; } else { $start = $total-$x*$limit; }
$ender = $start-$limit+1;
if ($ender < 1) { $ender = 1; }
} // end if most recent

echo "<!-- 54: i is $x -->\n";

$cleanPage = $x+1;
if ($page == $cleanPage) { echo "<b>$cleanPage</b>"; } else { echo "<a href='thread.php?";
if ($hideHeaders) { echo "hideHeaders=$hideHeaders&"; }
echo "thread=$thread&page=$cleanPage' title='Read messages $start to $ender' class='nobold'>$cleanPage</a>"; }
if ($cleanPage < $totalPages) { echo " | "; }
} // end FOR

echo "<!-- 63: i is $x -->\n";

} // end function

$sql = "SELECT *, DATE_FORMAT(gamedate,'%b %e, %Y') AS gamedate FROM board WHERE thread=$thread AND approved <> '' AND approved IS NOT NULL ORDER BY dateadded$order LIMIT $start,$limit"; 

$result=mysql_query($sql);

// this sets the "last viewed" time of this page to now, for the reader
// they will get notifications of posts after this time
reinstateNotification($thread);

$result2=mysql_query("SELECT charid FROM board WHERE thread=$thread AND id=$thread");
$testOOC = mysql_fetch_assoc($result2);

$pageTitle = "Messages » " . getThreadName($thread);
include ("../header.php");

echo "<a name='top'></a>\n";
echo "<!-- SQL: $sql -->\n";
echo "<!-- OOCCHECK: " . $testOOC["charid"] . " -->\n\n";


if ($pref["mostrecentfirst"]) { $i=$total-$start; } else { $i=$start+1; }
if ($pref["mostrecentfirst"]) { $bottom = $i-$limit+1; } else { $bottom = $i+$limit -1; }

echo "<!-- 90: i is $i -->\n";

if ($bottom > $total) { $bottom = $total; }
if ($bottom < 1) { $bottom = 1; }

$first = $i;

echo "<table width='100%' cellpadding='6'><tr><td colspan='2'>";
echo "<h1>";

if (checkOOC($thread)) {
echo "<font color=\"#00CC99\">";
} else {
echo "<font color='#A5B9D5'>";
} // end if

$thread_data = getPost($thread);

echo $thread_data["subject"];

if (checkOOC($thread)) { echo " [OOC]"; }

echo "</font></h1>\n";

$thread_details = array();

if ($charid || $storyteller) {
$thread_details["Where"] = $thread_data["location"];
$thread_details["When"] = $thread_data["timeofday"] . ", " . $thread_data["gamedate"];
} // end if

$tempy="";
FOREACH ($thread_details as $key=>$value) {
if (!$tempy) { echo "<p>"; $tempy="true"; } else { echo "<br/>\n"; }
echo "<font color='#A5B9D5'><b>$key:</b> $value";
} // end FOREACH
echo "</p>\n";


echo "<p>";

if ((!$locked || $moderator) && !$hideHeaders) {
echo "<a href='/messages/post.php?thread=$thread' title='Make a post to this thread'>[Add Post&#8230;]</a> | ";
} // end if locked

?><a href="#<?php echo $bottom; ?>" title="Go to the last message on this page">[Go to bottom]</a><?php
if (!$hideHeaders) { echo " | <a href=\"printable.php?thread=$thread\" target=\"_blank\" title=\"Get a printable version of this thread\"><img src=\"/images/printable.gif\" border=\"0\" width=\"16\" height=\"16\" alt=\"print\" align=\"absmiddle\"></a>"; }

if ($locked) { echo " | <img src='/images/locked.gif' width='13' height='13' align='absmiddle' title='This thread is locked.' border='0'>"; }

if ($totalPages > 1) {
echo "<font color='#A5B9D5'> | <b>Page: </b>[ ";

threadNav();

echo " ]</font>";

} // end if pages

echo "</p>\n";

$fields = array("id","subject","content","charid","summary","previously","delete","notification","ooc","featuring","tags","timeofday","gamedate", "userid","location","storyteller","continuedfrom");

echo "</td></tr>\n\n";


WHILE ($post = mysql_fetch_assoc($result)) {

$patterns = array ("/\"/","/[\r\f\n]+/","/ *\.\.\.+ */","/<p><hr \/><\/p>/","/<hr \/>/");
$replace = array (""","</p>\n<p>", "&#8230; ","<hr />","</p>\n<hr />\n<p>");

FOREACH ($fields as $thisField) {
if (isset($post[$thisField])) {
${$thisField} = $post[$thisField];
${$thisField} = preg_replace($patterns,$replace,${$thisField});
} else { ${$thisField} = ""; }
} // end foreach

$patterns = array ("/\"/","/[\r\f\n]+/");
$replace = array (""","</p>\n<p>");
${$thisField} = preg_replace($patterns,$replace,${$thisField});

echo "<tr><td colspan='5' style='padding: 0px'><hr color='#050F1D' /></td></tr>\n\n";

echo "<tr><td width='60%' valign='top'>";

if (!$pref["litegraphics"]) {

if ($charid && !$storyteller) {
$thumbFile = "$basefile/cerebra/images/" . $post["charid"] . "-.jpg";
$mainFile = "$basefile/cerebra/images/" . $post["charid"] . ".jpg";

if (file_exists($thumbFile)) {
$size = getimagesize($thumbFile);
echo "<a href='/cerebra/display.php?id=" . $post["charid"] . "' title='Get info on the character: $characterName'>";
echo "<img src=\"/cerebra/images/" . $post["charid"] . "-.jpg\" width=\"60\" height=\"75\" align=\"right\" hspace=\"12\" vspace=\"12\" border=\"0\"></a>";
} else if (file_exists($mainFile)) {
$size = getimagesize($mainFile);
$height = 60 * $size[1] / $size[0];
echo "<a href='/cerebra/display.php?id=" . $post["charid"] . "' title='Get info on the character: $characterName'>";
echo "<img src=\"/resizer.php?img=cerebra/images/" . $post["charid"] . ".jpg&width=60\" height=\"$height\" width=\"60\" align=\"right\" hspace=\"12\" vspace=\"12\" border=\"0\"></a>";
} // end image search

} // end if $charid

if ($storyteller) {
echo "<img src=\"/images/circle-x.jpg\" height=\"75\" width=\"60\" align=\"right\" hspace=\"12\" vspace=\"12\">";
} // end if storyteller

} // end if no "lite" graphics

echo "<a name='$i'></a>\n";




if ($charid || $storyteller) {

echo "<p>";

$content = preg_replace("/\[([Tt]ag[^\]\[]+)\]/","<font color='#A5B9D5'>[$1]</font>",trim($content));
$content = hrefCheck($content);

$characterName = getChar($post["charid"]);
if ($characterName == "Storyteller" && $charid) { $storyteller = "Storyteller"; }

if (!$storyteller) {
echo "<a href='/cerebra/display.php?id=$charid' title='Get info on the character: $characterName'>$characterName:</a> ";

} else {
echo "<font color=\"#A5B9D5\"><b>$storyteller</b></font>: ";
} // end if storyteller

echo stripslashes($content) . "</p>\n";

} else {
$thisPlayer=getName($userid);
$ooc = hrefCheck($ooc);

echo "<p><a href='/profile.php?id=$userid' title='Get info on the player: $thisPlayer'><font color=\"#00CC99\">$thisPlayer</font></a>: " . $ooc . "</p>\n";

if ($summary || $tags) {

if (!$charid && !$storyteller) {
echo "<p><font color=\"#00CC99\">";
} else {
echo "<p><font color=\"#A5B9D5\">";
} // end if not an OOC post

if ($summary) {
echo "<b>Summary:</b> $summary<br>\n";
} // end if Summary

if ($tags) {
echo "<b>Tags:</b> $tags<br>\n";
} // end if Summary

echo "</font></p>\n";
} // end if additional things

} // end if OOC only

$testy = mysql_query("SELECT id,subject from board WHERE continuedfrom = $id ORDER BY dateadded DESC");

if (mysql_num_rows($testy)) {

$continuedin=array();

WHILE ($thisMsg = mysql_fetch_assoc($testy)) {

$msgLink = "<a href=\"/messages/display.php?id=" . $thisMsg["id"];
if ($hideHeaders) { $msgLink .= "&hideHeaders=$hideHeaders"; }
$msgLink .= "\" title='Read this "spin-off" message'>" . $thisMsg["subject"] . "</a>";

array_push($continuedin, $msgLink);
} // end WHILE

$continuedString = implode(", ", $continuedin);
if (count($continuedin) > 1) { $texty = "messages"; } else { $texty="message"; }
echo "<p><font color=\"#A5B9D5\"><b>Continues in $texty:</b></font> $continuedString<br>\n";

} // end if spin-offs

echo "</td><td width='40%' valign='top'><p class='fineprint'><a href='/messages/display.php?";
if ($hideHeaders) { echo "hideHeaders=$hideHeaders&"; }
echo "id=$id' title='View this message by itself'>";

if (!$charid && !$storyteller) { echo "<font color=\"#00CC99\">[OOC] "; }
echo "Message $i of $total.";
if (!$charid && !$storyteller) { echo "</font>"; }

echo "</a> <font color='#666666'>[#$id]</font></p>\n";


if ($moderator || (($login == $userid) && $userid)) { echo "<p><a href=\"/messages/post.php?id=$id\" title='Make changes to this message'><img src=\"/images/edit.gif\" height=\"13\" width=\"37\" border=\"0\"></a></p>"; }

if ($continuedfrom) {
echo "<p><span class='fineprint'><font color='#A5B9D5'><b>Continued from:</b></font> <a href='/messages/display.php?";
if ($hideHeaders) { echo "hideHeaders=$hideHeaders&"; }
echo "id=$continuedfrom' title='Read this message'>" . getSubject($continuedfrom) . "</a></span></p>";
} // end if continued

if ($summary) { echo "<p><span class='fineprint'><b>Summary:</b> " . stripslashes($summary) . "</span></p>\n"; }

if ($featuring && $featuring != $characterName) {

list($featuring, $charList) = linkCharsAdvanced($featuring, $id);

$allTips[$id] = $charList;
FOREACH ($charList as $thisChar) {
if (!in_array($thisChar, $allChars)) { array_push($allChars, $thisChar); }
} // end FOREACH

echo "<p><span class='fineprint'><font color='#A5B9D5'><b>With:</b> $featuring</font></span></p>\n";

} // end if featuring

if ($location && $charid) {
echo "<p><span class='fineprint'><font color='#A5B9D5'><b>Where:</b> $location;</font></span></p>\n";

} // end if location

if (($timeofday || $gamedate) && $charid) {

$tempy = array();
if ($timeofday && $gamedate) { array_push($tempy,$timeofday); array_push($tempy,$gamedate); }
else if ($timeofday) { array_push($tempy,$timeofday); }
else if ($gamedate) { array_push($tempy,$gamedate); }

$dateandtime = implode(", ", $tempy);

echo "<p><span class='fineprint'><font color='#A5B9D5'><b>When:</b> $dateandtime;</font></span></p>\n";

} // end if timeofday

if ($ooc && ($charid || $storyteller)) {
echo "<!-- charid: $charid -->\n";
echo "<!-- storyteller: $storyteller -->\n";

$ooc = hrefCheck($ooc);
echo "<p><span class='fineprint' style='color: #00CC99'><b>OOC:</b> " . stripslashes($ooc) . "</span></p>\n";
} // end if ooc

if ($tags) {
$tags = linkChars($tags);
echo "<p><span class='fineprint'><b>Tags:</b> " . stripslashes($tags) . "</span></p>\n";
} // end if tags


echo "</td></tr>\n\n";

if ($pref["mostrecentfirst"]) { $i=$i-1; } else { $i++; }

} // end WHILE


echo "<tr><td colspan='2' style='padding: 0px'><hr color='#050F1D'/></td></tr>\n";

echo "<tr><td colspan='2'>";
echo "<p>";

if ((!$locked || $moderator) && !$hideHeaders) {
echo "<a href='/messages/post.php?thread=$thread' title='Make a post to this thread'>[Add Post&#8230;]</a> | ";
} // end if locked

?><a href="#top" title="Go to the top of this page">[Go to top]</a><?php

if ($totalPages > 1) {
echo " | <font color='#A5B9D5'> | <b>Page: </b>[ ";

threadNav();

echo " ]</font>";

} // end if pages

echo "</p></td></tr>\n";
echo "</table>\n";

if (count($allChars)) {
FOREACH ($allChars as $charid) { 
echo "<div id='cerebra_tooltip_$charid' style='display:none; padding: 5px; width:200px; background-color: black; border: solid 1px #415582;'>"; 
$tooltip_id = $charid;
include("../cerebra_tooltip.php");
echo "</div>\n\n";
} // end foreach

?>

<script type="text/javascript">
<?php

FOREACH ($allTips as $id => $charids) { 

FOREACH ($charids as $charid) {
echo "var my_tooltip_{$charid}_$id = new Tooltip('cerebra_{$charid}_$id', 'cerebra_tooltip_$charid')\n";
} // end foreach
} // end foreach allTips

?>
</script>

<?php 
} // end if any chars to show tooltips for

include("../footer.php"); ?>

 

 

Link to comment
Share on other sites

If you were to go through that code and format it using indentation so that code in related blocks was indented the same, it would make reading it and finding things easier.

 

The code also appears to be dependent on register globals and while external variables (post/get/cookie) might work now, it will stop under php6 (where register globals have been completely removed.)

Link to comment
Share on other sites

If you were to go through that code and format it using indentation so that code in related blocks was indented the same, it would make reading it and finding things easier.

 

The code also appears to be dependent on register globals and while external variables (post/get/cookie) might work now, it will stop under php6 (where register globals have been completely removed.)

 

When will that happen? Aren't people still using 4 and 5? I've not heard of anyone or anything happening in 6

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.