HighDots Forums  

OT: Getting rid of spaces in PHP docs

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss OT: Getting rid of spaces in PHP docs in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default OT: Getting rid of spaces in PHP docs - 02-01-2005 , 08:29 AM






I'm building a site using Mambo CSM, which is PHP and MySQL generated pages.
When viewing the pages' source in a browser, I'm about to be sick. The
code is scattered all over the place and it's virtually impossible (or
at least time consuming) to search for certain snippets, etc. Some of
the pages are actually the worse I have seen...

Someone (Thierry?) was fiddling with some script, and I tried an online
gadget that removed spaces a couple of months ago (which, regretfully,
also nuked some legitimate stuff), but I wonder:

1. Are there any WORKING gadget available to clean up the code?
2. Since most pages are dynamic, is it even possible?

TIA
--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml or call/chat me via
Skype ID: danvendel, but DON'T ask questions that you can ask here! (get
Skype at http://skype.com)
Formmail tutorial: http://www.proformica.com/formmail-tutorial.shtml
Nested table demo: http://www.proformica.com/nested-table-demo.shtml
Basic HTML bulk mail tutorial: http://www.proformica.com/bulkmail.shtml
Search engine optimization: http://www.proformica.com/seo.shtml

Reply With Quote
  #2  
Old   
Mick White
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 08:58 AM






Dan Vendel *GOF* wrote:

Quote:
I'm building a site using Mambo CSM, which is PHP and MySQL generated
pages.
When viewing the pages' source in a browser, I'm about to be sick. The
code is scattered all over the place and it's virtually impossible (or
at least time consuming) to search for certain snippets, etc. Some of
the pages are actually the worse I have seen...

Someone (Thierry?) was fiddling with some script, and I tried an online
gadget that removed spaces a couple of months ago (which, regretfully,
also nuked some legitimate stuff), but I wonder:

1. Are there any WORKING gadget available to clean up the code?
2. Since most pages are dynamic, is it even possible?

TIA
Did you try - Commands >> Apply Source Formatting ?
Mick


Reply With Quote
  #3  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 09:13 AM



Mick White wrote:

Quote:
Did you try - Commands >> Apply Source Formatting ?
Mick
No.
The pages don't exist, like physical ones, but built by modules in a
database and delivered on request. Here's a sample of the disaster (if
it propagates so you'll see it as I do...):

http://thebusinessonline.com/rss/feed.php?st=fp </td>
<td width="100%"></td>
</tr>
</table>
</td>

</tr>
<tr>
<td>&nbsp;

</td>
</tr>
<tr>
<td>
<ul>

<li>

<b>
Europe </b>
&nbsp;
<span class="small">
(2)
</span>
</li>

<li>
<a href="index.php?option=com_newsfeeds&amp;catid=68& amp;Itemid=37"
class="category">

World News
</a>
&nbsp;
<span class="small">

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml or call/chat me via
Skype ID: danvendel, but DON'T ask questions that you can ask here! (get
Skype at http://skype.com)
Formmail tutorial: http://www.proformica.com/formmail-tutorial.shtml
Nested table demo: http://www.proformica.com/nested-table-demo.shtml
Basic HTML bulk mail tutorial: http://www.proformica.com/bulkmail.shtml
Search engine optimization: http://www.proformica.com/seo.shtml


Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 09:16 AM



Dan Vendel *GOF* wrote:

Quote:
2. Since most pages are dynamic, is it even possible?
Bingo! The problem that causes the ugly formatting is in the script that
writes the code. Your cleanup would have to be done there.


Gary


Reply With Quote
  #5  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 09:22 AM



Gary White wrote:

Quote:
Bingo! The problem that causes the ugly formatting is in the script that
writes the code. Your cleanup would have to be done there.
OK, I'll take a shot at it. *With* backups....
(BTW: The sample newsfeed you have at your site isn't working)
Thanks.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml or call/chat me via
Skype ID: danvendel, but DON'T ask questions that you can ask here! (get
Skype at http://skype.com)
Formmail tutorial: http://www.proformica.com/formmail-tutorial.shtml
Nested table demo: http://www.proformica.com/nested-table-demo.shtml
Basic HTML bulk mail tutorial: http://www.proformica.com/bulkmail.shtml
Search engine optimization: http://www.proformica.com/seo.shtml


Reply With Quote
  #6  
Old   
Joe {RoastHorse}
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 10:26 AM



dynamically generated code can be incredibly messy unless you take the
time to make sure the script outputs nicely formatted text.


joe




Dan Vendel *GOF* wrote:
Quote:
I'm building a site using Mambo CSM, which is PHP and MySQL generated
pages.
When viewing the pages' source in a browser, I'm about to be sick. The
code is scattered all over the place and it's virtually impossible (or
at least time consuming) to search for certain snippets, etc. Some of
the pages are actually the worse I have seen...

Someone (Thierry?) was fiddling with some script, and I tried an online
gadget that removed spaces a couple of months ago (which, regretfully,
also nuked some legitimate stuff), but I wonder:

1. Are there any WORKING gadget available to clean up the code?
2. Since most pages are dynamic, is it even possible?

TIA
--

=================================

Kanzo Limited
www.kanzostudio.com

=================================


Reply With Quote
  #7  
Old   
Gary White
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 10:52 AM



Dan Vendel *GOF* wrote:

Quote:
OK, I'll take a shot at it. *With* backups....
(BTW: The sample newsfeed you have at your site isn't working)
Thanks.

Hmmm ... You mean this one?
http://apptools.com/phptools/xml/rssclient.php

It seems to be working for me.


Gary


Reply With Quote
  #8  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 10:59 AM



Joe {RoastHorse} wrote:
Quote:
dynamically generated code can be incredibly messy unless you take the
time to make sure the script outputs nicely formatted text.
Yeah, I've noticed. :-\
But how do I do that?
Is it to open every file and reformat the code? But if so, I don't
understand how that eventually will affect the pages?

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml or call/chat me via
Skype ID: danvendel, but DON'T ask questions that you can ask here! (get
Skype at http://skype.com)
Formmail tutorial: http://www.proformica.com/formmail-tutorial.shtml
Nested table demo: http://www.proformica.com/nested-table-demo.shtml
Basic HTML bulk mail tutorial: http://www.proformica.com/bulkmail.shtml
Search engine optimization: http://www.proformica.com/seo.shtml


Reply With Quote
  #9  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 11:00 AM



Gary White wrote:


Quote:
Hmmm ... You mean this one?
http://apptools.com/phptools/xml/rssclient.php

It seems to be working for me.
No, I meant http://apptools.com/phptools/xml/rssexample.php
But it's OK now.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml or call/chat me via
Skype ID: danvendel, but DON'T ask questions that you can ask here! (get
Skype at http://skype.com)
Formmail tutorial: http://www.proformica.com/formmail-tutorial.shtml
Nested table demo: http://www.proformica.com/nested-table-demo.shtml
Basic HTML bulk mail tutorial: http://www.proformica.com/bulkmail.shtml
Search engine optimization: http://www.proformica.com/seo.shtml


Reply With Quote
  #10  
Old   
Joe {RoastHorse}
 
Posts: n/a

Default Re: OT: Getting rid of spaces in PHP docs - 02-01-2005 , 11:23 AM



eg to output this very simple example:

<ul>
<li>item 1</li>
<li>item 2</li>
</ul>

make sure you output all the correct linebreaks and spaces:

echo "<ul>\n";
echo " <li>item 1</li>\n";
echo " <li>item 2</li>\n";
echo "</ul>\n";


joe





Dan Vendel *GOF* wrote:
Quote:
Joe {RoastHorse} wrote:

dynamically generated code can be incredibly messy unless you take the
time to make sure the script outputs nicely formatted text.


Yeah, I've noticed. :-\
But how do I do that?
Is it to open every file and reformat the code? But if so, I don't
understand how that eventually will affect the pages?

--

=================================

Kanzo Limited
www.kanzostudio.com

=================================


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.