php-general Digest 28 Aug 2010 04:32:22 -0000 Issue 6914

Topics (messages 307718 through 307721):

Re: two questions on serverside validation
        307718 by: Jan G.B.

Re: Making multiple RSS feeds for the blog website
        307719 by: Andre Polykanine

Surge 2010 Early Registration ends Tuesday!
        307720 by: Jason Dixon

Printing in columns
        307721 by: Ashley M. Kirchner

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
2010/8/27 Jan G.B. <[email protected]>:
> But make sure the other code which we don't see
> - does not outpot any _POST / _GET / _REQUEST / _COOKIE variables
> without encoding the contents (f.e. htmlspecialchars), or
> - does not send and user supplied data without scaping the sb-related
> special chars.. (f.e. mysql_real_escape-string).
>
Hell.. Actually I wanted to write "output", "escaping" and
"db-related". Are typo corrections accepted here?! :)

--- End Message ---
--- Begin Message ---
Hello Michelle,

Hm. link rel="alternate"... that's a good one, thanks (btw, you say me
that I should RTFM, but if I knew what to read....).
Now there are two questions:
1. How do I do those .RSS files with PHP? All of mmy blog entries and
other stuff are in MySql. There are classes that can echo the
appropriate data as RSS, but there will be more .PHP files, not
.RSS/.XML ones. So how do we manage that?
2. Should I make a separate .RSS file for each type of feeds (blog
feed, comments feed, timeline feed, news feed)?
                                                thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

----- Original message -----
From: Michelle Konzack <[email protected]>
To: [email protected] <[email protected]>
Date: Friday, August 27, 2010, 3:31:58 AM
Subject: [PHP] Re: Making multiple RSS feeds for the blog website

Hello Andre Polykanine,

Am 2010-08-27 02:52:48, hacktest Du folgendes herunter:
> Hi everyone,
> We are developing a blog service website.

Very interesting  ;-)

> Question: how do we do that with PHP?

By reading the Documentation...  :-D

<html>
<head>
<title>Blubber Blog</title>
  <link rel="alternate" type="application/rss+xml" title="RSS" href="index.rss" 
/>
  <link rel="alternate" type="application/rss+xml" title="Foo" href="foo.rss" />
  <link rel="alternate" type="application/rss+xml" title="Bar" href="bar.rss" />
</head>
<body>


Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL       itsyst...@tdnet UG (limited liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber [email protected]
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


--- End Message ---
--- Begin Message ---
Early Bird Registration for Surge Scalability Conference 2010 ends next
Tuesday, August 31.  We have a killer lineup of speakers and architects
from across the Internet.  Listen to experts talk about the newest
methods and technologies for scaling your Web presence.

http://omniti.com/surge/2010/register

This year's event is all about the challenges faced (and overcome) in
real-life production architectures.  Meet the engineering talent from
some of the best and brightest throughout the Internet:

John Allspaw, Etsy
Theo Schlossnagle, OmniTI
Bryan Cantrill, Joyent
Rasmus Lerdorf, creator of PHP
Tom Cook, Facebook
Benjamin Black, fast_ip
Christopher Brown, Opscode
Artur Bergman, Wikia
Baron Schwartz, Percona
Paul Querna, Cloudkick

Surge 2010 takes place at the Tremont Grand Historic Venue on Sept 30
and Oct 1, 2010 in Baltimore, MD.  Register NOW for the Early Bird
discount and guarantee your seat to this year's event!


-- 
Jason Dixon
OmniTI Computer Consulting, Inc.
[email protected]
443.325.1357 x.241

--- End Message ---
--- Begin Message ---
 

                I need some guidance here.  I've been fighting with this
problem for a few days now and not having a whole lot of luck.  I have some,
but I run into issues sooner or later.  So I'm hoping that someone here can
give me some ideas of how to better approach this, perhaps help with coding
as well.

 

                My data consists of a number of addresses in any number of
US states.  I need to format them as such:

 

                - have a title that consists of the state name, spanning the
full width of a

                - have all the addresses pertaining to that specific state
split into two columns and displayed below.

                - output everything to Letter size PDF.

 

                In very simple form, it looks something like this (hoping
this doesn't get mangled in formatting):

 

+-----------------------------------+

|           STATE NAME              |

+-----------------------------------+

|  Address 1      |   Address 5     |

|  Address 2      |   Address 6     |

|  Address 3      |   Address 7     |

|  Address 4      |                 |

+-----------------------------------+

 

                So far what I've been able to get done is so the data
sorting and matching up the addresses with their states.  I can format the
address the way I want them displayed and all.  All the way to where I start
outputting the data.  However .

 

                I have to account for page length so that my data doesn't
run past the page.  I have to account for the possibility that the current
state being processed will have some lines on one page and some more on the
next page . which is fine, but when that happens, I want the title repeated
on the next page like so: STATE NAME (Cont.)

 

                So here's how far I got:

                - grab data from CSV file

                - process/sort data

                - loop through data, line by line, inserting same state
addresses into an array()

                - when I encounter a new state, I move to output the current
contents of the array()

                - when it's time to output the array, I do:

                                - array_chunk($array, ceil(count($array)/2))

                                - output chunks into respective column

 

                The problem I have is when I reach the bottom of the page
while printing the first chunk.  Let's say I have 120 records to print, and
I only have room for 23 lines.  So initially the array gets split into two
chunks of 60 records each.  I start outputting data.  I reach the end of the
document and still have 37 lines left, so now what?

 

                Right now I'm thinking I need to take that remaining data,
merge it with the second chunk and start outputting that into the second
column till I reach the bottom of the page again (which would be 23 lines
later.)  At that point I will still have 74 record left (14 PLUS the initial
60 lines that was the original 2nd chunk.)  I start a new page, add the same
state name title, and go through the motions again of rechunking the
remaining data and outputting again.

 

                Does any of that even make sense?  Am I going on about it
the right way?  Is there a better way to do this to begin with?

 


--- End Message ---

Reply via email to