RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
Combining my news page with PHPbb
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
XMark
Guitar playin' black mage


Joined: 30 May 2002
Posts: 870
Location: New Westminster, BC, Canada

PostPosted: Fri Nov 21, 2003 11:51 pm    Post subject: Combining my news page with PHPbb [quote]

With my newfound PHP/MySQL skillz, I've figured out how to incorporate PHPbb's database into my web page, and I want to make it so that the "news" page operates entirely from the PHPbb database, allowing users to comment and such.

Quote:

$result = mysql_query("SELECT topic_title, post_text, topic_id FROM phpbb_topics, phpbb_posts_text WHERE phpbb_topics.topic_first_post_id = phpbb_posts_text.post_id AND forum_id = 3 ORDER BY topic_time DESC", $dbh);

if ($myrow = mysql_fetch_array($result)) {
do {
printf("<H3>%s</H3>\n", $myrow["topic_title"]);
printf("<P>%s</P>\n", $myrow["post_text"]);
printf("<A HREF = \"http://istories.abstract-productions.net/viewtopic.php?t=%s\">comments</A>\n", $myrow["topic_id"]);
} while ($myrow = mysql_fetch_array($result));
} else {
echo "No news updates!\n";
}


I've got it completely functional (though I haven't replaced the news page with it yet) but I just have one question: how do I make it so that it displays the bbCode stuff right? I looked into the PHPbb source code but it's really confusing.

EDIT:

And in another example of me answering my own questions, I side-stepped the whole bbCode issue by enabling HTML in the forums :)
_________________
Mark Hall
Abstract Productions
I PLAYS THE MUSIC THAT MAKES THE PEOPLES FALL DOWN!
Back to top  
XMark
Guitar playin' black mage


Joined: 30 May 2002
Posts: 870
Location: New Westminster, BC, Canada

PostPosted: Mon Nov 24, 2003 6:06 am    Post subject: [quote]

Okay, here's another question, and I'm going to sleep right after asking it so I probably won't figure out the answer myself before someone else does, unless I wake up in the middle of the night after having a nightmare of MySQL database entries chasing me and blurt out the answer :)

How do I make it so PHP/MySQL encrypts peoples' passwords like in PHPbb? I looked it up and I think it has something to do with md5("blah") but I don't understand how to implement it.

EDIT:

Never mind... jeez, I was about to go to bed when the answer popped into my head. just save the password as md5($whatever) and then at the login compare the md5 of whatever was typed to what was saved.
_________________
Mark Hall
Abstract Productions
I PLAYS THE MUSIC THAT MAKES THE PEOPLES FALL DOWN!
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Mon Nov 24, 2003 10:06 am    Post subject: [quote]

XMark wrote:
Never mind... jeez, I was about to go to bed when the answer popped into my head. just save the password as md5($whatever) and then at the login compare the md5 of whatever was typed to what was saved.


Aye, that's the way to go about doing it. I myself just use the MySQL PASSWORD() function (as it's encryptable only).
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
Bjorn
Demon Hunter


Joined: 29 May 2002
Posts: 1425
Location: Germany

PostPosted: Mon Nov 24, 2003 8:28 pm    Post subject: [quote]

Uhm, md5 is encryptable only too.

Heh, everytime I read your questions XMark, you've already found a solution yourself. Somehow I find more joy in that than in answering them though. :-)
Back to top  
XMark
Guitar playin' black mage


Joined: 30 May 2002
Posts: 870
Location: New Westminster, BC, Canada

PostPosted: Mon Nov 24, 2003 9:01 pm    Post subject: [quote]

Yeah, as far as I know the only possible way to decrypt an MD5 is to brute-force it by trying all of the billions of possible strings, which would take a prohibitively long time unless you had a supercomputer :)
_________________
Mark Hall
Abstract Productions
I PLAYS THE MUSIC THAT MAKES THE PEOPLES FALL DOWN!
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
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