Can I redirect comment feedback to another site?
Can I redirect comment feedback to another site?
This is the short version: I have created a special view of the comment form to make it nicely usable from the iPhone. Everything works just fine, so comments are posted perfectly. My question now is if there is any way to redirect the positive or negative feedback that is shown after posting a comment to another site.
And now the long verison: To make the commentform look nice on the iPhone, I use php to cut just the form out of the complete site and display it with a special css for the iPhone. You can see it here:
Entering information and posting it to an entry works just fine. But after posting the comment the user is redirected to the blog entry showing a feedback for the operation (for example http://www.yoursite.com/index.php?url=a ... e#feedback). What I'd like to do is to redirect just this comment (for example "Kommentar wurde hinzugefügt" / "Comment was added") to a blank site which does not do anything but to show this feedback. Is that possible?
And now the long verison: To make the commentform look nice on the iPhone, I use php to cut just the form out of the complete site and display it with a special css for the iPhone. You can see it here:
Entering information and posting it to an entry works just fine. But after posting the comment the user is redirected to the blog entry showing a feedback for the operation (for example http://www.yoursite.com/index.php?url=a ... e#feedback). What I'd like to do is to redirect just this comment (for example "Kommentar wurde hinzugefügt" / "Comment was added") to a blank site which does not do anything but to show this feedback. Is that possible?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
Hi!
You could edit the .tpl files to add checks like: {if NOT $smarty.request.csuccess}...{/if} around the containers / HTML structures that you don't want to show, when that page is shown.
HTH,
Garvin
You could edit the .tpl files to add checks like: {if NOT $smarty.request.csuccess}...{/if} around the containers / HTML structures that you don't want to show, when that page is shown.
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Thanks for your help, garvin!
But I am afraid that I don't really know how to do this.
By the way, the web view of my blog should stay as it is. I just want the feedback to be displayed on a standalone site. Just the feedback, nothing else. When I edit my .tpl file I guess that this also affects the output of my blog in the browser, right? That should not happen. Again, I just need the feedback to be shown on an own site. Is that possible?
But I am afraid that I don't really know how to do this.
By the way, the web view of my blog should stay as it is. I just want the feedback to be displayed on a standalone site. Just the feedback, nothing else. When I edit my .tpl file I guess that this also affects the output of my blog in the browser, right? That should not happen. Again, I just need the feedback to be shown on an own site. Is that possible?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
Hi!
Sadly I don't have the time to create a walkthrough for you right now. Maybe if you remind me after new year, I can try to post you with precise code examples.
You can embed an easiy UserAgent sniffer inside a config.inc.php file of your template that sets a special variable when an iphone browser is detected, so that the statement would also check for that variable to not influence the web view.
Regards,
Garvin
Oh, okay. Your post made the impression you were somewhat familiar with HTML and maybe basic Smarty operation.But I am afraid that I don't really know how to do this.
Sadly I don't have the time to create a walkthrough for you right now. Maybe if you remind me after new year, I can try to post you with precise code examples.
You can embed an easiy UserAgent sniffer inside a config.inc.php file of your template that sets a special variable when an iphone browser is detected, so that the statement would also check for that variable to not influence the web view.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Thanks again!
I guess I will get back to you after new year...
Happy Holidays!
I guess I will get back to you after new year...
Happy Holidays!
Re: Can I redirect comment feedback to another site?
Hi Garvin,
first of all I wish you a happy new year!
Just as promised, I'd like to get back to you concerning my problem. Here are two screenshots which show you what I have accomplished up to now. Everything works fine so far. The only remaining problem is still that when I tap on "Kommentar abschicken", as the next step the whole website is displayed including the comment feedback. What I'd like to have there instead is a blank site with nothing but only the comment feedback. Do you have any ideas, examples, help?

I guess I am pretty familiar with HTML and I think I could also embed the mentioned UserAgent sniffer to detect an iPhone, but I don't know how to use this to display the comment feedback on a blank site.
Thanks for your help!!!
first of all I wish you a happy new year!
Just as promised, I'd like to get back to you concerning my problem. Here are two screenshots which show you what I have accomplished up to now. Everything works fine so far. The only remaining problem is still that when I tap on "Kommentar abschicken", as the next step the whole website is displayed including the comment feedback. What I'd like to have there instead is a blank site with nothing but only the comment feedback. Do you have any ideas, examples, help?

I guess I am pretty familiar with HTML and I think I could also embed the mentioned UserAgent sniffer to detect an iPhone, but I don't know how to use this to display the comment feedback on a blank site.
Thanks for your help!!!
Re: Can I redirect comment feedback to another site?
this question is so interesting. I 'm finding the solutions to this. And finally i found here. Thanks schimanke for your support.
Serendipity offers a flexible, expandable and easy-to-use framework with the advetrising for professional marketing.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
Hi!
So once the feedback is created, the s9y variable "$is_comment_added" will get set.
You can use this variable to hide all other content that would be usually displayed. To circumvent that, it's best to be placed within the "content.tpl" template file.
This one usually already has some "shortcut output":
for search results, etc. Now, you simply add one elseif line to match the "comment added routine":
Now, after that you would still get the normal content due to this:
so you have to modify it to not show when a comment has been added:
HTH,
Garvin
So once the feedback is created, the s9y variable "$is_comment_added" will get set.
You can use this variable to hide all other content that would be usually displayed. To circumvent that, it's best to be placed within the "content.tpl" template file.
This one usually already has some "shortcut output":
Code: Select all
{if $searchresult_tooShort}
<h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
<div class="serendipity_search serendipity_search_tooshort">{$content_m
{elseif $searchresult_error}
...
Code: Select all
{if $searchresult_tooShort}
<h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
<div class="serendipity_search serendipity_search_tooshort">{$content_m
{elseif $is_comment_added}
<div>Your custom content here.</div>
{elseif $searchresult_error}
Code: Select all
{$ENTRIES}
{$ARCHIVES}
Code: Select all
{if NOT $is_comment_added}
{$ENTRIES}
{$ARCHIVES}
{/if}
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Hi Garvin,
thanks again. Your solution does pretty much what I wanted to have. Though there is still a lot of stuff around the feedback message which I actually do not need, but I can live with that. Using a UserAgent sniffer to detect an iPhone browser and remove the stuff around the message would not be a good solution since I also offer my users to view the "real" website inside the iPhone browser. So what you see in the screenshot below might be the most appropriate solution right now...
Anyway, there is another question now. As you suggested, I have added the following to my content.tpl:
which does what it should as you can see in the following screenshot:

But I need some more solutions for two other scenarios. There also needs to be a feedback message if the comment was empty and a feedback if wrong captchas were entered. What would be the code I need to add to the content.tpl for those two scenarios?
Thanks in advance!
thanks again. Your solution does pretty much what I wanted to have. Though there is still a lot of stuff around the feedback message which I actually do not need, but I can live with that. Using a UserAgent sniffer to detect an iPhone browser and remove the stuff around the message would not be a good solution since I also offer my users to view the "real" website inside the iPhone browser. So what you see in the screenshot below might be the most appropriate solution right now...
Anyway, there is another question now. As you suggested, I have added the following to my content.tpl:
Code: Select all
{elseif $is_comment_added}
<h3 class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</h3>
But I need some more solutions for two other scenarios. There also needs to be a feedback message if the comment was empty and a feedback if wrong captchas were entered. What would be the code I need to add to the content.tpl for those two scenarios?
Thanks in advance!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
Hi!
You might want to simply check the entries.tpl template, search for "is_comment_added". There you'll see the other variables which can be checked to output the specific error/success messages ($comment_messagestack).
HTH,
Garvin
You might want to simply check the entries.tpl template, search for "is_comment_added". There you'll see the other variables which can be checked to output the specific error/success messages ($comment_messagestack).
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Hi Garvin,
I've already checked my entries.tpl but could not find a solution for the case that a comment could not be added due to the fact that it was empty or that wring captchas were entered. All I could find was an option for moderated comments, for closed comments and for disabled comments. Anyway, when a visitor leaves the commtents-field empty or enters a wrong captcha, there is a feedback (or error message) on the "normal" website. That is what I need in the same style like the positive feedback, which we have already solved. Any ideas?
Thanks!
I've already checked my entries.tpl but could not find a solution for the case that a comment could not be added due to the fact that it was empty or that wring captchas were entered. All I could find was an option for moderated comments, for closed comments and for disabled comments. Anyway, when a visitor leaves the commtents-field empty or enters a wrong captcha, there is a feedback (or error message) on the "normal" website. That is what I need in the same style like the positive feedback, which we have already solved. Any ideas?
Thanks!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
HI!
comment_messagestack, as I referred to?!
Regards,
Garvin
comment_messagestack, as I referred to?!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Hi Garvin,
I'm afraid, I just don't get it...
Okay, here is how I understand what is going on. As I said, this is what I added to my content.tpl:
and then later on
From my point of view (please correct me if I'm wrong) this only applies to a scenario where a comment is really added to the site, i.e. everything went fine. But what can I do when something went wrong, for example the comment-field was left empty or wrong captchas were entered, and the comment was not added to the side. Is in that case $is_comment_added still set? As far as I understand it is not, is it?
So what I found in my entries.tpl is this:
which from my point of view displays the negative feedback in red letters.
So far, so good but how can I check this negative scenario? The positive one gets checked by $is_comment_added and then later on it is determined whether everything should be displayd or just the feedback by
I still don't know how to remove everything but the feedback in the described negative scenario. Here is what my content.tpl looks like right now:
What do I have to add to it to get everything but the negative feedback removed, just like it already works for the positive feedback?
Thanks again!
I'm afraid, I just don't get it...
Okay, here is how I understand what is going on. As I said, this is what I added to my content.tpl:
Code: Select all
{elseif $is_comment_added}
<h3 class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</h3>Code: Select all
{if NOT $is_comment_added}
{$ENTRIES}
{$ARCHIVES}
{/if}So what I found in my entries.tpl is this:
Code: Select all
{foreach from=$comments_messagestack item="message"}
<div class="serendipity_center serendipity_msg_important">{$message}</div>
{/foreach}So far, so good but how can I check this negative scenario? The positive one gets checked by $is_comment_added and then later on it is determined whether everything should be displayd or just the feedback by
Code: Select all
{if NOT $is_comment_added}Code: Select all
<!-- CONTENT START -->
{if $searchresult_tooShort}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_tooshort">{$content_message}</div>
{elseif $is_comment_added}
<h3 class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</h3>
{elseif $searchresult_error}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_error">{$content_message}</div>
{elseif $searchresult_noEntries}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_noentries">{$content_message}</div>
{elseif $searchresult_results}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_results">{$content_message}</div>
{else}
<div class="serendipity_content_message">{$content_message}</div>
{/if}
{if NOT $is_comment_added}
{$ENTRIES}
{$ARCHIVES}
{/if}
<!-- CONTENT END -->
Thanks again!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can I redirect comment feedback to another site?
Hi!
Just like $is_comment_added, you add a if $comments_messagestack to your content.tpl. Maybe "if $comments_messagestack|@count > 0" if the first doesn't work.
So it's all just a matter of checking, if that variable is set, and conditionally showing/hiding things depending on that simple "if" check, and extending existing IF-clauses. Sorry if I was not being verbose enough, since you got a lot of things solved already I was thinking those small pointers would have been sufficient
HTH,
Garvin
Just like $is_comment_added, you add a if $comments_messagestack to your content.tpl. Maybe "if $comments_messagestack|@count > 0" if the first doesn't work.
So it's all just a matter of checking, if that variable is set, and conditionally showing/hiding things depending on that simple "if" check, and extending existing IF-clauses. Sorry if I was not being verbose enough, since you got a lot of things solved already I was thinking those small pointers would have been sufficient
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can I redirect comment feedback to another site?
Hi Garvin,
thank you very much, now it works! It is not as I wanted it to look like when I started but it is a good compromise. To close this matter here is what my content.tpl looks like right now:
Thanks again for your ongoing support!
thank you very much, now it works! It is not as I wanted it to look like when I started but it is a good compromise. To close this matter here is what my content.tpl looks like right now:
Code: Select all
<!-- CONTENT START -->
{if $searchresult_tooShort}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_tooshort">{$content_message}</div>
{elseif $is_comment_added}
<p align=center><font size="10" class="serendipity_msg_notice">{$CONST.COMMENT_ADDED}</font></p>
{elseif $comments_messagestack|@count > 0}
<p align=center><font size="10" class="serendipity_msg_important">{$message}.</font></p>
{elseif $searchresult_error}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_error">{$content_message}</div>
{elseif $searchresult_noEntries}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_noentries">{$content_message}</div>
{elseif $searchresult_results}
<h2 class="serendipity_date">{$CONST.QUICKSEARCH}</h2>
<div class="serendipity_search serendipity_search_results">{$content_message}</div>
{else}
<div class="serendipity_content_message">{$content_message}</div>
{/if}
{if NOT $is_comment_added}
{if NOT $comments_messagestack|@count > 0}
{$ENTRIES}
{$ARCHIVES}
{/if}
{/if}
<!-- CONTENT END -->