Comments

Jeremye77’s picture

I do not see why you could not implement a similar feature utilizing views and CCK. Just create a custom content type of, say, guest book entry. Set appropriate access permissions. Then create a view to mimic the guestbook behaviours. Simply utilize view to output both a block (and a page if you want a view more link). Set the filter to node type of Guest book entry. for the header information of the block (in views) you could just copy the code for the form generated by your custom content type.

It is not like this module provides any type of magical ajax thing or anything else. This would also make your guest book entries be nodes...I see that was a request further down the issues log.

Seem pretty straightforward. I do not have time tonight. I will implement this tommorow and provide you with details. Don't be afraid to experiment though.

Jeremye77’s picture

You would end up with a view that looks like this. You will, of course, have to modify this for your local site. Make sure your content type of guest book has a TITLE, TO USER, MESSAGE. This is an export of my view. oh...you may also want to make the TO USER a hidden field that pulls the username that the guestbook is to from the page or some variable.

$view = new stdClass(); $view->name = 'guestbook_output'; $view->description = 'Provides filtering and output handling of guestbook type entries'; $view->access = array ( ); $view->view_args_php = ''; $view->page = TRUE; $view->page_title = ''; $view->page_header = ''; $view->page_header_format = '3'; $view->page_footer = ''; $view->page_footer_format = '3'; $view->page_empty = ''; $view->page_empty_format = '3'; $view->page_type = 'node'; $view->url = 'user/$arg/guestbook'; $view->use_pager = TRUE; $view->nodes_per_page = '10'; $view->block = TRUE; $view->block_title = 'Guestbook Entries'; $view->block_header = '
<form id="node-form" action="/node/add/guestbook" method="post" enctype="multipart/form-data" name="[object]">
    <div>
    <div class="node-form">
    <div class="standard">
    <div class="form-item"><label for="edit-title">Title: <span class="form-required" title="This field is required.">*</span></label> <input class="form-text required" id="edit-title" maxlength="128" size="60" name="title" type="text" /> </div>
    <div class="form-item"><label for="edit-field-to-user-0-value">to user: <span class="form-required" title="This field is required.">*</span></label> <input class="form-text required" id="edit-field-to-user-0-value" size="60" name="field_to_user[0][value]" type="text" /> </div>
    <input id="edit-changed" type="hidden" name="changed" />
    <div class="form-item"><label for="edit-body">Message: <span class="form-required" title="This field is required.">*</span></label> <textarea class="form-textarea required" id="edit-body" rows="20" cols="60" name="body"></textarea> </div>
    <fieldset class=" collapsible collapsed"><legend>Input format</legend>
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" name="format" value="1" /> Filtered HTML</label>
    <div class="description">
    <ul class="tips">
        <li>Web page addresses and e-mail addresses turn into links automatically.</li>
        <li>Allowed HTML tags: &lt;a&gt; &lt;em&gt; &lt;strong&gt; &lt;cite&gt; &lt;code&gt; &lt;ul&gt; &lt;ol&gt; &lt;li&gt; &lt;dl&gt; &lt;dt&gt; &lt;dd&gt;</li>
        <li>Lines and paragraphs break automatically.</li>
    </ul>
    </div>
    </div>
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" name="format" value="2" /> PHP code</label>
    <div class="description">
    <ul class="tips">
        <li>You may post PHP code. You should include &lt;?php ?&gt; tags.</li>
    </ul>
    </div>
    </div>
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" checked="checked" name="format" value="3" /> Full HTML</label>
    <div class="description">
    <ul class="tips">
        <li>Web page addresses and e-mail addresses turn into links automatically.</li>
        <li>Lines and paragraphs break automatically.</li>
    </ul>
    </div>
    </div>
    <p><a href="/filter/tips">More information about formatting options</a></p>
    </fieldset> <input id="edit-guestbook-node-form-form-token" type="hidden" name="form_token" value="5f6db8c3dc53e89516cc9731fbd81676" /> <input id="edit-guestbook-node-form" type="hidden" name="form_id" value="guestbook_node_form" />
    <div class="form-item"><label for="edit-log">Log message: </label><textarea class="form-textarea resizable" id="edit-log" cols="60" name="log"></textarea>
    <div class="description">An explanation of the additions or updates being made to help other authors understand your motivations.</div>
    </div>
    <fieldset class=" collapsible collapsed"><legend>URL path settings</legend>
    <div class="form-item"><input class="form-text" id="edit-path" maxlength="250" size="60" name="path" type="text" />
    <div class="description">Optionally specify an alternative URL by which this node can be accessed. For example, type &quot;about&quot; when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.</div>
    </div>
    </fieldset> <fieldset class=" collapsible collapsed"><legend>Comment settings</legend>
    <div class="form-radios">
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" checked="checked" name="comment" value="0" /> Disabled</label> </div>
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" name="comment" value="1" /> Read only</label> </div>
    <div class="form-item"><label class="option"><input class="form-radio" type="radio" name="comment" value="2" /> Read/Write</label> </div>
    </div>
    </fieldset> <fieldset class=" collapsible collapsed"><legend>Menu settings</legend>
    <div class="form-item"><label for="edit-menu-title">Title: </label><input class="form-text" id="edit-menu-title" maxlength="128" size="60" name="menu[title]" type="text" />
    <div class="description">The name to display for this menu link.</div>
    </div>
    <div class="form-item"><label for="edit-menu-description">Description: </label><input class="form-text" id="edit-menu-description" maxlength="128" size="60" name="menu[description]" type="text" />
    <div class="description">The description displayed when hovering over a menu item.</div>
    </div>
    <div class="form-item"><label for="edit-menu-pid">Parent item: </label><select class="form-select" id="edit-menu-pid" name="menu[pid]">
    <option value="1" selected="selected">Navigation</option>
    <option value="91">-- Groups</option>
    <option value="73">-- Audio</option>
    <option value="96">---- User's audio files (disabled)</option>
    <option value="95">---- Browse by...</option>
    <option value="97">---- Audio feed (disabled)</option>
    <option value="101">------ Users's audio feed (disabled)</option>
    <option value="52">-- Blogs (disabled)</option>
    <option value="3">-- Compose tips (disabled)</option>
    <option value="55">-- Contact (disabled)</option>
    <option value="4">-- Content (disabled)</option>
    <option value="9">---- Create content (disabled)</option>
    <option value="131">------ Amazon</option>
    <option value="132">------ Amazon node</option>
    <option value="68">------ Audio</option>
    <option value="22">------ Blog entry</option>
    <option value="128">------ Event</option>
    <option value="23">------ Forum topic</option>
    <option value="106">------ Group</option>
    <option value="135">------ Guestbook</option>
    <option value="69">------ Image</option>
    <option value="25">------ Page</option>
    <option value="24">------ Poll</option>
    <option value="70">------ review</option>
    <option value="26">------ Story</option>
    <option value="93">-- directory (disabled)</option>
    <option value="56">-- Forums (disabled)</option>
    <option value="78">-- My buddylist</option>
    <option value="86">-- My GayIowa</option>
    <option value="99">---- View all custom sites</option>
    <option value="92">-- My unread</option>
    <option value="59">-- Polls (disabled)</option>
    <option value="118">-- Recent popular content</option>
    <option value="65">-- Recent posts</option>
    <option value="89">-- reviews (disabled)</option>
    <option value="62">-- Search (disabled)</option>
    <option value="83">-- Switch back</option>
    <option value="82">-- Switch to test user</option>
    <option value="110">-- tags (disabled)</option>
    <option value="60">-- User list (disabled)</option>
    <option value="51">-- News aggregator</option>
    <option value="67">---- Categories (disabled)</option>
    <option value="126">------ Entertainment</option>
    <option value="119">------ Gay Interest</option>
    <option value="125">------ Iowa</option>
    <option value="107">------ Member Feeds</option>
    <option value="66">---- Sources</option>
    <option value="5">-- Administer</option>
    <option value="8">---- Content management</option>
    <option value="133">------ Amazon item import</option>
    <option value="40">------ Categories</option>
    <option value="15">------ Comments</option>
    <option value="18">------ Content</option>
    <option value="21">------ Content types</option>
    <option value="57">------ Forums</option>
    <option value="50">------ News aggregator</option>
    <option value="20">------ Post settings</option>
    <option value="35">------ RSS publishing</option>
    <option value="19">------ Search content</option>
    <option value="11">---- Site building</option>
    <option value="14">------ Blocks</option>
    <option value="54">------ Contact form</option>
    <option value="17">------ Menus</option>
    <option value="29">------ Modules</option>
    <option value="28">------ Themes</option>
    <option value="58">------ URL aliases</option>
    <option value="94">------ Views</option>
    <option value="88">---- Organic groups</option>
    <option value="100">------ Organic groups configuration</option>
    <option value="10">---- Site configuration</option>
    <option value="115">------ Actions</option>
    <option value="27">------ Administration theme</option>
    <option value="134">------ Amazon</option>
    <option value="75">------ Audio import settings</option>
    <option value="72">------ Audio settings</option>
    <option value="76">------ Block Cache</option>
    <option value="53">------ Blog APIs</option>
    <option value="77">------ Buddylist</option>
    <option value="38">------ Clean URLs</option>
    <option value="36">------ Date and time</option>
    <option value="31">------ Error reporting</option>
    <option value="127">------ Event</option>
    <option value="105">------ FCKeditor</option>
    <option value="33">------ File system</option>
    <option value="108">------ File uploads</option>
    <option value="71">------ Google AdSense</option>
    <option value="79">------ Image</option>
    <option value="34">------ Image toolkit</option>
    <option value="80">------ IMCE settings</option>
    <option value="98">-------- Sub-folder tool</option>
    <option value="16">------ Input formats</option>
    <option value="84">------ Masquerade</option>
    <option value="85">------ MySite</option>
    <option value="87">------ Node images</option>
    <option value="109">------ Pathauto</option>
    <option value="32">------ Performance</option>
    <option value="111">------ Privatemsg settings</option>
    <option value="90">------ Review</option>
    <option value="63">------ Search settings</option>
    <option value="30">------ Site information</option>
    <option value="37">------ Site maintenance</option>
    <option value="112">------ Thickbox</option>
    <option value="74">---- Audio import</option>
    <option value="13">---- User management</option>
    <option value="43">------ Access control</option>
    <option value="45">------ Access rules</option>
    <option value="61">------ Profiles</option>
    <option value="44">------ Roles</option>
    <option value="46">------ Search users</option>
    <option value="41">------ Users</option>
    <option value="42">------ User settings</option>
    <option value="113">---- Votes and Ratings</option>
    <option value="116">------ jRating</option>
    <option value="117">------ voting actions</option>
    <option value="114">------ Voting API</option>
    <option value="12">---- Logs</option>
    <option value="47">------ Recent log entries</option>
    <option value="102">------ AdSense clicks</option>
    <option value="104">-------- By day</option>
    <option value="103">-------- Top pages</option>
    <option value="120">------ Recent hits</option>
    <option value="49">------ Top 'access denied' errors</option>
    <option value="48">------ Top 'page not found' errors</option>
    <option value="123">------ Top referrers</option>
    <option value="64">------ Top search phrases</option>
    <option value="121">------ Top pages</option>
    <option value="122">------ Top visitors</option>
    <option value="124">------ Access log settings</option>
    <option value="39">------ Status report</option>
    <option value="7">---- Help</option>
    <option value="81">-- Log in</option>
    <option value="6">-- Log out</option>
    <option value="2">Primary links</option>
    <option value="129">-- Groups</option>
    <option value="130">-- My Buddy List</option>
    </select> </div>
    <input id="edit-menu-path" type="hidden" name="menu[path]" />
    <div class="form-item"><label for="edit-menu-weight">Weight: </label><select class="form-select" id="edit-menu-weight" name="menu[weight]">
    <option value="-10">-10</option>
    <option value="-9">-9</option>
    <option value="-8">-8</option>
    <option value="-7">-7</option>
    <option value="-6">-6</option>
    <option value="-5">-5</option>
    <option value="-4">-4</option>
    <option value="-3">-3</option>
    <option value="-2">-2</option>
    <option value="-1">-1</option>
    <option value="0" selected="selected">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    </select>
    <div class="description">Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.</div>
    </div>
    <input id="edit-menu-mid" type="hidden" name="menu[mid]" value="0" /> <input id="edit-menu-type" type="hidden" name="menu[type]" value="86" /> </fieldset> </div>
    <div class="admin">
    <div class="authored"><fieldset class=" collapsible collapsed"><legend>Authoring information</legend>
    <div class="form-item"><label for="edit-name">Authored by: </label><input class="form-text form-autocomplete" id="edit-name" maxlength="60" size="60" name="name" value="JeremyE77" type="text" />
    <div class="description">Leave blank for <em>Anonymous</em>.</div>
    </div>
    <input class="autocomplete" id="edit-name-autocomplete" disabled="disabled" type="hidden" value="http://www.gayiowa.net/user/autocomplete" />
    <div class="form-item"><label for="edit-date">Authored on: </label><input class="form-text" id="edit-date" maxlength="25" size="60" name="date" type="text" />
    <div class="description">Format: <em>2006-12-18 14:04:28 -0600</em>. Leave blank to use the time of form submission.</div>
    </div>
    </fieldset> </div>
    <div class="options"><fieldset class=" collapsible collapsed"><legend>Publishing options</legend>
    <div class="form-item"><label class="option"><input class="form-checkbox" id="edit-status" type="checkbox" checked="checked" name="status" value="1" /> Published</label> </div>
    <div class="form-item"><label class="option"><input class="form-checkbox" id="edit-promote" type="checkbox" name="promote" value="1" /> Promoted to front page</label> </div>
    <div class="form-item"><label class="option"><input class="form-checkbox" id="edit-sticky" type="checkbox" name="sticky" value="1" /> Sticky at top of lists</label> </div>
    <div class="form-item"><label class="option"><input class="form-checkbox" id="edit-revision" type="checkbox" name="revision" value="1" /> Create new revision</label> </div>
    </fieldset> </div>
    </div>
    <input class="form-submit" type="submit" name="op" value="Preview" /> <input class="form-submit" type="submit" name="op" value="Submit" /> </div>
    </div>
</form>
'; $view-&gt;block_header_format = '3'; $view-&gt;block_footer = ''; $view-&gt;block_footer_format = '3'; $view-&gt;block_empty = ''; $view-&gt;block_empty_format = '3'; $view-&gt;block_type = 'teaser'; $view-&gt;nodes_per_block = '5'; $view-&gt;block_more = FALSE; $view-&gt;block_use_page_header = FALSE; $view-&gt;block_use_page_footer = FALSE; $view-&gt;block_use_page_empty = FALSE; $view-&gt;sort = array ( array ( 'tablename' =&gt; 'node', 'field' =&gt; 'created', 'sortorder' =&gt; 'DESC', 'options' =&gt; 'normal', ), ); $view-&gt;argument = array ( array ( 'type' =&gt; 'content: field_to_user', 'argdefault' =&gt; '1', 'title' =&gt; '', 'options' =&gt; '', 'wildcard' =&gt; '', 'wildcard_substitution' =&gt; '', ), ); $view-&gt;field = array ( ); $view-&gt;filter = array ( array ( 'tablename' =&gt; 'node', 'field' =&gt; 'type', 'operator' =&gt; 'OR', 'options' =&gt; '', 'value' =&gt; array ( 0 =&gt; 'guestbook', ), ), array ( 'tablename' =&gt; 'node_data_field_to_user', 'field' =&gt; 'field_to_user_value_like', 'operator' =&gt; '=', 'options' =&gt; '', 'value' =&gt; '$arg1', ), ); $view-&gt;exposed_filter = array ( ); $view-&gt;requires = array(node, node_data_field_to_user); $views[$view-&gt;name] = $view;

It looks sloppy in here but if you import it into views it will populate the form with the information that I used. Once again this is not just a plug in solution you will have to customize the arguements more than likely. Once this is setup you may invoke the block anywhere you see fit. Any problems with this would probably be better suited in the forums...they can assist you with any customizations you may need....I should think.

filiptc’s picture

Title: Kindly make this work with Drupal 5 » Porting to Drupal 5
Category: feature » task

This module needs to be ported to Drupal 5, independently of which other modules can be tuned to do the job.

KMNL’s picture

Whats the timeline for this module in 5.0?

hba’s picture

I'm afraid I haven't too much spare time these days. I'd be more than happy if anyone have time to do the porting job.

I am also considering giving the responsibility of this guestbook to a developer who can devote more time to this. Anyone interested, please send me a message.

JumpingJack@drupalcenter.de’s picture

I'm working at a Drupal 5 Version.

It works already for me, but i need a few days (one/two weeks) to fix some little problems. If someone could help me (testing, coding) you're welcome

ciao

filiptc’s picture

Attach it so we can take a look.

JumpingJack@drupalcenter.de’s picture

StatusFileSize
new312 bytes

O.K.

Here is my very first version, i think there are a few (minor?) bugs to be fixed...
This version works with 5.0 and has two enhancements:
- E-Mail-Notification for new guestbooks entries (you have to put the e-mail-adress to be notificated in the settings)
- Communication with the spam-module (guestbook-entries with defined words from the custom-filters in spam-module will not be saved and logged in watch-dog)
I'll attach the guestbook.info file here in this issue and the guestbook.module in the next one.

Sorry i don't know how to work with this version-system here. Maybe another one could put this in cvs - thanks

JumpingJack@drupalcenter.de’s picture

StatusFileSize
new30.77 KB

attached is the guestbook.module working with 5.0
see the previos issue

hba’s picture

Assigned: Unassigned » hba

Great work! I'll look into your code and submit it to CVS if it seems OK.

filiptc’s picture

Status: Active » Needs work

Three things:

  1. The attached .info file gives a 403 Forbidden.
  2. No visual errors (PHP, etc) but functionality is broken. I am unable to post on the guestbook. I submit an entry and the page seems to load but I get thrown back at the submit comment page without the submitted entry being displayed (no rows added to the database). I am not using the spam module (in case this might be related).
  3. The option to display submit form on a separate page does not work. The field shows above the entries instead.
filiptc’s picture

And 4.

<em>User</em>'s guestbook
Visit <a href="/user/1" title="Visit &lt;em&gt;User&lt;/em&gt;&#039;s profile">User</a>'s profile

...is shown to other users / anonymous users on the guestbook header.

filiptc’s picture

Point 2. only seems to be the case for guestbook owners.

JumpingJack@drupalcenter.de’s picture

StatusFileSize
new30.94 KB

Thanx hba,
gracias filip_tc

@filip_tc
1. What are you doing with the .info file. I can't reproduce this behavior.
2. Nearly the same as in 4.7. Guestbook owners cannot post in it's own guestbook. Could be changed.
3. fixed with this uploaded version
4. fixed with this uploaded version

filiptc’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev
Status: Closed (fixed) » Reviewed & tested by the community

@ 1. Might be me but I get

Forbidden

You don't have permission to access /files/issues/guestbook.info on this server.
Apache Server at drupal.org Port 80

@ 2. I think not letting owners post on their own guestbooks is sensible... I just didn't expect it... =D

Great work, RTBC

mynameisbrian’s picture

Status: Needs work » Reviewed & tested by the community

Have plans for porting to Drupal 5.x been trashed? No update in 2 weeks.

smk-ka’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new30.33 KB

Did some more work:

  • Changed the word case to use capital letters, as everywhere else in Drupal 5.
  • Fixed some prefix-related problems in variables passed to t().
  • Cleaned the code.

PS. Rename to .module!

nahhe’s picture

Hi, I renamed, and downloaded also the .info archive, but it still does not appear in the module listing. what I´m doing wrong? thanks :)

JumpingJack@drupalcenter.de’s picture

You don't need to rename the guestbook.info file it is not a archive. Just copy it into your guestbook directory. Then guestbook will appear in module listing.

nahhe’s picture

sorry! i wasn´t renaming the info file, just the module file. But anyway I think the problem was that I was trying to make it work with the 4.6.x download, now with 4.7.x everything is fine! thanks! :)

hba’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Needs review » Active

I just added JumpingJack's code (thanks a lot!) into the 5.x branch. It will be available on the release page some time during the next 24 hours, when Drupal's daily tarballer runs. I haven't had the opportunity to test it myself, please give me feedback if anything doesn't work as it should.

hba’s picture

Ah, and thanks to smk-ka as well!

hba’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)
gurukripa’s picture

can u make the guestbook appear on the core profile page..without a template override..thanks

Status: Reviewed & tested by the community » Closed (fixed)
birthdaycakesname.com’s picture

Issue summary: View changes

This module needs to be ported to Drupal 5, independently of which other modules can be tuned to do the job.
zonginternetpackages.pk
birthdaycakesname
forexpops
trustemo