Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: CDM on August 11, 2009, 04:30:04 AM

Title: Preview not working...
Post by: CDM on August 11, 2009, 04:30:04 AM
Hello!

I just changed some stuff around on my SMF (only background colors, etc.), and added a button to my menu bar. Now, however, the "preview" function is not working with posts. It just says, "Fetching preview..." and then nothing happens.

I don't know if this is a result of my tinkering, or if this is due to something else. Should I paste my template code here? Has anyone had this prob before?

Oh- I am using 1.1.10, Darking theme.

Thanks!
Title: Re: Preview not working...
Post by: Arantor on August 11, 2009, 06:01:17 PM
That could be a variety of things.

Do you get any errors in the forum error log?
Title: Re: Preview not working...
Post by: CDM on August 12, 2009, 06:48:16 PM
No, nothing in error log.  Once I get the "Fetching preview" message, nothing happens at all- it just sits there. If I refresh the page, my post is still there, but the "fetching preview" thing is gone. If I click "preview" again, same thing happens.
Title: Re: Preview not working...
Post by: Arantor on August 12, 2009, 07:03:12 PM
Do you get a Javascript error on that page?
Title: Re: Preview not working...
Post by: CDM on August 12, 2009, 09:16:39 PM
No, nothing. It just sits there.
Title: Re: Preview not working...
Post by: N3RVE on August 13, 2009, 08:52:57 AM
Do you experience the problem on the default theme?
Run file_check.php (What is file_check.php? (http://www.simplemachines.org/community/index.php?topic=329069.0)) ...and a link to your forum will help :).

-[n3rve]
Title: Re: Preview not working...
Post by: CDM on August 14, 2009, 11:06:59 PM
OK- installed the file_check.php thing, and ran it, and got a bunch of errors... The first one was on the index page:

/forum/index.php

    * File does not end with ?>

So I went there, and saw that I had put my web stats code in there after the ?>, so I moved the ?> to the bottom of the page (end of file), and then my forum page had a parse error, pointing to the line where my web stats code begins. Could this be causing problems I am unaware of? I moved the ?> back to where it was and my forum page is back to normal. But nothing is fixed as far as the preview, obviously, and that web stats code may be causing problems because I couldn't put it in the theme/template/index.php file and get it to work.

I am afraid now to correct the other errors... :(

Here is the filechecker url (I don't know if you can see it or not):
http://www.conciergedumonde.com/forum/file_check.php

And my forum is at:
http://www.conciergedumonde.com/forum

Thanks so much for all your help so far!! :)
Title: Re: Preview not working...
Post by: CDM on August 14, 2009, 11:09:56 PM
Oh- forgot to ask- is the default theme the theme I set for the board default, or is it the core default theme that came with SMF? Either way, I experience it on both themes. :(
Title: Re: Preview not working...
Post by: N3RVE on August 14, 2009, 11:17:12 PM
You shouldn't add the code to ./index.php. Add it to ./Themes/../index.template.php (somewhere before </body>).

-[n3rve]
Title: Re: Preview not working...
Post by: CDM on August 14, 2009, 11:59:46 PM
So then do I have to add it to every theme in there? I think I tried that and got a parse error of some sort. I will try it again...

But the preview button was working even while my web-stats code was in there (it's been there since July 29th or 30th). It was only 4 days ago (when I first posted this thread) that it stopped working, after I changed the colors. And the way I changed the colors was that I just changed the original images in photoshop and uploaded them with the same names as the old ones (renaming the old ones as something different).
Title: Re: Preview not working...
Post by: Arantor on August 16, 2009, 07:50:10 PM
You should only need to change Themes/yourtheme/ and Themes/default/ files - not any others.

Do you need any more support with this?
Title: Re: Preview not working...
Post by: CDM on August 17, 2009, 04:38:11 AM
Yes, unfortunately I still don't know why the preview option doesn't work.  :(

Any help would be greatly appreciated! But if nobody can figure it out, I suppose it isn't the worst feature to be missing.  :D
Title: Re: Preview not working...
Post by: Arantor on August 17, 2009, 08:21:54 AM
So did you try adding ?> to files flagged by file_check.php ?

If you get a parse error, what files (and can you attach them here please)?
Title: Re: Preview not working...
Post by: CDM on August 17, 2009, 08:37:11 PM
Hi! OK- so I ran the file check thingy again and then went to each file:

/forum/Themes/default/languages/_vti_cnf/ManagePermissions.english.php

    * File does not begin with <?php
    * File does not end with ?>

It does begin and end with those, so I don't know why it is telling me it doesn't.

/forum/Themes/default/languages/_vti_cnf/Login.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same- those characters are in there right at the beginning and at the end.

/forum/Themes/default/languages/_vti_cnf/Reports.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/Stats.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/Who.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/Help.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/Wireless.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/ManageCalendar.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

/forum/Themes/default/languages/_vti_cnf/Install.english.php

    * File does not begin with <?php
    * File does not end with ?>

Same.

As a matter of fact, I think it lists each and every file in the forum folder! And then other theme folders. And each and every one so far seems to be the same- those characters are in there.  :(

Title: Re: Preview not working...
Post by: Arantor on August 17, 2009, 10:53:24 PM
Can you attach one or two of them please?
Title: Re: Preview not working...
Post by: N3RVE on August 29, 2009, 09:28:06 AM
If this is solved feel free to mark it as solved otherwise reply with what was requested :)

-[n3rve]
Title: Re: Preview not working...
Post by: CDM on August 30, 2009, 03:01:26 PM
I am coming back with the files requested- I just had a crash on my main computer so I need to get the old one up and running again (thank goddess I saved everything on the old one!!!).
Title: Re: Preview not working...
Post by: CDM on September 02, 2009, 06:09:23 PM
Sorry this took so long. Here are two of the files: Manage permissions and display template.
Title: Re: Preview not working...
Post by: JimM on September 05, 2009, 05:10:55 PM
Nothing wrong with those files other than you saved them as a txt file.  Normally when we ask for a file to be attached it is best to use your FTP client and copy the file to your desktop, then attach the file here.  Never edit php files with word, notepad, or wordpad.  Instead use a great text editor like Notepad++.

I'm curious.  Does your spellcheck work?
Title: Re: Preview not working...
Post by: CDM on September 09, 2009, 05:41:53 PM
You mean on my forum? Or on this (simple machines) forum? On my forum we don't seem to have a spell check.  :(
Title: Re: Preview not working...
Post by: JimM on September 09, 2009, 09:17:10 PM
I meant on your forum.  Sometimes when we see the preview not working we also see some problems with spellcheck.  I was just curious.  So you have it turned off?
Title: Re: Preview not working...
Post by: CDM on September 10, 2009, 07:53:57 PM
No, I don't think so. At least, I have never turned it off. I have just never seen it, and supposed it was a mod I needed to add.
Title: Re: Preview not working...
Post by: JimM on September 10, 2009, 09:22:14 PM
It's an option you turn on.  Admin > Forum > Post and Topics > Post Settings > Enable spell checking
Title: Re: Preview not working...
Post by: CDM on September 10, 2009, 09:54:56 PM
Yes, it was enabled. I remember that now- and remember that it said it doesn't work on all browsers. But I use both ie and firefox, and I don't have it on either. Could it be the theme (Darking) I am using?
Title: Re: Preview not working...
Post by: JimM on September 13, 2009, 01:27:37 PM
Try turning off spell check and see if your preview works.
Title: Re: Preview not working...
Post by: CDM on September 15, 2009, 04:13:05 AM
Nope, that didn't work either.  :(
Title: Re: Preview not working...
Post by: Arantor on September 20, 2009, 10:18:39 PM
Do you get any errors in the forum error log if you try to preview?
Title: Re: Preview not working...
Post by: CDM on September 24, 2009, 01:27:29 AM
No, I don't. So confusing! But nobody seems to be yowling about it for now, so maybe it isn't going to be a huge problem on our forum...
Title: Re: Preview not working...
Post by: JimM on September 24, 2009, 02:52:16 PM
Try moving your Web-stat code in front of the </body> tag,  Right now if I look at your source, you have that code outside the <html> tags as well and this is a common cause of the preview not working.
Title: Re: Preview not working...
Post by: CDM on September 28, 2009, 02:41:35 AM
Hmmm... I had a look at the code, and there isn't a /body> tag, or any html in there whatsoever. It is a php page so maybe it isn't supposed to have html? Should I add it in? I really don't know a whole lot about coding...
Title: Re: Preview not working...
Post by: Kill Em All on September 28, 2009, 02:51:01 AM
I am looking at your sourcecode now to and there is a </body> tag.

// ]]></script>

</div>
<div id="ajax_in_progress" style="display: none;">Loading...</div></div>
</body></html><!-- Begin Web-Stat code 2.0 http -->
<script type="text/javascript" src="http://server4.web-stat.com/wtslog.js">
</script><script type="text/javascript">
//<![CDATA[

// BEGIN PARAMETERS
var page_name = '#';
var invisible = '#';
var text_counter = '#';
// END PARAMETERS

//]]>
wtslog('al182165','3','http',page_name,invisible,text_counter);
</script><noscript><p><a href="http://www.web-stat.com">
<img src="http://server4.web-stat.com/3/al182165.gif"
style="border:0px;" alt="web stats"/></a></p></noscript>
<!-- End Web-Stat code v 2.0 -->

That is all the way at the bottom.
Title: Re: Preview not working...
Post by: JimM on September 29, 2009, 11:57:27 PM
Take a look at the code that Kill Em All posted and just before
Quote<!-- Begin Web-Stat code 2.0 http -->

you will see the tags.  This code should be before the </body> tag.
Title: Re: Preview not working...
Post by: Kill Em All on March 13, 2010, 10:57:38 PM
/me is marking this solved due to inactivity.

Please feel free to mark this unsolved and respond with further details.