Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro
Author Message
probador
New Member
New Member


Joined: Apr 20, 2006
Posts: 24

PostPosted: Sat Apr 22, 2006 11:50 am Reply with quote

Hi

WYSIWYG is great Very Happy ; I use it all the time to post news. However, when I create pages with the content module, it keeps some of the HTML such as tables, images, etc.. but removes all the style applied to the text such as color, font, size, etc...

It's like CSS would overrride but that does not happen when using WYSIWYG on blocks creation, news module, etc...

I'm pretty sure it is not a problem of WYSIWYG, since when I re-edit the content page it is shown corrrectly, but rather a problem of the content module, but I am not sure of where to start this thread...

I tried to change the $AllowableHTML but nothing seems to change. I need content to take the WYSIWYG style into account, obviously without changing the css for the rest of the web.

Any ideas?? Thanks in advance.
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Sat Apr 22, 2006 1:15 pm Reply with quote

Welcome to RavenPHPScripts.com!

I haven't looked at the content module in a while, but would guess that it might have extra code that is causing this. Let me take a look - maybe it's doing some unnecessary things...

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
probador
PostPosted: Sat Apr 22, 2006 7:06 pm Reply with quote

Thanks for your interest.
 
probador
PostPosted: Mon Apr 24, 2006 4:29 am Reply with quote

Still no clue what is going on....

This is the code for the content module:

Code:
function showpage($pid, $page=0) {

    global $prefix, $db, $sitename, $admin, $module_name;
    include("header.php");
    OpenTable();
    $pid = intval($pid);
    $mypage = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE pid='$pid'"));
    $myactive = intval($mypage['active']);
    $mytitle = stripslashes(check_html($mypage['title'], "nohtml"));
    $mysubtitle = stripslashes(check_html($mypage['subtitle'], "nohtml"));
    $mypage_header = stripslashes($mypage['page_header']);
    $mytext = stripslashes($mypage['text']);
    $mypage_footer = stripslashes($mypage['page_footer']);
    $mysignature = stripslashes($mypage['signature']);
    $mydate = $mypage['date'];
    $mycounter = intval($mypage['counter']);
    if (($myactive == 0) AND (!is_admin($admin))) {
   echo "Lo siento, esta página no existe.";
    } else {
   $db->sql_query("UPDATE ".$prefix."_pages SET counter=counter+1 WHERE pid='$pid'");
   $date = explode(" ", $mydate);
   echo "<font class=\"title\">$mytitle</font><br>"
      ."<font class=\"content\">$mysubtitle<br><br><br><br>";
   $contentpages = explode( "<!--pagebreak-->", $mytext );
   $pageno = count($contentpages);
   if ( empty($page) || $page < 1 )
       $page = 1;
   if ( $page > $pageno )
       $page = $pageno;
   $arrayelement = (int)$page;
   $arrayelement --;
   if ($pageno > 1) {
       echo ""._PAGE.": $page/$pageno<br>";
   }
   if ($page == 1) {
       echo "<p align=\"justify\">".nl2br($mypage_header)."</p><br>";
   }
   
   
//Here the text is printed on the screen

   echo "<p align=\"justify\">$contentpages[$arrayelement]</p>";


I guess the problem does have sth to do with "arrayelements" but I can't come up with more ideas... The funny thing is that under admin the content is saved correctly and if a Edit it it is displayed correctly under the WYSIWYG editor....

Help!!
 
probador
PostPosted: Mon Apr 24, 2006 4:54 am Reply with quote

Now I changed:

Code:
echo "<p align=\"justify\"><font class=\"content\">$contentpages[$arrayelement]</font></p>";


for:

Code:
 echo "$mytext\n";


These are the lines on news module to print the bodytext of the piece of news (where it is displayed correctly).

The result is: It is still losing its style. This means that
a) $mytext is already formatted like that ???
b) There is other code that is formatting the whole content module like that.


Any ideas??
 
defibber
Hangin' Around


Joined: Apr 17, 2006
Posts: 46
Location: Kansas City Area

PostPosted: Tue Apr 25, 2006 1:59 pm Reply with quote

I am not sure if this is the right spot but I have been trying to add Content pages into my site. How do I adjust the Font Size? I tried <font size="7, <font="+2, etc. But they don't seem to work. The <h1, <h2..... work. Is this something I am going to have to modify the code like you are showing above?

Defiber
 
View user's profile Send private message
probador
PostPosted: Tue Apr 25, 2006 3:16 pm Reply with quote

I haven't come up with the solution yet. For the moment I am using WYSIWYG with span tags.

Good luck.
 
defibber
PostPosted: Tue Apr 25, 2006 3:19 pm Reply with quote

how do you use the span tags?
 
probador
PostPosted: Tue Apr 25, 2006 3:24 pm Reply with quote

well you define a class on your CSS file of your theme with the type of letter etc...
e.g.:

Code:
.BIG { font: 22px verdana, sans-serif; color: #3D3D3D; }


Then you can call it with html

Code:
<span class="BIG">This would appear big</span>

 
defibber
PostPosted: Tue Apr 25, 2006 3:27 pm Reply with quote

OK , I tried the style before but I will try it again with the Span. THanks
 
defibber
PostPosted: Wed Apr 26, 2006 2:53 pm Reply with quote

I am having internitten luck with the Span thing. It works for somethings but not others

For example if you look at Only registered users can see links on this board! Get registered or login! The majority of the text should be the same size.

Here is the code:
Quote:

<h3 align="center">Please call (816) 628-4122 before you burn or to ask questions</h3>
<table>
<td width="60%"><span class="content_1">In order to burn in the Kearney Fire & Rescue Protection District you need to fill out and submit a Missouri DNR Burn Permit to the Kearney Fire Department. We then forward it on to Missouri DNR for Final approval (usually takes a few days). We then contact you and let you know if it was approved or denied.</span><p>Download/Print a Mo. DNR Permit from <a href="../downloads/burn_permit.pdf"><u>Here</u></a></td>
<td width="40%"><a href="http://www.fs.fed.us/land/wfas/fd_class.gif"><img width="280" vspace="10" hspace="10" height="197" border="1" align="right" alt="Fire Danger Rating Continental Map" src="http://www.fs.fed.us/land/wfas/fd_class.gif" /></a></td>
<tr>
<td><span class="content_1">The Kearney Fire District is considered part of the Mid-America Regional Council Group so we ask that you restrict your burning to "Green Days".</span><p>Visit the Mid-Americal Regional Council <a href="http://www.marc.org"><u>Here</u></a></td>
<td><img src="http://www.marc.org/airquality/alert.gif" width="439" height="70" border="0"></td>
</table>
<br>

<H3>SECTION 210.615:&nbsp; &nbsp; &nbsp;REGULATION OF OPEN BURNING IN THE CITY LIMITS OF KEARNEY, MISSOURI</H3>

<span class="content_1"><P>A.&nbsp; &nbsp; &nbsp;No person shall burn or cause to be burned any sweepings, trash, paper, lumber, straw, hay, leaves or any combustible material with the exception of:</P></span>
<span class="content_1"><P>&nbsp; &nbsp; &nbsp;1.&nbsp; &nbsp; &nbsp;Vegetable or flower gardens may be burned.</P></span>
<span class="content_1"><P>&nbsp; &nbsp; &nbsp;2.&nbsp; &nbsp; &nbsp;Agricultural fields may be burned.</P></span>

<span class="content_1"><P>The burning of the above exceptions shall only be allowed between the hours of sunrise and sunset and person in charge of fire shall be in constant attendance with a water supply ready to quench the fire if same is within twenty (20) feet of a structure.</P></span>
<span class="content_1"><P>B.&nbsp; &nbsp; &nbsp;Nothing in this Section shall prevent the making of fires on proper occasions, providing permission is first obtained from the Chief of the Fire Department.</P></span>
<span class="content_1"><P>C.&nbsp; &nbsp; &nbsp;The use of the term <I>&quot;Fire Chief&quot; </I>in this Section shall mean the Fire Chief of the Kearney Fire and Rescue Protection District unless the Board of Aldermen designates otherwise.</P></span>
<span class="content_1"><P>D.&nbsp; &nbsp; &nbsp;Any person violating the provisions of this Section shall upon conviction thereof be punished by a fine not exceeding one hundred dollars ($100.00) for each such violation.&nbsp; (Ord. No. 476-87&nbsp;&sect;&sect;2--4, 8-24-87; Ord. No. 548-91&nbsp;&sect;1, 6-17-91)</span></P></span>


any ideas?
 
kguske
PostPosted: Wed Apr 26, 2006 8:42 pm Reply with quote

I seems like a theme / css thing. If you preview this using submit news at Only registered users can see links on this board! Get registered or login! you can see that most of the text is the same size.
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9453
Location: Arizona

PostPosted: Thu Apr 27, 2006 5:58 am Reply with quote

Sorry to butt in here as I don't have much knowledge of the editor, however, I am noticing invalid HTML and wondering if that is causing the issue:

Code:


<span class="content_1"><P>The burning of the above exceptions shall only be allowed between the hours of sunrise and sunset and person in charge of fire shall be in constant attendance with a water supply ready to quench the fire if same is within twenty (20) feet of a structure.</P></span>


You cannot enclose a block tag (P tag) within an in-line tag (span). You could try "div" instead of "span" and see if that helps? Actually, I wonder if the CSS on the P tag is overwriting the style of the span... if they are both defined and P is given a conflicting style I cannot recall which one "wins".

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
defibber
PostPosted: Thu Apr 27, 2006 8:17 am Reply with quote

OK thanks, I am new to HTML and newer to NUKE so I wasn't 100% sure which one goes first. And I have seen DIV but not sure what it does. I will give it a try.

Thanks
 
montego
PostPosted: Thu Apr 27, 2006 10:42 pm Reply with quote

I am not quite sure how the FCKEditor handles this, so would definitely appreciate you giving us a report on how it goes. We're going to incorporate it into the next release as standard, so would like to get it as "robust" as possible.

Thanks!
 
defibber
PostPosted: Fri Apr 28, 2006 2:38 pm Reply with quote

That's cool. I have notice a huge difference between the way IE and Firefox read it. I re-did one of my content pages and seem to have fairly good luck with it. I had to add my own CSS code in the top to get it to work though but Firefox doesn't like the color code.

I tried to post the code but it wouldn't let me Sad

When I get the CSS to work it is hit or miss on working. I have even tried Copy and Paste from Word to the content editor (not the source), and it is still inconsistent.
 
defibber
PostPosted: Fri Apr 28, 2006 4:51 pm Reply with quote

My WYSIWYG editor and the regular entry boxes are gone!!! I was working with my Content pages and they all disappeared


Edited: They came back but I got banned from the IP I was working from Confused

I started using this code
Quote:

<head>
<STiLE type="text/css">

<!--
td {color: #000000; FONT-SIZE: 14px; FONT-FAMILY: Verdana, Helvetica,sans-serif; ! important}
.heading {color: #FF0000; text-align: center; FONT-SIZE: 20px; FONT-FAMILY: Verdana, Helvetica,sans-serif; ! important}
.content_2 {color: #000000; FONT-SIZE: 16px; FONT-FAMILY: Verdana, Helvetica,sans-serif; ! important}
-->


</STiLE>
</head>

<bidy>
<P><div class="heading">FIRE DEPARTMENT HISTORY FROM RECORDS OF COUNCIL MEETING MINUTES</div></p>
<table>
<td width="10%" align="center" valign="top">2-2-48</td> <td width="90%">The condition of the hose on fire truck was discussed and Mayor Bratton agreed to check on it and report back to board.</td><tr>
</table>
</bidy>

No I did not misspell Body or Style but I had to do it in order to post.

Interesting part though, it changed the font on the blocks and everything else< but in firefox the "heading" is small.

In IE, Blocks enlarged and the content was correct.
 
defibber
PostPosted: Sat Apr 29, 2006 12:14 pm Reply with quote

I have been fighting the WYSIWYG editor for awhile because I import the code into the "source" then when I click ok it likes to add <p>&nbsp;</p> and it really messes up the page. I have gone back through the code in NoteTab Pro and there is nothing there but when I paste it into the editor Source window and click ok it throws them in there.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©