Quoting in forums

Author Message

Eivind Marienborg

Wednesday 09 March 2005 12:50:20 pm

I've looked into the quotation functionality with simpletags, and using them to manually enter quotations works great.

Now I want to add a quote-button to all forum entries in my forum, that by clicking lets the user 1) Go directly to a new forum reply-form, and 2) having the message that "belonged" to the quote-button already present in the form (In other words like a normal quote button in most other forums).

I've looked into ezhttp, but can't get it to pass things to edit templates. I also thought about somehow getting the nodeID of the quoted forum entry, and then fetching it in the edit template, but since this also requires passing stuff to an edit template, it didn't work out.

I'm stuch here, and would appriciate alternative approaches to this. Does anyone have any experience with this, or have any ideas as to how to make it work?

Paul Forsyth

Wednesday 09 March 2005 12:51:29 pm

Try this out:

http://ez.no/ez_publish/documentation/customization/custom_design/user_specified_parameters

paul

Eivind Marienborg

Wednesday 09 March 2005 1:29:48 pm

This could work, but seems to have the same problem as using ezhttp. The form posts to <i>content/action</i>, but it then redirects to content/edit. The view parameters (and the ezhttp, I guess) is lost in the redirection. Am I doing anything wrong here?

This is my form code:

        <form method="post" action={concat("content/action/(node)/",$:item.node_id)|ezurl}>

        <input type="hidden" name="ContentNodeID" value="{$:item.object.owner.main_node_id}" />
        <input type="hidden" name="ContentObjectID" value="{$:item.object.owner.id}" />
        <input type="hidden" name="ViewMode" value="full" />
        <input type="hidden" name="privat" value="{$:item.object.data_map.privat.data_int}">

        <input type="hidden" name="NodeID" value="{$:item.object.owner.main_node_id}" />
        <input type="hidden" name="ClassID" value="47">
        <input type="image" name="NewButton" value="reply" src="/share/icons/reply.gif" alt="Svar!" title="Reply!">
        </form>

Paul Forsyth

Wednesday 09 March 2005 1:49:17 pm

I see now. Sorry for not spotting the redirect.

Yes that is more difficult. A few possible solutions:

- Set a cookie with Javascript.
- Modify kernel/content/action.php to pass on a hidden field with your node id.
- Add a new action as an extension which largely copies the 'NewButton' action but with your additions.

paul

Eivind Marienborg

Wednesday 09 March 2005 1:59:53 pm

Thanks again, I'll look into it :)

Brendan Pike

Tuesday 12 April 2005 8:17:07 pm

Hi Eivind

This thread interests me as I'm working on a forum at the moment also. How did you go with this, I'd also be interested in hearing of any other improvements you created.

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Eivind Marienborg

Tuesday 12 April 2005 11:31:17 pm

Hi Brendan :)

I haven't had time to look deeper into this yet. Pauls ideas seem to be the best so far.

I need this functionality several places in my eZ site though, so I guess it's just a matter of time before I have to start looking into it again.

Please let me know if you find a working sollution for this :)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:23:02
Script start
Timing: Jan 31 2025 04:23:02
Module start 'layout'
Timing: Jan 31 2025 04:23:02
Module start 'content'
Timing: Jan 31 2025 04:23:02
Module end 'content'
Timing: Jan 31 2025 04:23:02
Script end

Main resources:

Total runtime0.0167 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.1406151.1953
Module start 'layout' 0.00590.0030 740.335936.6172
Module start 'content' 0.00890.0063 776.953198.2188
Module end 'content' 0.01520.0015 875.171937.9922
Script end 0.0167  913.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.6595140.0002
Check MTime0.00116.7982140.0001
Mysql Total
Database connection0.00116.323610.0011
Mysqli_queries0.003219.337030.0011
Looping result0.00000.089810.0000
Template Total0.00116.910.0011
Template load0.00095.337310.0009
Template processing0.00031.506410.0003
Override
Cache load0.00063.791010.0006
General
dbfile0.002213.191680.0003
String conversion0.00000.048540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs