Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 12-07-2013, 04:54 PM
Krusty1231's Avatar
Krusty1231 Krusty1231 is offline
 
Join Date: Jul 2010
Location: Canada
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Postbit Legacy Question

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:

Code:
<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>
Code:
<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;showthreads=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.
Attached Images
File Type: jpg Untitled.jpg (41.8 KB, 0 views)
Reply With Quote
  #2  
Old 12-07-2013, 06:32 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Code:
<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;showthreads=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.
Reply With Quote
Благодарность от:
Krusty1231
  #3  
Old 12-07-2013, 09:10 PM
Krusty1231's Avatar
Krusty1231 Krusty1231 is offline
 
Join Date: Jul 2010
Location: Canada
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Quote:
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.
Reply With Quote
  #4  
Old 12-08-2013, 10:03 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just put anything there that explains what the image is for. [minicode]alt=""[/minicode] 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.
Reply With Quote
  #5  
Old 12-09-2013, 03:27 AM
Krusty1231's Avatar
Krusty1231 Krusty1231 is offline
 
Join Date: Jul 2010
Location: Canada
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05425 seconds
  • Memory Usage 2,219KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (1)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete