We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Plugin - One Voice…

Development and Programming

grantmx's avatar
grantmx
1,439 posts
about 17 years ago
grantmx's avatar grantmx

Still not acting right. Not sure what I’m dong wrong. Did I leave out a param?

{exp:one_voice mode="entry_id"}

{if already_spoken}
<b>Sorry you have already posted a comment and so are not allowed to post another!</b>
{if:else}

{exp:comment:form weblog="{my_weblog}"}
                <div id="comm_form">
{if logged_out}
                <strong>Name:</strong>
<input name="name" type="text" class="input"  /></p>
                <strong>Email:</strong>
<input name="email" type="text" class="input"  /></p>
{/if}
                <strong>Comment:</strong>
<textarea name="comment" class="input"  height:200px;">{comment}</textarea></p>
                <input type="checkbox" name="save_info" value="yes" {save_info} />Remember my info the next time I visit?

                    <input type="checkbox" name="notify_me" value="yes" {notify_me} />Notify me of followup comments
{if captcha}
                                <b>Only because of darn Spammers, please enter the word you see in the image below:</b>
                                {captcha}

                                <input type="text" name="captcha" value="{captcha_word}" size="20" maxlength="20" style="width:140px;" /></p>
{/if}
                    <input type="submit" name="submit" value="Submit »" /> 
                  </div>
{/exp:comment:form}

{/if}
{/exp:one_voice}
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Sorry didn’t have time to look through your code but this is a very very quick copy / paste job from a localhost install that I have which has this working at the moment. Might like to try that?

{exp:one_voice mode="url_title"}
{if already_spoken}
Sorry you have already posted a comment and so are not allowed to post another!
{if:else}

{if logged_in}
{exp:comment:form preview="{my_template_group}/comment_preview"}
{if logged_out}
Name:
<input type="text" name="name" value="{name}" size="50" /></p>
Email:
<input type="text" name="email" value="{email}" size="50" /></p>
Location:
<input type="text" name="location" value="{location}" size="50" /></p>
URL:
<input type="text" name="url" value="{url}" size="50" /></p>
{/if}

<a >Smileys</a>
<textarea name="comment" cols="50" rows="12">{comment}</textarea></p>

{if logged_out}
<input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information
{/if}
<input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?
{if captcha}
Submit the word you see below:
{captcha}
<input type="text" name="captcha" value="" size="20" maxlength="20"  /></p>
{/if}
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
{/exp:comment:form}
{/if}

{if logged_out}
Sorry but you must register first to be able to comment on an entry
{/if}

{/if}
{/exp:one_voice}

I will try to take a closer look at your code later on. I do notice that there may be something awry with it. Either that or the code highlighter in the forums here is doing something a little odd as the last half of your code is all coming out in red whereas it really should be a mix of colours. May be nothing though.

Best wishes,

Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

Oops meant to ask - and I think I know what’s wrong if I am right with the answer you are going to give to this question - what exactly is the problem? (There that was a nice easy sentence wasn’t it 😉 )

Is it that when you aren’t logged-in then you are still allowed to post a comment?

If so then you just need the extra :

{if logged_in}

{/if}

wrapped around the comment form and hopefully that should do it for you?

Best wishes,

Mark

       
grantmx's avatar
grantmx
1,439 posts
about 17 years ago
grantmx's avatar grantmx

I just had an extra ” somewhere. It wasn’t significant. But I suspect that’s why the code highlighting was off a bit.


The problem seems to be that the plug-in believes that I’ve posted a comment to an entry even though nobody has posted a comment. The comment total is ‘0’, yet it’s saying that “I’ve already spoken”, if you will. Not, “because I haven’t spoken, show the comment form” which the latter half of the conditional logic. And this is for everyone who visits this page Logged in or Logged out.


I take a different approach to the comment form that requires less code. But I do see what you mean. 😉

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Did you download the latest V1.0.4 version from the top thread? I did update that the other day and it should hopefully be working now.

Perhaps break it down and just place the plugin tag on its own to see what happens?

{exp:one_voice mode="entry_id"}

{if already_spoken}
Sorry you aren't allowed to post again
{/if}

{/exp:one_voice}

Try that on the same template but out of the way of the comments form and just see if the correct results come back. I just downloaded the plugin again from here and tried on this computer with a fresh install of ExpressionEngine and all is working fine here.

One last thing your entry_id is definitely the last segment in the URL isn’t it and you are definitely viewing a URL such as :

http://www.example.com/blog/comments/12

as opposed to

http://www.example.com/blog/comments/my_entry_title

If you are using a url_title then you will need to change the mode of the plugin to reflect this. Also do you have a page link to where this is happening? Although I probably wouldn’t be able to do much from the front-end.

Sorry about all this, I’m really not sure what the problem could be as I have tried this on quite a few installs now and they all seem to work fine. Did you possibly try your template with my code in just to see what happens?

Best wishes,

Mark

       
grantmx's avatar
grantmx
1,439 posts
about 17 years ago
grantmx's avatar grantmx

Yeah, downloaded the latest install.

Still doesn’t work, even reduced.

Nope, entry_id. Here is my url: http://bridalclarity.com/index.php?/bc/info/22

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

Hmm all very odd!

What version of ExpressionEngine are you running there? Unfortunately I’m not at home at the moment where I have all my files relating to this but have you perhaps tried this on another fresh install of ExpressionEngine? Just wondering if you have anything going on with your install or not although I can’t think of what it would be?

Also do you have any extensions / modules installed that affect the comment form at all?

When I get home later I will make a version which should output some variables to the screen so that we can hopefully nail this one down as soon as possible.

Best wishes,

Mark

       
grantmx's avatar
grantmx
1,439 posts
about 17 years ago
grantmx's avatar grantmx

The latest. 1.6.4, Build: 20080710. I just PM’ed you.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

EDIT - Meant to mention the new version is still the same version number and is at the first post thread

Well call me stupid if you will!! 😉

I’ve just updated the plugin again as I think I missed one small thing! As I was testing with url_title and not entry_id I think I’ve missed something!!

Hopefully if you upload the new version of the plugin then things should hopefully start acting as we want them too 😊

Best wishes,

Mark

       
grantmx's avatar
grantmx
1,439 posts
about 17 years ago
grantmx's avatar grantmx

Oh! Well I pulled the 1.4 one a few posts back, so maybe that was the issue. I’ll pull down that one and let you know.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 17 years ago
Mark Bowen's avatar Mark Bowen

I’ve now updated the plugin to V1.0.5 in the top thread. Slight re-write of the SQL queries in this as having problems with PHP V5 and above.

Best wishes,

Mark

       
First 2 3 4

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.