TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 500
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Why is my editor not working correctly?

Started by ChetUbetcha, June 01, 2007, 06:03:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ChetUbetcha

I created a PHP article and saved it.  When the editor window refreshes, it looks like this...



Why do I get half my code in the editor, but the rest appears as an actual html screen?  If I try editing something in this messed up mode, I cannot click the save button to make any changes.  Sorry, don't have all the code on me at this moment.  I'm hoping it's something outside my code that's breaking this (i.e. portal flaw)

Thanks!

I found this as well http://www.tinyportal.net/index.php?topic=15955.0.  I'll try this too, but I hope there is more info here to help with this issue.

Lesmond

Can you post the code you are using? also if the code has <?php and ?> in they need to be removed! from the start and end of the code

ChetUbetcha

Here's what I'm using.  Go easy though, I'm a newb!   ;)  BTW, I'm using Dreamweaver, so I'm building the PHP pages in DW and then editing them to work with the portal.  I've made a few block codes that work fine this way, but this one seems to give me nothing but problems.  Everything seems to be working fine right now, minus the calendar (click on the text window and a calendar is supposed to drop down to select different dates).  I've also noticed that clicking submit is not adding records to my DB.  When it rains, it pours!

global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix, $options;

require_once(dirname(__FILE__) . '/ngisdoportalDB.php');

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) {
  $insertSQL = sprintf("INSERT INTO reports (report_type, `section`, section_ai, ai_number, ai_issue, ai_status, bullet_date, bullet_text) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['report_type'], "text"),
                       GetSQLValueString($_POST['ai'], "text"),
                       GetSQLValueString(isset($_POST['ai_checkbox']) ? "true" : "", "defined","'Y'","'N'"),
                       GetSQLValueString($_POST['ai_number'], "text"),
                       GetSQLValueString($_POST['ai_issue'], "text"),
                       GetSQLValueString($_POST['ai_status'], "text"),
                       GetSQLValueString($_POST['bullet_date'], "text"),
                       GetSQLValueString($_POST['bullet_text'], "text"));

  mysql_select_db($database_ngisdoportalDB, $ngisdoportalDB);
  $Result1 = mysql_query($insertSQL, $ngisdoportalDB) or die(mysql_error());

  $insertGoTo = "http://steelhead/interactive/forum/index.php?page=25";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_ngisdoportalDB, $ngisdoportalDB);
$query_report = "SELECT * FROM reports";
$report = mysql_query($query_report, $ngisdoportalDB) or die(mysql_error());
$row_report = mysql_fetch_assoc($report);
$totalRows_report = mysql_num_rows($report);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SDO Portal Timeline Tool</title>
<link href="Control/CalendarControl.css" rel="stylesheet" type="text/css"><script src="Control/CalendarControl.js" language="javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
function Disab()
{
frm=document.forms[0]
if(frm.ai_checkbox.checked)
{frm.ai_number.disabled=false;frm.ai_issue.disabled=false;frm.ai_status.disabled=false;frm.ai[0].disabled=true;frm.ai[1].disabled=true;frm.ai[2].disabled=true;frm.ai[3].disabled=true;frm.ai[4].disabled=true;frm.ai[5].disabled=true;frm.ai[6].disabled=true;frm.other_text.disabled=true;frm.bullet_text.disabled=true;}
else
{frm.ai_number.disabled=true;frm.ai_issue.disabled=true;frm.ai_status.disabled=true;frm.ai[0].disabled=false;frm.ai[1].disabled=false;frm.ai[2].disabled=false;frm.ai[3].disabled=false;frm.ai[4].disabled=false;frm.ai[5].disabled=false;frm.ai[6].disabled=false;frm.other_text.disabled=false;frm.bullet_text.disabled=false;}
}
</SCRIPT>
<style type="text/css">
<!--
body,td,th,input,select {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
color: #336699;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #336699;
}
a:hover {
text-decoration: underline;
color: #336699;
}
a:active {
text-decoration: none;
color: #336699;
}
body {
background-color: #FFFFFF;
}
-->
</style></head>

<body>
<form action="<?php echo $editFormAction?>" name="form" method="POST">
  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="2">
    <tr>
      <td colspan="4">
        <strong>This is the SDO Portal Status Report Generator</strong><br />
          <ul>
            <li>Select <strong>Report Type </strong>(Weekly or Monthly).</li>
            <li>The <strong>Awareness, Issues &amp; Action Items </strong>text boxes are disabled until you select the <strong>Awareness, Issues &amp; Action Items </strong>check box. Once selected, all other fields besides <strong>Date</strong> will be disabled. </li>
            <li>Deselect the <strong>Awareness, Issues &amp; Action Items </strong>or simply select a radio button for the appropriate <strong>Section </strong>and enter the status report information.</li>
            <li>The date is automatically filled with the current date. Click the <strong>Date </strong>text box to bring up the interactive calendar and select the correct date for your information.</li>
            <li>Click <strong>Submit</strong>.</li>
        </ul>       
        <p>Please contact <a href="mailto:tsayers@fbinet.fbi">Tom Sayers</a> if you have any questions or comments.</p></td>
    </tr>

    <tr>
      <td colspan="4" align="right">&nbsp;</td>
    </tr>
    <tr>
      <td width="11%" align="right"><strong>&nbsp;Report&nbsp;Type: </strong></td>
      <td colspan="3"><select name="report_type" id="report_type">
        <option value="Weekly" selected="selected">Weekly</option>
        <option value="Monthly">Monthly</option>
      </select>      </td>
    </tr>
<!--    <tr>
      <td width="14%" align="right"><strong>Office:</strong></td>
      <td><select name="office" id="office">
        <option value="Awareness, Issues &amp; Action Items">Awareness, Issues &amp; Action Items</option>
        <option value="Administrative - Personnel">Administrative - Personnel</option>
        <option value="Tasks/Initiatives - Requirements Development">Tasks/Initiatives - Requirements Development</option>
        <option value="Tasks/Initiatives - Acquisition">Tasks/Initiatives - Acquisition</option>
        <option value="Tasks/Initiatives - Baseline Documentation">Tasks/Initiatives - Baseline Documentation</option>
        <option value="Tasks/Initiatives - Quick Wins">Tasks/Initiatives - Quick Wins</option>
        <option value="Tasks/Initiatives - Miscellaneous">Tasks/Initiatives - Miscellaneous</option>
      </select>      </td>
    </tr>
-->   
<tr>
      <td align="right"><strong>Section:</strong></td>
      <td colspan="3"><input name="ai_checkbox" type="checkbox" id="ai_checkbox" value="ai_checkbox" onClick="Disab()"/>
      Awareness, Issues &amp; Action Items</td>
    </tr>
   
    <tr>
      <td align="right">&nbsp;</td>
      <td><div align="center">Number</div></td>
      <td>Issue</td>
      <td>Status</td>
    </tr>
    <tr>
      <td align="right" valign="top">&nbsp;</td>
      <td width="8%" valign="top"><div align="center"><input name="ai_number" type="text" id="ai_number" size="4" disabled/>
      </div></td>
      <td width="24%" valign="top"><textarea name="ai_issue" cols="30" rows="4" id="ai_issue" disabled></textarea></td>
      <td width="57%" valign="top"><textarea name="ai_status" cols="30" rows="4" id="ai_status" disabled></textarea></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="personnel" value="Personnel" />
      Personnel</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="req_dev" value="Requirements Development" />        Requirements Development</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="acquisition" value="Acquisitions" />
      Acquisition</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="baseline_docs" value="Baseline Documents" />
      Baseline Documentation</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="quick_wins" value="Quick Wins" />
      Quick Wins</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="misc" value="Miscellaneous" />
      Miscellaneous</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="ai" type="radio" id="other" />
        Other
      <input name="ai" type="text" id="ai" /></td>
    </tr>
    <tr>
      <td align="right"><strong>Date:</strong></td>
      <td colspan="3"><input onfocus="showCalendarControl(this);" name="bullet_date" type="text" id="bullet_date" value="<?php echo date("n-j-Y"); ?>" />
        (Click date field to bring up interactive calendar)</td>
    </tr>
    <tr>
      <td align="right"><strong>Bullet:</strong></td>
      <td colspan="3"><textarea name="bullet_text" cols="50" rows="4" id="bullet_text"></textarea></td>
    </tr>
    <tr>
      <td colspan="4" align="right">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="center"><input type="reset" name="Reset" value="Reset" />
      &nbsp;&nbsp;
      <input name="Submit" type="submit" id="Submit" value="Submit" /></td>
    </tr>
  </table>
 
  <input type="hidden" name="MM_insert" value="form1">
</form>

</body>
</html>
<?php
mysql_free_result
($report);

Lesmond

Not being a coder myself :( But I didn't think you could mix php with html like that!
But I am sure someone will be along to correct me :)

ChetUbetcha

I installed the custom fields mod, created phone, pager, cell, etc. items and then created a DW file to generate a phone listing.  When I put it into TP, I simply replaced the beginning required php lines with the few typical TP ones and it works like a charm.  That's why I stumped as to why it won't work with this one.  The editor shows code down to <td width="24%" valign="top"><textarea name="ai_issue" cols="30" rows="4", then it starts showing the actual page in the editor.

Lesmond

I have just tried it with my test site and I get the same :( sorry I cant be much help, I am just not good with php, Html ok :)


This website is proudly hosted on Crocweb Cloud Website Hosting.