1 john Jan 29, 2008 00:37
3 yabba Jan 29, 2008 15:21
I must be tilting over your problem? $Comment->anchor() points to the comment with #comment_preview ?
As to the rest of your code it looks like once it changes to "member" then it'll stay that way ?
echo ( $Comment->get_author_User() ? '<div class="registered">' : $params[ 'comment_start' ] );
¥
4 john Jan 29, 2008 15:45
Well, a visitor drafts a post and hits preview and is taken to the Comment_preview
When I, the only Member, preview a post, I'm taken to the top of the page!!!
5 yabba Jan 29, 2008 16:02
You allow your visitors to draft posts? :roll:
When I comment as a member I get this as a url
http://dev.innervisions.org.uk/blog1.php?blog=1&title=first-post&disp=single&more=1&c=1&tb=1&pb=1#comment_preview
and I'm taken to the previewed comment?
¥
6 john Jan 29, 2008 16:07
When I comment as a Member I get this URL
/index.php?blog=2&title=my-very-bad-car-day&disp=single&more=1&c=1&tb=1&pb=1#comment_preview
and am not taken to the previewed comment
When I log out, make a post and hit preview, I am taken to the previewed comment!!!
7 yabba Jan 29, 2008 16:08
Any chance of a link and a login?
¥
8 yabba Jan 29, 2008 16:16
Thanks for the login, but I had a moment of inspiration and guessed 2 things :
1) this'd be your normal blog and not a dev backup :|
2) you're not the sort to change your password with any great haste ;)
change the code to
echo ( $Comment->get_author_User() ? str_replace( 'class="', ' class="registered ', $params['comment_start' ] ) : $params[ 'comment_start' ] );
Hit save and hope I didn't break anything important ;)
9 john Jan 29, 2008 16:22
Thanks. :)
so, just clarifying and confirming..... the code is now
<?php
$Comment->anchor();
echo ( $Comment->get_author_User() ? str_replace( 'class="', ' class="registered ', $params['comment_start' ] ) :
?>
??
10 yabba Jan 29, 2008 16:22
Yeah, give that a blast and see if it melts your cpu ;)
¥
11 john Jan 29, 2008 16:26
Seems to to be the cats whiskers
I'll crash test it more later.... and thanks mate.
12 yabba Jan 29, 2008 16:26
*gets out crystal ball*
I foresee that your next question is going to be about lost styling :
echo ( $Comment->get_author_User() ? preg_replace( '~class="[^"]+?"~', ' class="registered"', $params['comment_start' ] ) : $params['comment_start'] );
¥
13 john Jan 29, 2008 20:16
Methinks that sometimes you "foresee" a tad too much....
I would have got around to it sooner or later though :)
Some progress... well the page doesn't break any more...
For Post Preview, I'm trying to apply $comment->anchor() to the registered user. As it is it works for a visitor only.
I've tried all sorts of stupid combinations but can't crack it.