TinyPortal

Development => Support => Topic started by: umiya on January 20, 2009, 09:53:27 PM

Title: Article Problem
Post by: umiya on January 20, 2009, 09:53:27 PM
I'v got an article I want to edit but when I click on the edit button it attempts to download "index.php" Other articles do not do this. I have tried various things such as deleting all my cache, cookies, and temp internet files. Three different browsers and even other admins. Any suggestions? Oh, I'd rather not delete the article and start over because its a php form to post.
Title: Re: Article Problem
Post by: G6Cad on January 20, 2009, 10:17:14 PM
Please read the Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581)
Title: Re: Article Problem
Post by: umiya on January 22, 2009, 11:38:15 PM
Link to my site: http://taintedcore.net
SMF version: SMF 1.1.7
TP version: TinyPortal v1.0.5 beta 1
Theme name and version: WOTLk
Mods installed: 1.     
PM On Registration      1.0.2      
2.    WoW Character Profiles    1.9.1    
3.    WoW-Itemstats 1.25.9.4    1.25.9.4    
4.    AJAX Instant Quick Reply    1.0.1    
5.    TinyPortal    1.052    
6.    Aeva ~ Auto-Embed Video & Audio    5.1.25    [
7.    Audible PM[/b]
Related Error messages: I have an article I cant edit. It attempts to download "index.php" And now I cant even get into my articles and categories section, it does the above mentioned there as well.
Title: Re: Article Problem
Post by: ZarPrime on January 22, 2009, 11:47:47 PM
Tell us a little more about the article and what it's supposed to do.  It would help to post the code here as well, so that one of us can try it on one of our test sites.  Enclose the code inside code tags (#).

ZarPrime
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 12:48:37 AM
I cant get into the articles and catergories section at all anymore, it keeps tying to download "index.php"
Title: Re: Article Problem
Post by: ZarPrime on January 23, 2009, 01:11:25 AM
Try adding ?action=tpadmin;sa=articles after index.php and see if that will let you in.  If you get in, delete the article and start over.  If it does it again, then there is probably something wrong with the code.

ZarPrime
Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 01:11:40 AM
Try going into your settings and turn off the html editor.
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 01:35:47 AM
Quote from: ZarPrime on January 23, 2009, 01:11:25 AM
Try adding ?action=tpadmin;sa=articles after index.php and see if that will let you in.  If you get in, delete the article and start over.  If it does it again, then there is probably something wrong with the code.

ZarPrime

didnt work

Quote from: JPDeni on January 23, 2009, 01:11:40 AM
Try going into your settings and turn off the html editor.

what settings? If you mean by inside the article then I cant do it. I cant get to my articles and catergories page at all

Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 02:10:28 AM
Try putting this in your browser as a URL, substuting the information for your site in the appropriate place:

http://www.yoursite.ocm/index.php?action=tpadmin;sa=artsettings
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 12:34:26 PM
Quote from: JPDeni on January 23, 2009, 02:10:28 AM
Try putting this in your browser as a URL, substuting the information for your site in the appropriate place:

http://www.yoursite.ocm/index.php?action=tpadmin;sa=artsettings

Was able to do this but it didn't work. Now that I am at work I get a network error

Network Error (tcp_error)


A communication error occurred: "" 
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. 


We use an older web browser with very high restrictions here tho

Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 03:05:24 PM
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?
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 04:10:12 PM
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



Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 04:27:12 PM
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.
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 04:43:48 PM
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
Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 04:54:07 PM
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. :)
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 06:26:32 PM
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
Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 06:47:05 PM
You might have to go into the database and edit them there.
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 08:18:47 PM
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?
Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 08:40:52 PM
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.)
Title: Re: Article Problem
Post by: umiya on January 23, 2009, 10:54:54 PM
So ti actualy is the theme. The only edits iv made to it involve the menus. Good place to start i guess?
Title: Re: Article Problem
Post by: JPDeni on January 23, 2009, 11:36:44 PM
I guess that would be it, yes. I would go back to the original files from the theme and start over.