You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 2 of 6)
Oh, I see. I already saw that thread but didn't know how to use it for my case. Now I see the thing to do is to convert all the \n to <br />, then add the paragraphs -- two steps. Thanks a lot.
Gosh, you're so smart. Guess that's why they call you that.
This sounds easier to do that I expected it to be. PHP continually amazes me at how easy it is to use. I'll let you know how it goes. Thanks again.
Text for a webpage is stored in a MySQL database. In the database, the text is grouped into paragraphs that are separated by linebreaks. How do you take that text from the database and add the HTML tags so that it displays on the webpage properly?
adding <br /> for a single linebreak,
and adding
</p>
<p> for two linebreaks in a row.
If I'm going about this wrong then please correct me. Basically what I'm trying to do is learn how to make my database text display on a webpage with the correct HTML tags.
I did this about a year ago for the news feeds on FreeSquid.org. Things may have changed since then, but at the time these were good:
* SitePoint tutorial on Parsing RSS 1.0 -- http://www.sitepoint.com/article/php-xm … ng-rss-1-0
* MagpieRSS parser (sourceforge) -- http://magpierss.sourceforge.net/
* MyHeadlines webscraper (sourceforge) -- http://sourceforge.net/projects/myheadlines/
(edited)
Oh wait -- you want to create a feed. Sorry, I misunderstood. In that case, try reading the post in the thread I mentioned earlier where the guy (Kev) gives the basic code for writing your own feed. You also might try studying the feed generator for punBB. I think it's in the extern.php file.
But now with the pressure to be cool, that may all change:
I hope you're running PunBB 1.2.8. It's what all the cool people are doing.
badrad wrote:This constant attention is definitely a good thing, even though it shows how lazy I am. My Punbb is a franken 1.5 beast. I am still procrastinating a proper update as I know I'll have to rewrite a bunch of my forum anyway.
Lazyness!
You and me both! I'm still on 1.5.1 -- it's so old that the process of updating it involves several extra steps that sound intimidating (plus maybe I'm a little bit lazy ).
I have a simple events calendar set up: http://tuckertoday.com/events/
* The tables were created by writing a query and entering it through phpMyAdmin;
* Data was entered manually through phpMyAdmin (I'll create a webform later);
* and Results are displayed on the webpage using some basic MySQL and PHP commands.
My question is:
For a large block of text that includes several parapraphs, linebreaks, lists, links, etc, how should the HTML tags be added to the data? I think I understand in theory what I should do -- the data from the database gets processed through a RegExp and/or parser.php and linebreaks are converted to BR tags and BBCode is converted to other tags. Something like that anyway. Can anyone give me some pointers? I'll study the punBB source to see how it does it, but some guidance would be appreciated because I'm still new at this.
Related Threads:
Reg Exp -- http://punbb.org/forums/viewtopic.php?id=8899
-
Oh, that is so simple. Thanks!
Thanks, CodeXP.
That reminds me, I need to add more smileys to my forum.
I'm having trouble figuring out TIMESTAMPs.
I want to create a table with a `posted_on` column and an `edited_on` column. The first one would be set once and stay that value (not auto-update), and the second one would begin with no value and only get the current timestamp if the row is updated. It seems a simple thing to ask, but I've spent hours studying the online manual and it still doesn't make sense.
What's a good way to do it? This is my latest guess:
Create the table with these:
`posted_on` TIMESTAMP NULL DEFAULT 0,
`edited_on` TIMESTAMP NULL DEFAULT 0,
And insert values when posting or editing with:
INSERT INTO t2 VALUES (CURRENT_TIMESTAMP);
So there's no more auto-updating; it just updates when a query tells it to.
How do you type '»'? I noticed it's used in the breadcrumb trail. I thought there might be an ascii code for it, but everytime I find it on a website and view source it's simply typed in. What's the secret keyboard combination for typing it? Offtopic, I know -- thanks though.
But wait! I never got around to upgrading to 1.2.6 -- I missed out.
That bothers me. Flat-file databases are a waste of resources. I'd rather use a MySQL database. Singapore doesn't work in mysql yet, does it?
Which of the many Photo Galleries is considered "best"? It sounds like the top 2 are Gallery and Coppermine. I'm looking for something that's coded well and is secure -- something comparable to punbb and wordpress. I've heard of Gallery having security issues so I'm leaning towards Coppermine at the moment.
I'm pleased to announce the release of PunBB 1.2.6.
Yeah! I've been looking forward to this. I think now I'll go ahead and upgrade from 1.1.5, as well as install one or two new forums that have been in the works for several months. I really have been looking forward to the 1.2.6 upgrade. Thanks very much.
In Soviet Russia, road forks you!
OK, what's that all about? It's the second time I've seen that joke -- the other one was, "In Soviet Russia... Websites develop YOU!".
(I like your idea of having a standard set of 'necessary mods'.)
I read your blog entry on FreeBSD. Interesting stuff -- I might actually try that someday.
I should probably buy a book an MySQL and learn some database basics. I've gotten by mostly on guessing up to this point.
Any word on a potential 1.2.6 coming out soon?
Thanks. I just read your post again and it makes sense now -- didn't pay enough attention the first time I read it. What you say to do seems obvious now.
Download PunBB 1.2 and copy over all your files with those
Get the 11_to_12_update.php script and run it
Download PunBB 1.2.5, overwrite the files, and run the update script in the extras folder there
I've also been a very bad forum admin. The version I'm running is 1.1.5 -- is there any trick or potential problem to upgrading to 1.2.5? Or do you think it should go smoothly if I simply follow the directions that come with 1.2.5 for upgrading?
I guess what I'm really asking is, is 1.2.5 stable enough to install and use for a while? Or should I wait for another release that might be coming out soon?
Did you ever have a chance to add the changes to 1.2.5? Or do we still need to do them ourselves. Or maybe 1.2.6 is coming out in the next couple of days? Just curious.
Something like this? (a lookup table that lists the categories for each event)
'events'
ID Event_date Etc
1 -
2 -
3 -
4 -
'categories'
ID Category
1 meeting
2 festival
3 tca
'event_category_lookup'
Event_ID Category_ID
1 1
1 3
2 2
2 3
In other words, what is a good way to set up the table in order to sort by category?
cat=meeting => 1,2
cat=cmnty => 1,3
etc
If anyone understands databases better than I do, I'd appreciate some help. Thanks.
What's a good way to set up the database for multiple categories? I'm writing a cms for an events calendar. Each event falls in any of several categories. What's the best way to set up the database table so that it can be sorted by category?
* One column with each row containing a list of categories (separated by commas or whatever)?
* One column with each row containing a list of category_ids (and a separate table 'categories')?
* One column for each category, containing the value 1 or 0?
Example:
id | date | location | category | moderators
```````````````````````````````````````````````````
1 | | |meeting,cmnty,tca|
2 | | |meeting,tca |
3 | | |festival,comnty |
Posts found: 26 to 50 of 145