Support Forum

is the fancy callout arrow next to your avatar…

41 Answers

New Answer

MP Mr Papa
Mr Papa
Member

just the pointer/arrow part?  you will see here that the content, including the pointer/arrow is colored differently for the author…

JI jim
jim
Member

Mr Papa said
just the pointer/arrow part?

Right. I noticed after I first posted that my arrow changed color to match the yellow background of my post.

thread-arrow-authorCurUser.gif vs. thread-arrow-author.gif for all other posts

I am curious about how to call a different image like that for even and odd posts since we alternate background colors for every other post. Brandon provided great instructions for calling one image in the template file, but I can’t figure out how to display a different one depending on the post count (even or odd).

I hope this is clear. Thanks!

MP Mr Papa
Mr Papa
Member

Since Brandon did all that for us, will let him answer. Of course, apply even or odd classes to those rows so it’s just css based on the row class.

JI jim
jim
Member

Thanks again, I’m happy to wait for Brandon’s direction since I’m not sure how to call a different image via CSS and his instructions only detail how the one image is being displayed:

echo '<img alt="" class="spAuthorArrow" src="'.SPTHEMEICONSURL.'thread-arrow-author.gif">';

I figured it must be done here via CSS, or the template file edit must require some sort of conditional argument for which image to show. Now I am really curious…

BR Brandon
Brandon
Member

What we do here is have a different post content background color shown to the user that made the post that only he sees. That’s why you didn’t see it until you saw your own post.

The way we do it is check to see if the post is one the user created and if so echo out a different arrow in the foreground and then use CSS to postion it and change the background of the post.

Here is the code in spTopicView.php just above the sp_PostIndexContent() function.

# Choose/ display Arrow For Users Post
$UserArrow = ‘thread-arrow-author’;
if ($spThisPost->user_id == $spThisUser->ID) $UserArrow = $UserArrow.’CurUser’;            
$UserArrow = $UserArrow.’.gif’;
sp_SectionStart(‘tagClass=spPostContentSection’, ‘content’);
echo ‘<img alt=”” class=”spAuthorArrow” src=”‘.SPTHEMEICONSURL.$UserArrow.'”>’;

sp_PostIndexContent(”, ‘Awaiting Moderation’);

 

What it basically does is change the filename of the echo’d image if the post is made by the user.  So if not made by user it’s thread-arrow-author.gif and if made by user then we add CurUser to the filename and it becomes thread-arrow-authorCurUser.gif.

We use the same CSS class for both arrows to position it.

#spMainContainer .spAuthorArrow

Then change the background color of the content by using

#spMainContainer .spTopicPostContainer .spCurUserPost .spPostSection

What would have to be done for odd/even is a check to see which one it is then echo out the correct arrow. You wouldn’t have to change the content background color CSS but would have to add CSS to position it.

I would need to take a look to see what the best way is to check if odd/even but can’t do so right now I will look this evening.

BR Brandon
Brandon
Member

Following up on this.

I would make 2 arrows. Naming them thread-arrow-author_spOdd.gif and thread-arrow-author_spEven.gif

Put them in your themes /images folder.

Then add this to TopicView.php

# Choose/ display Arrow For Users Post
$rowType = ($spTopicView->currentPost % 2) ? 'spOdd' : 'spEven';
$UserArrow = 'thread-arrow-author_' .$rowType.'.gif';
sp_SectionStart('tagClass=spPostContentSection', 'content');
echo '<img alt="" class="spAuthorArrow" src="'.SPTHEMEICONSURL.$UserArrow.'">';

(The code isp_SectionStart(‘tagClass=spPostContentSection’, ‘content’); is already in the file)

That will echo out foreground display of the arrow and then you can position it using the CSS tips earlier in this topic.

JI jim
jim
Member

Excellent, thank you Brandon. This likes like it certainly should do the trick.

I’m at a conference all weekend but will report back with a link to the final results or any more questions.

Thanks again!

JI jim
jim
Member

Beautiful… this kinda stuff is just magic to me.

http://tripawds.net/forums/technical-support/nothing-to-see-here/

We’ll be implementing this on our live site shortly, just modifying our customized theme to be current with the latest release.

Thanks again!

CE cwwcwi0ecnuwijcowecwreiovuejwcko
cwwcwi0ecnuwijcowecwreiovuejwcko
Member

I have been able to implement thread-arrow-author.gif and thread-arrow-authorCurUser.gif for user post and post made by the currently logged in user.

The only thing I cannot find in this topic of how to change the background color of the current logged in users posts content. The only things colored now are my arrows :D Post content of all posts is #fff (white).

YS Yellow Swordfish
Yellow Swordfish
Member

I believe you need the class .spCurUserPost which is applied to any post made by the user currently viewing a forum topic.