Thread: Mini Mods - Icons for UserCP Navigation 1.2
View Single Post
  #234  
Old 01-09-2009, 05:44 PM
Hugo Holbling Hugo Holbling is offline
 
Join Date: Sep 2007
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nascartr View Post
Do you mind sharing how you edited your drop down menus to show icons? Thanks!
Sure. The basic idea is to just add this code to every vbmenu_option you want to show an icon:

Code:
<img src="$stylevar[imgdir_misc]/usercp_icons/**image_goes_here**.png">&nbsp;
... where your image selection replaces "**image_goes_here**", obviously. For example, if you want to edit the Quick Links menu then edit the navbar template. The first item in the menu is "Today's Posts".

Find:

Code:
<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
Replace with:

Code:
<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><img src="$stylevar[imgdir_misc]/usercp_icons/page_white_copy.png">&nbsp;<a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
The bolded part is what was added and it has "page_white_copy.png" because that's the famfamfam silk icon I chose to represent "Today's Posts"; you might want to use something else. Obviously each of the icons you use has to be uploaded to images/misc/usercp_icons.

You repeat this for each instance and you can do this for literally every drop-down menu option, which is what I have for all of my navbar and for every other drop-down. I've attached an image of my search and PM drop-downs as other examples. It might be overkill for other people but I like how it looks.

One thing to note is that if you have any modifications that automatically insert menu options on your navbar or in the Quick Links menu then you need to add the icon code to those also. For example, if you have vB Blog and you opt for a link in your navbar, this is the blog_navbar_link template:

Code:
<tr>
	<td class="thead">$vbphrase[search_blogs]</td>
</tr>
<tr>
	<td class="vbmenu_option" title="nohilite">
		<form action="blog_search.php?$session[sessionurl]do=dosearch" method="post">
			<input type="hidden" name="s" value="$session[sessionhash]" />
			<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
			<input type="hidden" name="do" value="dosearch" />
			<input type="hidden" name="quicksearch" value="1" />
			<div><input type="text" class="bginput" name="text" size="25" tabindex="2003" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="2004" /></div>
		</form>
	</td>
</tr>
<if condition="$vboptions[vbblog_tagging]">
<tr>
	<td class="vbmenu_option"><a href="blog_tag.php$session[sessionurl_q]" rel="nofollow">$vbphrase[tag_search]</a></td>
</tr>
</if>
<tr>
	<td class="vbmenu_option"><a href="blog_search.php?$session[sessionhash]do=search">$vbphrase[advanced_search]</a></td>
</tr>
You can then add the icon code in two places so it then looks something like this:

Code:
<tr>
	<td class="thead">$vbphrase[search_blogs]</td>
</tr>
<tr>
	<td class="vbmenu_option" title="nohilite">
		<form action="blog_search.php?$session[sessionurl]do=dosearch" method="post">
			<input type="hidden" name="s" value="$session[sessionhash]" />
			<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
			<input type="hidden" name="do" value="dosearch" />
			<input type="hidden" name="quicksearch" value="1" />
			<div><input type="text" class="bginput" name="text" size="25" tabindex="2003" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="2004" /></div>
		</form>
	</td>
</tr>
<if condition="$vboptions[vbblog_tagging]">
<tr>
	<td class="vbmenu_option"><img src="$stylevar[imgdir_misc]/usercp_icons/tag.png">&nbsp;<a href="blog_tag.php$session[sessionurl_q]" rel="nofollow">$vbphrase[tag_search]</a></td>
</tr>
</if>
<tr>
	<td class="vbmenu_option"><img src="$stylevar[imgdir_misc]/usercp_icons/cog.png">&nbsp;<a href="blog_search.php?$session[sessionhash]do=search">$vbphrase[advanced_search]</a></td>
</tr>
Again, the bold part is what I added and you may prefer to use different icons.

If it would help, maybe I can put together all my edits and release them here or separately. I don't make any pretense of this code being good or optimal; it just works for me on a small forum.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01215 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete