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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 206
  • Total: 206

Article Problem

Started by umiya, January 20, 2009, 09:53:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

Let's back up a bit. You said earlier

QuoteI cant get into the articles and catergories section at all anymore

which indicates that at some point you could get into that section. Do you remember what you did before it changed?

umiya

I didnt do any edits to the forum its self, was just adding articles that all are working properly

http://taintedcore.net/index.php?page=3- This is the initial article that i couldnt edit. but i could still access the menu for the articles

http://taintedcore.net/index.php?page=4
http://taintedcore.net/index.php?page=5
http://taintedcore.net/index.php?page=7

these articles are my most recent, was able to edit them for ahwile then i started having the problem with page=3. After a bit it went to the whole article menu

http://taintedcore.net/index.php?page=10
http://taintedcore.net/index.php?page=11
http://taintedcore.net/index.php?page=12




JPDeni

I can't see what the page 3 article is, but I do see that the title for it is "Apply." Do you have a form on that page? If so, is there a textarea on that form? There's a problem with using textareas.

That's the only thing I can think of.

umiya

yes there are text areas, you have to be logged in to see that form. It should ask you to register or login. The article itself works fine

JPDeni

QuoteIt should ask you to register or login
I just got a black screen.

I understand that the article may work, but having a textarea in the article may mess up the editor.

I'm assuming this is a php article. If so, you need to do something like this for your closing tag:


echo '</' . 'textarea>';


I discovered this the hard way and I still forget it from time to time. :)

umiya

how do i do this without deleting all my articles? and as i stated before i was able to edit this article up till I started to add new articles

JPDeni

You might have to go into the database and edit them there.

umiya

so i pulled the ode form the database for the page=3

global $sourcedir, $user_info, $context ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');



// CONFIGURATION SECTION

$intro_form = "This is where you give any instructions for filling out the form.";   // Can include html

$thanks_text = "Thanks ever so much for applying. We'll review your application and get back to you."; // what is displayed after the form is submitted

// Define your fields. All of these values need to be defined, even if they are empty.
// The fields will be displayed in the order in which they are listed in the array.
// $fielddef =
//   array(
//     array(
//       'caption' =>      "", // caption to be displayed on the form. Can include symbols and spaces.
//       'name' =>         "", // a unique name for the field. No symbols or spaces
//       'type' =>         "", // text, radio, select, checkbox, textarea, heading
//       'options' =>      "", // for radio and select fields. List in order you wish them to appear, separated by commas; for checkboxes, it's the value to be saved and displayed next to the box
//       'defaultvalue' => "", // the default value for the field. Can be a variable or text. Be sure to enclose text in quotation marks
//       'required' =>     0   // 0 or 1 -- use 1 if the field must be filled out. use 0 if it's optional; never set a checkbox to be required
//     ),
//   );

$fielddef =
  array(
    array(
      'caption' =>      "Name",
      'name' =>         "name",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
    array(
      'caption' =>      "Age",
      'name' =>         "age",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Any activities that will effect your availability (work/school/social)",
      'name' =>         "activities",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "A little about yourself",
      'name' =>         "bio",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Computer Specs (does your computer lag? do you have connection trouble?)",
      'name' =>         "computer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Information about your character",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Class",
      'name' =>         "class",
      'type' =>         "select",
      'options' =>      "Druid,Hunter,Mage,Paladin,Priest,Rogue,Shaman,Warlock,Warrior,Death Knight",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Level",
      'name' =>         "Level",
      'type' =>         "select",
      'options' =>      "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Race",
      'name' =>         "race",
      'type' =>         "select",
      'options' =>      "Orc,Undead,Troll,Tauren,Blood Elf",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Alts (name/level/class/race/server)",
      'name' =>         "alts",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Experience (Include which character this is on)",
      'name' =>         "heading2",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Pre-TBC",
      'name' =>         "pretbc",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "TBC",
      'name' =>         "tbc",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "WotLK",
      'name' =>         "WotLK",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "Spec",
      'name' =>         "Spec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
     array(
      'caption' =>      "Do you enjoy your main spec (you will be raiding in this spec)",
      'name' =>         "enjoy",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
     array(
      'caption' =>      "Willing to respec if the guild ask you to",
      'name' =>         "respec",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
    array(
      'caption' =>      "Link to your armoury",
      'name' =>         "armoury",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "Do you have any resistance gear",
      'name' =>         "resistance",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "/Played",
      'name' =>         "played",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "Profession, and any rare recipes",
      'name' =>         "profession",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "How much gold do you have",
      'name' =>         "gold",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "Are you available to raid from 9:00 P.M. - 12:00 P.M server time on the following days?",
      'name' =>         "heading2",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
     array(
      'caption' =>      "Monday",
      'name' =>         "monday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
     array(
      'caption' =>      "Tuesday",
      'name' =>         "tuesday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
     array(
      'caption' =>      "Wednesday",
      'name' =>         "wednesday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
     array(
      'caption' =>      "Thursday",
      'name' =>         "thursday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
     array(
      'caption' =>      "Sunday",
      'name' =>         "sunday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
    array(
      'caption' =>      "Do you have anything planned that will effect your availability (holidays/exams etc)",
      'name' =>         "plans",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ), 
    array(
      'caption' =>      "What can you offer Taitned Core",
      'name' =>         "offer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "What are you looking for from Tainted Core",
      'name' =>         "looking",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
     array(
      'caption' =>      "Do you know anyone in the guild who can vouch for you",
      'name' =>         "vouch",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0   
    ),
    array(
      'caption' =>      "Have you applied anywhere else",
      'name' =>         "applied",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Previous guilds / reasons for leaving",
      'name' =>         "previous",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
     array(
      'caption' =>      "Can you confirm you have read, understand and agree to the guildrules?",
      'name' =>         "rules",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1   
    ),
    array(
      'caption' =>      "Further Comments",
      'name' =>         "comment",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
);


//send the application by email?
$enable_email=false;

// email address of recruitment staff member
$email_address='jeremyrayl@msn.com';

//post the application on forum?
$enable_post=true;

//board id to which the application should be posted
$board_id=3.0;


//END OF CONFIGURATION SECTION

$show_form= 'true';
if (isset($_REQUEST['submitted'])) {  // Handle the form

// Check required fields
  $errors = array(); //Initialize error array

  foreach ($fielddef as $field)
    if (empty($_REQUEST[$field['name']]) && ($field['required'] == 1)){ $errors[] = $field['name']; }

// There's at least one field missing
  if (isset($errors[0])) {
    foreach ($_REQUEST as $key => $value)
      $fieldvalue[$key] = $value;
  }
  else { // all is well
    $show_form='false';
    if ($enable_email) {  // email an application
  $subject = 'Enrollment Application';
  $body = 'Enrollment application has been made by ' . $context['user']['name'] .
          ' from IP Address ' . $user_info['ip'] . '
              ';
      foreach ($fielddef as $field) {
        $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '
        ';
      }
      mail($email_address, $subject, $body,"From: " . $user_info['email']);
    }

    if ($enable_post) {  //create new forum post with application

      $postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
                   <table>';
      foreach ($fielddef as $field) {
        $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
      }
      $postbody .= '</table>';

      $msgOptions = array(
        'id' =>  0 ,
        'subject' => '[Pending] Application of ' . $context['user']['name'],
        'body' => $postbody ,
        'icon' => 'xx',
        'smileys_enabled' => true,
        'attachments' =>  array(),
      );
      $topicOptions = array(
        'id' => 0 ,
        'board' => $board_id,
        'poll' =>  null,
        'lock_mode' =>  null,
        'sticky_mode' =>  null,
        'mark_as_read' => true,
      );
      $posterOptions = array(
        'id' => $context['user']['id'],
        'name' => $context['user']['name'],
        'email' => $user_info['email'],
        'update_post_count' => true,
      );
      createPost($msgOptions, $topicOptions, $posterOptions);
    }
// Text for thank you page

    echo $thanks_text;
  }
}

// Looks like you want the form,
if ($show_form == 'true') {
  echo $intro_form . "<br>";
  if (isset($errors[0])) { echo '<div style="color: red;">Please fill in all fields with a *.</div>';  }
  echo '<form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
        <center><table width="100%">';
  $bg = 'windowbg2';
  foreach ($fielddef as $field) {
    if ($field['type'] == 'text') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><INPUT id="' . $field['name'] . '" name="' . $field['name'] . '" type="text" value ="' . $fieldvalue[$field['name']] . '" /></TD>
            </TR>';
    }
    elseif ($field['type'] == 'radio') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left">';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<INPUT TYPE="RADIO" NAME="' . $field['name'] . '" VALUE="'. $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' CHECKED'; }
                echo '>' . $option . ' ';
              }
              echo '</TD>
            </TR>';   
    }
    elseif ($field['type'] == 'checkbox') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              echo $field['caption'] . ':</TD>
              <TD align="left">';
                echo '<INPUT TYPE="CHECKBOX" NAME="' . $field['name'] . '" VALUE="'. $field['options'] . '"';
                if (isset($fieldvalue[$field['name']]) && ($fieldvalue[$field['name']]==$field['options'])) { echo ' CHECKED'; }
                echo '>' . $field['options'] . '
            </TR>';   
    }
    elseif ($field['type'] == 'select') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><SELECT id="' . $field['name'] . '" name="' . $field['name'] . '" style="WIDTH: 152px" value ="';
              echo '" />';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<OPTION value="' . $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' selected'; }
                echo '>' . $option . '</OPTION>';
            }
            echo '</SELECT></TD>
            </TR>';
    }
    elseif ($field['type'] == 'textarea') {
      echo '<TR class ="' . $bg . '">
            <TD width = "200px" align="right">';
            if ($field['required'] == 1) { echo '* '; }
            echo $field['caption'] . ':</TD>
            <TD align="left"><TEXTAREA id="' . $field['name'] . '" name="' . $field['name'] . '" rows="4" cols="40">';
            echo $fieldvalue[$field['name']];
            echo '</' . 'TEXTAREA></TD>
  </TR>';
    }
    elseif ($field['type'] == 'heading') {
      echo '<TR class ="' . $bg . '">
            <TD colspan="2">' .
            $field['caption'] .
            '</TD></TR>';
    }
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
  }
  echo '
    <TR class ="' . $bg . '">
      <TD colspan="2" align="center">
        <INPUT type="submit" value="Submit">
        <INPUT type="reset" value="Reset"></TD>
    </TR></TABLE></center></form>';
}


whats the problem?

JPDeni

Oh. You didn't tell me you were using my code. :)

It doesn't look like that's the problem. I just don't know what it is.

If it was me, this is what I would do.

I would copy each of the articles, paste them into a text editor and save them on my home computer. Then I would delete them one at a time and go back and try things out after each deletion. That would tell me which one (if any) is the cause of the problem. It may be that the article isn't the cause at all, but there's no way of knowing that without doing some experimentation.

If, after one of the deletions, things suddenly worked again, I would know which article was causing the problem. If, after all of the deletions, things still didn't work, then I'd know it was something else.

I would also switch back to the default theme to make sure that the problem isn't theme-related. (Actually, that might be the thing to do first.)

umiya

So ti actualy is the theme. The only edits iv made to it involve the menus. Good place to start i guess?

This website is proudly hosted on Crocweb Cloud Website Hosting.