PDA

View Full Version : Postbit Legacy Question


Krusty1231
12-07-2013, 04:54 PM
I need a push, as I know what I did is entirely wrong, but it works - just not the way I suspect it SHOULD be done.

In my postbit legacy I added search option to members posts and threads. Works fine.

It looked rather plain to me, so I decided to toss in some images. This is where I think I did it wrong.

It does work, but am hoping someone has a better way of doing this.

Here is what I am using:

<dt>{vb:rawphrase posts}</dt>
<dd><div class="divspoiler"><img src= "/images/postbitposts.png">&nbsp;<a href="search.php?{vb:raw session.sessionurl}do=finduser&amp;userid={vb:raw post.userid}&amp;contenttype=vBForum_Post&amp;showposts=1" title="View {vb:raw post.username}'s posts">{vb:raw post.posts}</a></dd>

<dt>{vb:rawphrase threads}</dt>
<dd><div class="divspoiler"><img src= "/images/post.png">&nbsp;<a href="search.php?{vb:raw session.sessionurl}do=finduser&amp;userid={vb:raw post.userid}&amp;contenttype=vBForum_Threads&amp;showthrea ds=1" title="View {vb:raw post.username}'s startedthreads">{vb:raw thread.threads}{vb:rawphrase find_all_started_threads}</a></dd>

The code in red I tossed in there to make the images appear - and they do, but something is telling me this is not the best way to accomplish this.

The end result looks like the attachment.

Is there a better way I should do this?

Thanks in advance for any replies.

Digital Jedi
12-07-2013, 06:32 PM
I don't see anything inherently wrong with it, other than your code has a few minor errors which would prevent it from validating. You might also want to make the entire image along with the text a link, but that's up to you. Particularly, you'll want to fix that <img> tag:

<dt>{vb:rawphrase threads}</dt>
<dd>
<div class="divspoiler">
<a href="search.php?{vb:raw session.sessionurl}do=finduser&amp;userid={vb:raw post.userid}&amp;contenttype=vBForum_Threads&amp;showthrea ds=1" title="View {vb:raw post.username}'s startedthreads">
<img src="/images/post.png" alt="Some text here to support Readers" border="0" />&nbsp;{vb:raw thread.threads}{vb:rawphrase find_all_started_threads}</a>
</div>
</dd>
Hrm, I just noticed you didn't close out your <div> tags. You'll want to do that, too. And, of course, you might want to tweak your CSS a little if moving the link adds an underline to the image.

Krusty1231
12-07-2013, 09:10 PM
Thank you for the reply.

I tried yours as is, but was confused by the "Some text here to support Readers" part.

When I click on the text to search I get this:

Please add more constraints to your search. Searches that return all or most of the database are a bad idea.

I know I need to change the red part. Not 100% sure on what I need to do there.

Thank you for making the time to reply.

Digital Jedi
12-08-2013, 10:03 PM
Just put anything there that explains what the image is for. alt="" is required, although it can be left empty. But it's useful to include something descriptive about your image for things like search engines, and the visually impaired browsing your site using a Screen Reader.

Other than that, the code should be working as is. Have you closed the <div> tag in both instances? If one is still open, it could be creating some problems.

Krusty1231
12-09-2013, 03:27 AM
Doh! I realized that after I stared at it for a bit. Came back to find your post. I did forget the tag as pointed out.

Thanks again Sir. Works as it should.