when i click edit article i get a blank page

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

Have said this a bunch so I don't know if i suggested it yet in this thread but you have to be very careful with the magic_quotes. Make sure they are turned off in the php.ini. If they are not turned off and you don't have access to the php.ini file then you can use the .htaccess file that comes with phpwcms to turn it off locally. If things just aren't working even though the quotes are set correctly then you can try going to the include/inc_tmpl/article.edit.inc.php (whatever file is called to add/edit an article) and taking the $article variable out of the aporeplace function. this escapes quotes and slashes in the sql format like " -> "" which will make an article which is in quotes I assume look like this $article = ""mytext""; So it is essentially nothing so you won't see an article on the site. I hope this might help you work things out.
cmslover
Posts: 86
Joined: Wed 18. Feb 2004, 16:17
Location: USA, Georgia, Atlanta
Contact:

Post by cmslover »

Hi pSouper,

I installed phpwsm right inside my domain root no directory so the second line in your code above I left it blank, don't know what to put in , though. But I have tried both document path ( host/local/domain.com/ )and web path http://domain.com/- you know I just tried out everything for the last two day- still go nowhere, maybe I should install it in a directory? :cry:
cmslover
Posts: 86
Joined: Wed 18. Feb 2004, 16:17
Location: USA, Georgia, Atlanta
Contact:

Post by cmslover »

ionrock wrote:Have said this a bunch so I don't know if i suggested it yet in this thread but you have to be very careful with the magic_quotes. Make sure they are turned off in the php.ini. If they are not turned off and you don't have access to the php.ini file then you can use the .htaccess file that comes with phpwcms to turn it off locally. If things just aren't working even though the quotes are set correctly then you can try going to the include/inc_tmpl/article.edit.inc.php (whatever file is called to add/edit an article) and taking the $article variable out of the aporeplace function. this escapes quotes and slashes in the sql format like " -> "" which will make an article which is in quotes I assume look like this $article = ""mytext""; So it is essentially nothing so you won't see an article on the site. I hope this might help you work things out.
Hi Ionrock,

in inlude/inc_tmpl there are 2 files: article.editsummary.tmpl.php and articlecontent.edit.tmpl.php--> this file from Siprou ( content position ).
Below is a copy of article.editsummary.tmpl.php, could you tell me what to command out?



Code: Select all

		//load spaw editor
		/*case 4: include(PHPWCMS_ROOT."/include/inc_ext/spaw/spaw_control.class.php") ;
				$sw = new SPAW_Wysiwyg( 'article_summary', 
									$article["article_summary"], 
									$_SESSION["wcs_user_lang"],
									'article_summary',
									'default', 
									'440px',
									'400px'
								   );
				$sw->show();
				break;					
	*/
	   default:	$article["article_summary"] = str_replace('<br>', "\n", $article["article_summary"]);
				$article["article_summary"] = str_replace('<br />', "\n", $article["article_summary"]);	   
	   			echo "<textarea name="article_summary" rows="20" wrap="VIRTUAL" class="f11" id="article_summary" ";
				echo "style="width: 440px; background-color: #ffffff;">".html_specialchars($article["article_summary"])."</textarea>";	

	}
?></td>
			 </tr>
			<tr><td colspan="2"><img src="img/leer.gif" width="1" height="10"></td></tr>
			<?php 
			if($_SESSION["wcs_user_admin"]) {
			
			?>
			<tr>
				<td align="right" class="chatlist"><?php echo $BL['be_article_articleowner'] ?>:&nbsp;</td>
				<td><table cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td><select name="article_uid" id="article_uid" style="width: 300px" class="f11b">
				<?php
				$u_sql = "SELECT usr_id, usr_name, usr_login, usr_admin FROM ".DB_PREPEND."phpwcms_user WHERE usr_aktiv=1 ORDER BY usr_admin DESC, usr_name";
				if($u_result = mysql_query($u_sql, $db)) {
					while($u_row = mysql_fetch_row($u_result)) {
						echo '<option value="'.$u_row[0].'"';
						if($u_row[0] == $article["article_uid"]) echo ' selected';
						if(intval($u_row[3])) echo ' style="background-color: #FFC299;"';
						echo '>'.html_specialchars(($u_row[1]) ? $u_row[1] : $u_row[2]).'</option>'."\n";
					}
					mysql_free_result($u_result);
				}
Many thanks!
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

aporeplace is VERY IMPORTANT!!!!! Never remove.

It does the following:

Code: Select all

function aporeplace($string_to_convert="") {
	//Ändert die einfachen Apostrophe für SQL-Funktionen in doppelte
	$string_to_convert = str_replace("\\", "\\\\", $string_to_convert);
	$string_to_convert = str_replace("'", "''", $string_to_convert );
	return $string_to_convert;
}
\ -> \\
' -> ''

and MySQL does the following:
\\ -> \
'' -> '

Regards
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

Oliver is right :)

If you are having problems the last resort would be to remove the aporeplace() function from the insert/update sql statement. Unless you have tried all the possibilities with the magic_quotes and the.htaccess file. The less you have to edit code the better and removing the aporeplace can make things more of pain if it breaks something else. So you have been warned ;)

But in any case you would be removing it from the insert or update statement. I would do a little research though before you mess with it too much. Oliver might have a better solution as I am sure he has a better understanding of it.
cmslover
Posts: 86
Joined: Wed 18. Feb 2004, 16:17
Location: USA, Georgia, Atlanta
Contact:

Post by cmslover »

Well I have magic quotes turned off using.htaccess, that didn't help with the editor either. Last night, i replaced the article.editsummary.tmpl to the file in the phpwcms older version, and I CAN SEE The text in the EDIT ARTICLE editor HOWEVER, there is NO buttons or anything like that to edit the article, unless i do hand code. Don't know if I'm close to something, wish me luck :?

Below is part of the file in the older version ( 15, 17 feb, 04 )

Code: Select all

			//load htmlarea
	   case 1:	echo "<style type=\"text/css\">\n<!--\n@import url(include/inc_ext/htmlarea/htmlarea.css);\n//-->\n</style>";	
	   			echo "<script language=\"Javascript\" type=\"text/javascript\">\n<!--\n_editor_url = \"include/inc_ext/htmlarea/\";\n";		
	   			echo "_editor_lang = \"".strtolower($_SESSION["wcs_user_lang"])."\";\n//-->\n</script>";
				echo "<script language=\"Javascript\" type=\"text/javascript\" src=\"include/inc_ext/htmlarea/htmlarea.js\"></script>";
	   			echo "<script language=\"Javascript\" type=\"text/javascript\" src=\"include/inc_lib/htmlarea.editor.inc.php\"></script>";
	   			echo "<table border=\"0\" width=\"440\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"#E7E8EB\">\n";
	   			echo "<tr><td><textarea name=\"article_summary\" rows=\"30\" wrap=\"VIRTUAL\" class=\"f10\" id=\"article_summary\" ";
				echo "style=\"height: 400px; width: 436px; background-color: #ffffff;\">".html_specialchars($article["article_summary"]);
				echo "</textarea></td></tr>\n</table>";
				echo "<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\ninitEditor('article_summary','436px','400px');\n//-->\n</script>";
				break;
				
				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $article["article_summary"] ;
				$oFCKeditor->CreateFCKeditor( 'article_summary', '100%', '400' ) ;
				break;
	
	   default:	$article["article_summary"] = str_replace('<br>', "\n", $article["article_summary"]);
				$article["article_summary"] = str_replace('<br />', "\n", $article["article_summary"]);	   
	   			echo "<textarea name=\"article_summary\" rows=\"20\" wrap=\"VIRTUAL\" class=\"f11\" id=\"article_summary\" ";
				echo "style=\"width: 440px; background-color: #ffffff;\">".html_specialchars($article["article_summary"])."</textarea>";	

	}
Any idea?
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

I think there might be some problems with spaw that we should look into further b/c it seems a lot of people are having problems with it. I was able to fix my own problems for one site but I haven't been able to get things to work on another site so I think there is something which is not consistant. I don't really know what to suggest in your situation as I do remember that I had to edit some files to get things to work correctly but I don't recall how exactly I did it. I will look at it more and see what I find but it sounds like you should try and look more at the spaw code to see what might be the problem. Sorry I can't be more help. Not a lot of time at the moment. :(
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

you did try my first peice of advice didn't you? (both points?)
- just so i know.
I realise that you should place the defin in the conf.inc.php and not in the default.inc.php but the sentiment it there ;)

I als oknow that you lose spaw but it is worth trying it just to see if it fixes your porblem and as a point to move on from
cmslover
Posts: 86
Joined: Wed 18. Feb 2004, 16:17
Location: USA, Georgia, Atlanta
Contact:

Post by cmslover »

pSouper wrote:you did try my first peice of advice didn't you? (both points?)
- just so i know.
I realise that you should place the defin in the conf.inc.php and not in the default.inc.php but the sentiment it there ;)

I als oknow that you lose spaw but it is worth trying it just to see if it fixes your porblem and as a point to move on from
Yes, pSouper, I did try them all, unfortunally, there is no better news :?
Have to wait for phpwcms' next version/update, maybe?
Post Reply