Post Reply  Post Thread 
Pages (2): « First [1] 2 Next > Last »
TEMPLATE UPDATE ERROR
Author Message
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
TEMPLATE UPDATE ERROR

Hi again,

I'm having another problem with UNP 1.0.4.

It's about the template section. I'm translating the whole thing to Spanish and when I want to update the news_newsbit_commentslink I get a server error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, hostmaster@misdns.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.52-CHS-1 (Unix) Server at saurom.com Port 80


I only get it when trying to update that one... the others are fine.
I'm not sure if I should ask for help here... I emailed my hosting provider as well, but it may be something to do with the code on the template.php file???

Thanks!

This post was last modified: 12-08-2007 02:33 AM by elMediano.

12-08-2007 02:30 AM
Find all posts by this user Quote this message in a reply
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #2
RE: TEMPLATE UPDATE ERROR

Hi,

I also notice it happens the same thing when trying to update or revert to orginial news_newsbit_readmorelink

...just in case it helps.

Thanks!

12-08-2007 03:09 AM
Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #3
RE: TEMPLATE UPDATE ERROR

That's a strange error. Only updating those two templates causes that, no other templates?

Is this when you submit changes to the template, or when you click edit?


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro
12-08-2007 03:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #4
RE: TEMPLATE UPDATE ERROR

That's right, no other templates show this error.

It is only when I click on Submit Changes...

When I click on Submit Changes, I get the error message I posted above. But I have discovered that when I click on "revert to original" and then Yes, the error message it's much more complete. Here it goes:

======================================
Database error in Utopia News Pro:

Invalid SQL Query: UPDATE `unp_template` SET template='<a onClick='open("{$unpurl}/comments.php?action=list&amp;newsid={$newsid}","View","width=550, height=580, top=20,left=20,scrollbars=yes, status=no, toolbar=no, menubar=no")' href="jvoid(0)"><font face="verdana, arial, helvetica" color="{$postdatetext}" size="1"><strong>Comments:</strong> {$comments}</font></a>&nbsp;<a onClick='open("{$unpurl}/comments.php?action=post&amp;newsid={$newsid}","Post","width=550, height=580, top=20,left=20,scrollbars=yes, status=no, toolbar=no, menubar=no")' href="jvoid(0)"><font face="verdana, arial, helvetica" color="{$postdatetext}" size="1">(Add Comment)</font></a>' WHERE id='2'
MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'open("{$unpurl}/comments.php?action=list&amp;newsid={$newsid}","

MySQL Error Number: 1064

Date: December 7, 2007 07:02 PM
Script: /upload/templates.php?action=revert&tempid=2&verify=1
====================================================

My hosting provider told me it may be something to do with the server's firewall. But I'm just finding really strange that it only happens to those two. However, I don't think it has to do with UNP, because he also said he could activate something to make it work in that specific domain path.

What do you reckon anyway by looking at that error message?

Thanks a lot!

12-08-2007 04:08 AM
Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #5
RE: TEMPLATE UPDATE ERROR

Good catch on that second error.

Find this in templates.php:

PHP Code:
$revertTemplate $DB->query("UPDATE `unp_template` SET template='".$originalTemplate['template']."' WHERE id='$tempid'"); 

Replace with:

PHP Code:
$revertTemplate $DB->query("UPDATE `unp_template` SET template='".mysql_escape_string($originalTemplate['template'])."' WHERE id='$tempid'"); 


I believe the first error is caused by the same thing that causes the second (the use of single quotes in the template), but I'm not sure if it's actually a UNP bug in the first instance. This would especially be the case if the above fix makes "revert template" have the same issue as "edit template" for those two. Still looking into it.


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro

This post was last modified: 12-08-2007 08:31 AM by Brian.

12-08-2007 08:25 AM
Visit this user's website Find all posts by this user Quote this message in a reply
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #6
RE: TEMPLATE UPDATE ERROR

Hi there!

Again, thanks a lot for your help!!

Now, it lets me "revert to original" both of the templates but I can't edit them. I must say I'm a more a Graphic Designer than a Web Developer, so I don't know PHP, I'm just learning slowly by playing around with it.

So what I tried was to modify the piece of code in "line 45":

PHP Code:
$updateTemplate $DB->query("UPDATE `unp_template` SET template='$template' WHERE id='$tempid'"); 


by replacing

PHP Code:
SET template='$template' 

for

PHP Code:
SET template='".mysql_escape_string($originalTemplate['template'])."' 


from the piece of code you gave me. But it hasn't worked. Please forgive me if what I did was totally stupid!!! hhehe

Could you help me sorting out the edit bit??

Thanks!!

This post was last modified: 12-09-2007 12:31 AM by elMediano.

12-09-2007 12:27 AM
Find all posts by this user Quote this message in a reply
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #7
RE: TEMPLATE UPDATE ERROR

Well, by looking at the code you gave me, I'm guessing I did a VERY STUPID thing.

I believe this bit:

PHP Code:
SET template='".mysql_escape_string($originalTemplate['template'])."' 


works only for "revert to original" because of the $originalTemplate code bit??

After that I was having problems with all the Templates hehehaha so... I just uploaded a non-hacked fresh version of the template.php file. As I keep getting the server error, I changed the piece of code you told me again, but as I mentioned before the edit isn't working.

Hope you can help.

Thanks a lot!

This post was last modified: 12-09-2007 02:02 AM by elMediano.

12-09-2007 01:49 AM
Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #8
RE: TEMPLATE UPDATE ERROR

With the edit not working in that manner, it sounds like a server-side issue since I have no problems at all. It does not sound to me like it has to do with the server's firewall, but rather the PHP configuration. I'll continue to think about this, though.


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro
12-09-2007 05:25 PM
Visit this user's website Find all posts by this user Quote this message in a reply
elMediano
Junior Member
**


Posts: 12
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #9
RE: TEMPLATE UPDATE ERROR

Thanks for your help Brian.

I'll contact my hosting provider and tell them about it.

There is just one more thing... I changed yesterday the name of the folder containing UNP and since then I'm getting the following error when I try to submit anything... news, templates, styles....


Warning: feof(): supplied argument is not a valid stream resource in /home/chs/saurom.com/home/html/noticias/functions.inc.php on line 474

Warning: fread(): supplied argument is not a valid stream resource in /home/chs/saurom.com/home/html/noticias/functions.inc.php on line 476

Any suggestions?

Thanks a lot!

12-12-2007 02:40 AM
Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #10
RE: TEMPLATE UPDATE ERROR

You'll need to go back to the settings page and update UNP directory and URL to Utopia News Pro Install.


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro
12-12-2007 06:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pages (2): « First [1] 2 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: