Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 10:58 am EDT

Geeklog Forums

static pages, version & quotes


tokyoahead

Anonymous
confused
Hi,

I installed static pages 1.3.2 and I want to use some PHP code. I inserted the tags and some code inbetween with ' ' and " " quotes. I tried to set the setting to PHP and PHP/HTML, but the quotes used are always backslashed.

Also, the plugins-listing does only show the version 1.3, not the subversion .2 - cant that be changed? Even manually?

thanks
 Quote

Status: offline

exaurdon

Forum User
Regular Poster
Registered: 08/13/03
Posts: 107
Hello,

Sorry to hear you're having difficulties.


Also, the plugins-listing does only show the version 1.3, not the subversion .2 - cant that be changed? Even manually?


Yes, you can change the version number in the plugins/staticpages/config.php file.

On the issue of quotes. I have been using this plugin myself extensively for quite some time, and I have not been able to reproduce the behavior you describe, however, I have heard from at least one other person who has had that problem.

Try the following:

In your public_html/staticpages/index.php, change line 93 to be as follows.

Text Formatted Code
$retval.=eval_php_and_html(stripslashes($A['sp_content']));


I have several geeklog installs, and on all of my installs, this results in too many slashes being stripped away, but if you are having the problem of slashes being added, this should fix it.

If anyone else has had this problem, please let me know, particularly, if you can track down why it is happening.

Thanks,

Exaurdon~
 Quote

tokyoahead

Anonymous
Well actually I am not so sure about the slashes as an error anymore. The problem seems to be ( I did not have the time yet to test this throughout ) that the text of HTML/PHP, once saved will be slashed. If you then edit the text again, it will be double-slashed, which is the actual problem.

so one would have to go and remove all the slashes again before saving again. It might be the best to remove all the slashes before displaying the text in the editor. Wouldnt it be better to work with urldecode/encode?

thanks for the support and the acutally great plugin :-)
 Quote

Status: offline

exaurdon

Forum User
Regular Poster
Registered: 08/13/03
Posts: 107

so one would have to go and remove all the slashes again before saving again. It might be the best to remove all the slashes before displaying the text in the editor.


Ok, I'm sorry, You are correct, I told you to edit hte wrong file. If you look at pulbic_html/admin/plugins/staticpages/index.php on line 301, you will see that I commented out the strip slashes command there, and replaced it with teh line immediately above. The reason for this, was that I was experiencing the opposite problem. If you reverse the commenting, it should work for you.

Out of curiosity, what version of PHP are you using? I'm wondering if the htmlspecialchars or stripslashes functions have changed recently.

Thanks,

Exaurdon~
 Quote

tokyoahead

Anonymous
I will try it. I am using PHP Version 4.3.2
 Quote

Status: offline

xspace

Forum User
Regular Poster
Registered: 03/04/03
Posts: 100
I was facing wat Tokyo was having. Solved with the b/m recommendation

Quote by exaurdon:


so one would have to go and remove all the slashes again before saving again. It might be the best to remove all the slashes before displaying the text in the editor.




Ok, I'm sorry, You are correct, I told you to edit hte wrong file. If you look at pulbic_html/admin/plugins/staticpages/index.php on line 301, you will see that I commented out the strip slashes command there, and replaced it with teh line immediately above. The reason for this, was that I was experiencing the opposite problem. If you reverse the commenting, it should work for you.



Out of curiosity, what version of PHP are you using? I'm wondering if the htmlspecialchars or stripslashes functions have changed recently.



Thanks,



Exaurdon~

Die young, stay Pretty
 Quote

tokyoahead

Anonymous
Quote by exaurdon:


Ok, I'm sorry, You are correct, I told you to edit hte wrong file. If you look at pulbic_html/admin/plugins/staticpages/index.php on line 301, you will see that I commented out the strip slashes command there, and replaced it with teh line immediately above.


Well actually when I did this, it did NOT work. It prevented me from seeing the actual page in the end. When saving, it was saved without the slashes, and when calling it, the slashes would be there.

So I figured out my own way. I realized that the creation of the slashes during saving were good, but for editing it and for displaying it, the slashes had to disappear.

Therefure, I editet the following lines:

Line 93 in the public_html/staticpages/index.php:
$retval.=eval_php_and_html(stripslashes($A['sp_content']));
(as you said first)
and also adding after line 339
$A['sp_content'] = stripslashes ($A['sp_content']);
in admin/plugins/staticpages/index.php

Now, for saving the slashes are added, for editing removed, and for displaying also removed.

I am not sure if this will help 100%. But it seems right so far... any comments?
 Quote

Status: offline

exaurdon

Forum User
Regular Poster
Registered: 08/13/03
Posts: 107
Hey,

Thanks for looking into that. As I mentioned, I hadn't had problems with that, but as some people had, I'm sure this information will be of some use. I will also try incorporating your code into the next release I make on the staticpages plugin.

Thanks again,

Exaurdon~
 Quote

Status: offline

xspace

Forum User
Regular Poster
Registered: 03/04/03
Posts: 100
What I have done was the editing of line 93, and line 301 of the various files. Viewing after it's save and while editing were fine. Calling seems fine also.

Big Grin
Die young, stay Pretty
 Quote

All times are EDT. The time is now 10:58 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content