News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Menu Icons

Started by Mick., December 13, 2010, 05:13:55 PM

Previous topic - Next topic

skotinos

#120
it is in  Forum Menu blok  of simplePortal

Kindred

you're still missing my point. :(

I would suggest checking with the simpleportal support...   it looks like the setting for the home menu item is mis-set
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

skotinos

 :o ok , Thank you.  ::)

C4G-TK

Very nice mod.  Can't wait to add this to two of my forums and to create an image for your MemberMap mod, too!

YOU DA MAN! 8)


-img removed-

C4G-TK

#124
@bluedevil

I truly hate asking this.  I just read through the 7 pages and have added three icons to my menu. 


1)  I have one of your previous mods (Google Member Map) installed and it doesn't make any edits in the Subs.php file or the index.template.php.  How do I go about putting an icon next to the words "Member Map"


2)  I also have AEVA Media installed.

The original code for title has a lot more info in it then most of the other examples you gave.

'title' => (isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media') . (!allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? '' : ' [<b>' . $user_info['aeva_unseen'] . '</b>]'),

I did get it to work by using the following and this is how I currently have it in my Subs

'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/monitor.png" alt="'.$txt['aeva_gallery']. '"/>&nbsp; ' .  $txt['aeva_gallery'],

But, I'm assuming I need to put the added code back in there.  Every time I try to add it, I get a white page when I refresh the site.  So, how do I incorporate the rest of the line which is:

: 'Media') . (!allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? '' : ' [<b>' . $user_info['aeva_unseen'] . '</b>]'),

-img removed-

Mick.

If youre using my google member map and not Spuds', find this:

in Subs.php

Find:
// Google Maps Mod
'googlemap' => array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => $modSettings['googleMapsEnable'] && allowedTo('googleMap_view'),
'sub_buttons' => array(
),
),


and replace with:
// Google Maps Mod
'googlemap' => array(
'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/yourimage.png" alt="'.$txt['googleMap']. '"/>&nbsp; ' . $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => $modSettings['googleMapsEnable'] && allowedTo('googleMap_view'),
'sub_buttons' => array(
),
),



Make sure you replace 'yourimage.png' with yours.

C4G-TK

I'm using Spuds most recent package.  :(

-img removed-

Mick.

Quote from: C4G-TK on June 23, 2011, 05:36:22 PM
I'm using Spuds most recent package.  :(

You may want to ask him. I think he may be using hooks. I parsed the mod and i didnt see any edits in Subs.php

C4G-TK

Yeah, there's no edits in Subs.  I went ahead and posted in his thread to look over here.  Thanks bluedevil!

-img removed-

C4G-TK

#129
OK, I have 4 out of 5 images done and this one is just stumping me.

According to Spuds, I need to go to sources/GoogleMap20Integration.php for the following:

$new_menu = array(
'googlemap' => array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
'sub_buttons' => array(),
)
);



I changed the 'title' line to the following

'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/map.png" alt="'.$txt['googleMap']. '"/>&nbsp; ' . $txt['googleMap'],

saved, uploaded the file, copied over the previous version... and it isn't working.

I've cleared the forum cache and my browser cache and even did a hard refresh.  I checked in the mennu icons folder for my image thinking that was the reason why it isn't showing up, but the image is there plain as day like the other 4 images I got to work.  What am I doing wrong now?

This is my code from the file he said to use.

// Define the new menu item(s)
$new_menu = array(
'googlemap' => array(
'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/map.png" alt="'.$txt['googleMap']. '"/>&nbsp; ' . $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
'sub_buttons' => array(),
)


and from the pictures below you can see...
A) the image is in the folder
and B) the word Member Map is now shown twice


I obviously don't have the right code because I'm getting an error in the error log for that line saying:

http://www.respawnwilmington.com/index.php?action=admin;area=maintain;sa=routine;activity=cleancache
8: Undefined variable: settings
File: /home/respawnw/public_html/Sources/GoogleMap20Integration.php



-img removed-

Kindred

declare $settings as a global in the mod function.

The code IS actually working, since you have the alt text displaying because it can't find the image
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

C4G-TK

Quote from: Kindred on June 24, 2011, 07:42:18 AM
declare $settings as a global in the mod function.

The code IS actually working, since you have the alt text displaying because it can't find the image

Ok, so, I put $settings in this line and it worked.

global $txt, $scripturl, $modSettings, $settings;

Shows up fine now!  Woohoo!  Thanks, Kindred.




So, for adding Google Member Map to Menu Icon do this:

in GoogleMap20Integration.php

find:
global $txt, $scripturl, $modSettings;

replace with:
global $txt, $scripturl, $modSettings, $settings;


find:
'title' => $txt['googleMap'],

replace with:
'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/imagename.png" alt="'.$txt['googleMap']. '"/>&nbsp; ' . $txt['googleMap'],

remember to replace "imagename"


-img removed-

Jorge D. Fuentes

LOVE this.

However, since I also have the Aeva Media, the Google Member Map, and the Tag mods, some of the menu items (the ones corresponding to these mods) do not have their own little icon, so it looks slightly weird.  But yes, totally awesome-looking.  Gonna have to change the icons to match my theme though.  No biggie.

C4G-TK

Quote from: Jorge D. Fuentes on July 06, 2011, 02:20:46 PM
LOVE this.

However, since I also have the Aeva Media, the Google Member Map, and the Tag mods, some of the menu items (the ones corresponding to these mods) do not have their own little icon, so it looks slightly weird.  But yes, totally awesome-looking.  Gonna have to change the icons to match my theme though.  No biggie.

I added what you need to do for the Google Member Map above. (with help from Kindred and Spuds)

Also, I have it working for AEVA, so if you need any help let me know.  I normally check boards where I've posted.

-img removed-

Siirist

Hello,
This is NOT sanctioned by the Mod author, it was discovered by trial and error.
ALWAYS remember to BACK-UP BEFORE MODIFYING your forum!

Here's what I did.


A) Find an icon you want to use
B) Back-up your forum
C) Go to your host's File Manager
D) Locate and open ..(your directory)/Sources/Subs.php
E) Highlight all and save to a text program (ie, MS Notepad, MS Word, Notepad++, etc.) "Subs-works-08-01-11( <--date ).php.
This is your safety net.
F) Use "Find" (usually "Ctrl+F") to locate the menu item "Help" (this gives you an example of how the code is written)
G) Highlight and then copy it to your computer's clipboard (see example of code below)
H) Paste it into a text program (ie, MS Notepad, MS Word, Notepad++, etc.)
--> The example does NOT have sub menus, I will not be including how to add icons to sub menu items. <--
I) Use "Find" to locate the menu item you want to add the icon to (ie, "Notepad", "My Bookmarks", etc.)
J) Copy the code you had previously gotten as an example.
K) Highlighted the code (see example of code "A" below)
L) Paste over what you had highlighted
M) Modify the name (ie [help] to [notepad] or [bookmarks] (see Code "B" below)
N) Modify the image source (path to the image) accordingly. (see Code "B" below)
O) Save the Subs.php
P) Upload the images to ..(your directory)/Themes/default/(name of image here)
Remember that the image is ONLY 16 pixels by 16 pixels AND is in the *.png format
NOTE: As I added Menu_Icons to all my themes, I uploaded to "all my themes".

You're done.
Enjoy
Remember, if it doesn't work, you can go back and upload "Subs-works-08-01-11( <--date ).php to ..(your directory)/Sources

Mod Author / bluedevil feel free to Delete / Modify / Sticky as you wish.

Be Well,
Cloud  8)


Code "A"

'help' => array(
'title' => '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/help.png" alt="'.$txt['help']. '"/>&nbsp; ' . $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),


Code "B"

'bookmarks' => array(
'title' =bookmarks> '<img align="absMiddle" src="'. $settings['images_url']. '/menu_icons/bookmark.png" alt="'.$txt['help']. '"/>&nbsp; ' . $txt['bookmarks'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),

Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

thanks Cloud... and I don't intend any offense, but we've already given those same instructions 4 or 5 times in this thread....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

Quote from: Kindred on August 01, 2011, 11:45:56 AM
thanks Cloud... and I don't intend any offense, but we've already given those same instructions 4 or 5 times in this thread....

None taken. :)

You are like a SMF God to me. ;D

Perhaps I used different wording that will "click" with some.  :P

Wishing You The Best,  ;)
Cloud  8)
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Mick.

Looks good to me Cloud ;)

Siirist

Quote from: bluedevil on August 01, 2011, 04:35:29 PM
Looks good to me Cloud ;)

Thanks bluedevil,  :D
I tried to be thorough in my disclaimers.  LOL
:laugh:
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Advertisement: