phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Posting comments on html pages using phpBB?


 
Search this topic... | Search MOD Writing... | Search Box
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Author Message
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Sun Nov 01, 2009 4:36 am 
Post subject: Posting comments on html pages using phpBB?

My site has html pages and a phpBB2 board.

I would like visitors to be able to leave comments on articles on the html pages of my site, but in such a manner that the comments are posted in topics on the phpBB2.

What I have now is links to topics I open on the board related to individual articles. Those links appear at the end of the articles. This means that for posting a comment a visitor has to click the url to the related topic to be taken to the topic and than post the comment. For this section of my board I have guest posting enabled. (With a good mod that avoids spam posting, of course)

What I want to achieve is showing a posting form on the html page instead of an url so that vistirs can write the comment and when they hit submit be taken to their posted comment on the board.

An example can be seen here, you can write the comment, hit submit and are taken to the login screen of a phpBB3 board and in case one is not registered one should register and after registering the comment will be shown as posted.

Instead of going through the login and/or registering part I want the comment to be posted immediately.

Anybody willing and able to point me in the right direction so that I can start trying to get this written up and working?

Mind you, I have only superficial knowledge of coding so please donīt give answers that require profound knowledge of coding. icon_smile.gif

_________________
phpBB2 will never die, I hope!
Back to top
Murmur
Board Member



Joined: 20 Aug 2009

Posts: 57
Location: California


flag
PostPosted: Mon Nov 02, 2009 4:49 am 
Post subject: Re: Posting comments on html pages using phpBB?

Tricky problem. Best way would be to write a proper 'external' phpBB page, but sounds like that's not an option here.

Try this (no promises):

Code:

Topic must already exist of course...
<form method="post" action="http://www.mywebsite.com/posting.php?mode=reply&t=18">   <---- that's the topic ID

Next line is actually gonna be your textarea input...it's the name 'message' that's important
<input type="hidden" name="message" value="Hello World, hear my comment!">

Not sure about this one, also a textarea if you want a username other than 'guest'
<input type="hidden" name="username" value="DogsAndThings">

This sets the preview mode with (hopefully) your textarea data filled in. It's not yet submitted so your anti-spam is not bypassed.
<input type="hidden" name="preview" value="preview">

This is your button, naturally...
<input type="submit" value="post">
</form>


This will probably only work for users with cookies. On the other hand, it may not work at all. I tested as logged in user only.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Mon Nov 02, 2009 6:44 am 
Post subject: Re: Posting comments on html pages using phpBB?

That's great Murmur,

A lot simpler than I imagined.

Your version basically works, thanks to your idea of using the hidden preview field.

I added a textarea to your code and now visitors can write comments on the article.html, hit submit, are taken to the phpBB2 post preview, solve the anti-spam measure, add a username and ready.

Thanks a lot for your help. icon_wink.gif

_________________
phpBB2 will never die, I hope!
Back to top
Murmur
Board Member



Joined: 20 Aug 2009

Posts: 57
Location: California


flag
PostPosted: Tue Nov 03, 2009 2:18 am 
Post subject: Re: Posting comments on html pages using phpBB?

Glad to help. The bill is in the mail. icon_smile.gif
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Thu Nov 05, 2009 10:14 am 
Post subject: Re: Posting comments on html pages using phpBB?

icon_smile.gif

A short follow-up, for others to see how this looks and works, hereīs one article page with the comment box at the bottom.

Hopefully my visitors will start to use this new feature.

_________________
phpBB2 will never die, I hope!
Back to top
Murmur
Board Member



Joined: 20 Aug 2009

Posts: 57
Location: California


flag
PostPosted: Thu Nov 05, 2009 2:52 pm 
Post subject: Re: Posting comments on html pages using phpBB?

Very cool. That worked out nicely. It's a good way to draw visitors into the forum.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Thu Nov 05, 2009 5:12 pm 
Post subject: Re: Posting comments on html pages using phpBB?

That's exactly what I intend, draw visitors to the forum.
Thanks to the anti-spam MOD I can even make it as easy as possible, allowing guest posting in the forum where the article comments go.
Hopefully some of those guests will discover the board, register, and became "official" users.

Did you notice the javascript I added to the "Publicar Comentario" button to avoid people posting the suggestion I put in the textarea or posting empty comments?

It's Spanish, it simply says "You should write a comment before hitting submit".

Just hit the button and it pops up. icon_biggrin.gif

I'm surprised by the simplicity of the code, I expected something far more complicated.

I'm now looking into fetching the comments made to below the comment box. But I'm not sure if I want to do this or not, it might be overkill, content-wise. I don't like to much info on one page, people tend to get lost and donīt read the important bit...

Whatever I decide, I guess with part of the fetch_all MOD's code I'll get it sorted out on my own.

Greetings. icon_wink.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Nov 05, 2009 5:19 pm 
Post subject: Re: Posting comments on html pages using phpBB?

Oooooops! It was me writing that "test"! SORRY! icon_redface.gif
Didnt think I could get past that spam-check because I did not understand one ord. Probably choose the correct answer by accident.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Thu Nov 05, 2009 7:14 pm 
Post subject: Re: Posting comments on html pages using phpBB?

Haha,

I figured that was some funny person from here testing things. icon_razz.gif

By the way, seems like you would make a good spambot. icon_mrgreen.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Nov 06, 2009 3:46 am 
Post subject: Re: Posting comments on html pages using phpBB?

Are you sure your spamprotection work? icon_redface.gif
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Fri Nov 06, 2009 4:59 am 
Post subject: Re: Posting comments on html pages using phpBB?

Yes,

Not a single spambot registered nor a single spam guest post in over two years since I installed it.

You should have bought a number in a big lottery, yesterday was your lucky day. icon_twisted.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Nov 06, 2009 5:01 am 
Post subject: Re: Posting comments on html pages using phpBB?

icon_mrgreen.gif

BTW, a nice tutorial:
http://www.ajquick.com/programming/phpbb/tutorial/
Back to top
Murmur
Board Member



Joined: 20 Aug 2009

Posts: 57
Location: California


flag
PostPosted: Sat Nov 07, 2009 2:23 am 
Post subject: Re: Posting comments on html pages using phpBB?

Ah yes, the button is a nice extra touch.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0450 seconds using 16 queries. (SQL 0.0086 Parse 0.0010 Other 0.0354)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo