You are not logged in.
Pages: 1
--------------------------------------------------------------------------------
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /info/www/publications/spectrum/admin/html_article_functionsW.php:1) in /info/www/publications/spectrum/admin/db_functions.php on line 4
thats the errror I get when I add the code to the PHP file, am i missing something here, or cant I put this on a PHP, it shows up fine and works it just gives me that error at the top, Heres the code... its propbly up front or i might need some special formatting to get the java to work in a php file
<script type="text/javascript">
_editor_url = "/xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en"; // And the language we need to use in the editor.
</script>
<script type="text/javascript" src="/xinha/htmlarea.js"></script>
<script type="text/javascript">
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
xinha_init = xinha_init ? xinha_init : function()
{
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'FullScreen',
'ListType',
'SpellChecker',
'Stylist',
'SuperClean',
'TableOperations'
];
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors :
[
'newbody'
];
xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
HTMLArea.startEditors(xinha_editors);
}
window.onload = xinha_init;
</script>
<?
/************************************************** **************
************************************************** **************/
function print_all_articlesW($array, $current, $working, $vol, $iss, $filter){
$ids = $array[0];
$headlines = $array[1];
$sub_headlines = $array[2];
$section_names = $array[3];
$authors = $array[4];
echo "<table border=0 width=\"100%\"><tr><td rowspan=2>";
if ($current == 1 && $filter == 0) {
echo("<b>show current issue</b> | <a href=\"article_listw.php?current=0&working=1\">[show working issue]</a>");
}
else if ($working == 1 && $filter == 0) {
echo("<a href=\"article_listw.php?current=1&working=0\">[show current issue]</a> | <b>show working issue</b>");
}
else {
echo "<a href=\"article_listW.php?current=1&working=0\">[show current issue]</a> | <a href=\"article_listW.php?current=0&working=1\">[show working issue]</a>";
}
echo "<br><hr width=\"200\" size=\"2\" align=\"left\">";
echo "<a href=\"W.php?mult=0\">new article</a> | <a href=\"w.php?mult=1\">multiple new articles</a>";
echo "</td><td>";
echo "<form method=\"post\" action=\"article_listW.php\" name=\"article_filter\">";
echo "<input type=\"hidden\" name=\"current\" value=\"".$current."\">";
echo "<input type=\"hidden\" name=\"working\" value=\"".$working."\">";
echo "<input type=\"hidden\" name=\"filter\" value=\"1\">";
echo "Filter by Volume: ";
?>
<select name="vol" onChange="articlefilter();">
<?
$all_volumes = get_all_vols_list();
for ($i = 0; $i < sizeof($all_volumes); $i++){
if ($all_volumes[$i] == $vol){
echo "<option value=\"".$all_volumes[$i]."\" selected>".$all_volumes[$i]."</option>";
}
else {
echo "<option value=\"".$all_volumes[$i]."\">".$all_volumes[$i]."</option>";
}
}
echo "</select>";
echo " Issue: ";
echo "<select name=\"iss\" onChange=\"articlefilter2();\">";
$all_issues = get_all_issues_list($vol);
echo "<option value=\"".$all_issues[0]."\">--</option>";
for ($i = 0; $i < sizeof($all_issues); $i++){
if ($all_issues[$i] == $iss){
echo "<option value=\"".$all_issues[$i]."\" selected>".$all_issues[$i]."</option>";
}
else {
echo "<option value=\"".$all_issues[$i]."\">".$all_issues[$i]."</option>";
}
}
echo "</select>";
echo "</form>";
echo "</td></tr></table>";
echo "<table width=\"100%\" border=1><tr><th>Headline</th><th>Section</th><th>Author</th></tr>";
for ($i=0; $i < sizeof($ids); $i++){
if ($authors[$i][0]){
$author_array = get_staff_member($authors[$i][0]);
$first_name = $author_array[1];
$last_name = $author_array[3];
}
else {
$first_name = "error";
$last_name = "error";
}
?>
<tr>
<td width="60%">
<a href="w.php?id=<? echo $ids[$i]; ?>"> <? echo stripslashes($headlines[$i]); ?>
<?
if ($sub_headlines[$i] != '') {
echo ": ".stripslashes($sub_headlines[$i]);
}
?>
</a>
</td>
<td width="20%">
<a href="W.php?id=<?echo ($ids[$i])?>"> - <? echo stripslashes($section_names[$i]); ?></a>
</td>
<td width="20%">
<a href="W.php?id=<?echo ($ids[$i])?>"> - <? echo $last_name.", ".$first_name; ?></a>
</td>
</tr>
<?
}
echo "</table>";
}
/************************************************** **************
<SPAN ID="copytext" STYLE="height:150;width:162;background-colorink">
This text will be copied onto the clipboard when you click the button below. Try it!
</SPAN>
<TEXTAREA ID="holdtext" STYLE="display:none;">
</TEXTAREA>
<BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON>
************************************************** **************/
function print_article_formW($id, $mult){
$article = get_article($id);
$id2 = $article[0];
$volume = $article[1];
$issue = $article[2];
$psd = $article[3];
$priority = $article[4];
$headline = $article[5];
$sub_headline = $article[6];
$section_id = $article[7];
$author_id = $article[8];
$alt_auth = $article[9];
$alt_auth_aff = $article[10];
$section = $section;
$body = get_article_body($id);
?>
<form method="post" action="article_saveW<? if($mult) { echo("_mult"); } ?>.php">
<input type="hidden" name="id" value="<? echo $id2; ?>">
<table>
<?
$apos = "'";
$quot = """;
$result_headline =$headline;
$result_sub_headline =$sub_headline;
$result_alt_auth =$alt_auth;
$result_alt_auth_aff =$alt_auth_aff;
$result_headline =str_replace("'",$apos,stripslashes($result_headli ne));
$result_headline =str_replace('"',$quot,stripslashes($result_headli ne));
$result_sub_headline =str_replace("'",$apos,stripslashes($result_sub_he adline));
$result_sub_headline =str_replace('"',$quot,stripslashes($result_sub_he adline));
$result_alt_auth =str_replace("'",$apos,stripslashes($result_alt_au th));
$result_alt_auth =str_replace('"',$quot,stripslashes($result_alt_au th));
$result_alt_auth_aff =str_replace("'",$apos,stripslashes($result_alt_au th_aff));
$result_alt_auth_aff =str_replace('"',$quot,stripslashes($result_alt_au th_aff));
?>
<b>Issue</b>
<br>
<input type="text" name="issue" value="<? echo $issue; ?>">
<input type="text" name="volume" value="<? echo $volume; ?>">
<input type="text" name="published_sys_date" value="<? echo $psd; ?>">
<br>
Headline<br>
<input type="text" name="headline" value="<? echo $result_headline;?>" size="60" maxlength="200">
Sub Head
<input type="text" name="sub_headline" value="<? echo $result_sub_headline; ?>" size="60" maxlength="200">
<tr>
Please Update the artical status every time:
<td>
<select name="status"<? echo($status); ?> >
<option value="edit1-">edit 1</option>
<option value="edit2-">edit 2</option>
<option value="edit3-">edit 3</option>
<option value="edit4-">edit 4</option>
<option value="edit5-">edit 5</option>
</select>
<input type="submit" value="Save">
</td>
</tr>
</table>
Body<br><textarea cols="60" rows="10" id="oldbody" name="txtXinhaTest" style="width: 100%">
<? for ($i=0; $i < sizeof($body); $i++){ echo stripslashes($body[$i]); } ?></textarea>
<table>
<?
if(! isset($mult)) {
?>
<?
}
?>
<tr>
<th class="top-rgt">
Section
</th>
<td>
<select name="section_id">
<?
$sec = get_all_sections();
$ids = $sec[0];
$section_ids = $sec[1];
$section_names = $sec[2];
for ($i=0; $i < sizeof($section_names); $i++){
?>
<option value="<? echo $ids[$i]; ?>"<? if ($ids[$i] == $section_id) {echo " selected"; } ?>>
<? echo $section_names[$i]; ?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?
$MIN_FIELDS = 4;
$article_authors = get_article_authors($id);
$authors = get_all_authors();
$author_ids = $authors[0];
$first_names = $authors[1];
$middle_names = $authors[2];
$last_names = $authors[3];
$title_ids = $authors[4];
for ($i = 0; $i < $MIN_FIELDS; $i++){
?>
<tr>
<th class="top-rgt">
Author <?echo($i+1);?>
</th>
<td>
<select name="author_id<? echo($i); ?>">
<option value="0">
SELECT AUTHOR NUMBER <? echo($i+1); ?>
</option>
<?
for ($j = 0; $j < sizeof($author_ids); $j++){
$title = get_title($title_ids[$j]);
$title = $title[2];
?>
<option value="<? echo $author_ids[$j]; ?>" <? if ($article_authors[$i] == $author_ids[$j]){ echo "selected"; } ?>>
<? echo stripslashes($last_names[$j]).", ".stripslashes($first_names[$j])." ".stripslashes($middle_names[$j])." (".$title.")"; ?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?
}
?>
<tr>
<th class="top-rgt">
Alt. Author(s)
</th>
<td>
<input name="alt_auth" value="<? echo $result_alt_auth; ?>" size="60" maxlength="50">
</td>
</tr>
<tr>
<th class="top-rgt">
Affiliation
</th>
<td>
<input name="alt_auth_aff" value="<? echo $result_alt_auth_aff; ?>" size="60" maxlength="50">
</td>
</tr>
<tr>
<td>
</td>
</table>
</form>
<?
}
/************************************************** **************
************************************************** **************/
function print_new_article_formW($mult){
?>
<form method="post" action="article_saveW<? if($mult) { echo("_mult"); } ?>.php">
<table>
<?
if ($mult) {
?>
<?
}
list($issue, $volume) = get_working_issue();
$date = get_working_date();
?>
<tr>
<b>Vol:</b>
<input type="text" name="volume" value="<? echo $volume; ?>">
<b>Iss:</b>
<input type="text" name="issue" value="<? echo $issue; ?>">
<input type="text" name="published_sys_date" value="<? echo $date; ?>">
</tr>
<tr>
<th class="top-rgt">
Headline
</th>
<td>
<input type="text" name="headline" value="Inprg-<? echo $result_headline; ?>" size="60" maxlength="200">
</td>
</tr>
<tr>
<th class="top-rgt">
Sub Head
</th>
<td>
<input type="text" name="sub_headline" value="<? echo $result_sub_headline; ?>" size="60" maxlength="200">
</td>
</tr>
<?
if(!$mult) {
}
?>
<tr>
<th class="top-rgt">
Section
</th>
<td>
<select name="section_id">
<?
$sec = get_all_sections();
$ids = $sec[0];
$section_ids = $sec[1];
$section_names = $sec[2];
for ($i=0; $i < sizeof($section_names); $i++){
?>
<option value="<? echo $ids[$i]; ?>"<? if ($ids[$i] == $section_id) {echo " selected"; } ?>>
<? echo $section_names[$i]; ?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?
$MIN_FIELDS = 4;
$authors = get_all_authors();
$author_ids = $authors[0];
$first_names = $authors[1];
$middle_names = $authors[2];
$last_names = $authors[3];
$title_ids = $authors[4];
for ($i = 0; $i < $MIN_FIELDS; $i++){
?>
<tr>
<th class="top-rgt">
Author <?echo($i+1);?>
</th>
<td>
<select name="author_id<? echo($i); ?>">
<option value="0">
SELECT AUTHOR NUMBER <? echo($i+1); ?>
</option>
<?
for ($j = 0; $j < sizeof($author_ids); $j++){
$title = get_title($title_ids[$j]);
$title = $title[2];
?>
<option value="<? echo $author_ids[$j]; ?>">
<? echo stripslashes($last_names[$j]).", ".stripslashes($first_names[$j])." ".stripslashes($middle_names[$j])." (".$title.")"; ?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?
}
?>
<tr>
<th class="top-rgt">
Alt. Author(s)
</th>
<td>
<input name="alt_auth" value="<? echo $result_alt_auth; ?>" size="60" maxlength="50">
</td>
</tr>
<tr>
<th class="top-rgt">
Affiliation
</th>
<td>
<input name="alt_auth_aff" value="<? echo $result_alt_auth_aff; ?>" size="60" maxlength="50">
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="Save">
</td>
</tr>
</table>
</form>
<?
?>
<tr>
Body<br>
<td>
<textarea cols="60" rows="100" id="newbody" name="body" style="width: 100%">
</td>
</tr>
<?
}
/************************************************** **************
************************************************** **************/
function print_article_select_boxW($id='', $num_issues=1){
$a_ids = array();
$headlines = array();
if($num_issues <= 1){
$array = get_article_headlines('', '');
$a_ids = $array[0];
$headlines = $array[1];
}
else{
for ($i=0; $i<$num_issues; $i++){
list($newest_issue, $newest_volume) = get_working_issue();
$newest_issue = $newest_issue - $i;
if (exists_issue($newest_issue, $newest_volume)){
array_push($a_ids, 0);
$str = "------------ VOLUME ".$newest_volume." ISSUE ".$newest_issue." ------------";
array_push
($headlines, $str);
$array = get_article_headlines($newest_issue, $newest_volume);
$a_ids = array_merge($a_ids, $array[0]);
$headlines = array_merge($headlines, $array[1]);
}
}
}
?>
<select name="article">
<option value=0>Select an Article:</option>
<?
for ($i=0; $i < sizeof($a_ids); $i++){
$section = get_article_section($a_ids[$i]);
?>
<option value="<? echo $a_ids[$i]; ?>" <? if ($id == $a_ids[$i] && $a_ids[$i] > 0){ echo "selected"; } ?>><? if($a_ids[$i] != 0){ echo "(".$section.") - "; } echo $headlines[$i]; ?></option>
<?
}
?>
</select>
<?
}
?>
Offline
hmm could at least give me a code suggestion or 2, i only need this specific file to work
Offline
looks like i got it working, thanks for the help
Offline
Pages: 1