Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Removing the icons inside buttons?
Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 11:19 am

Is there a way to remove the icons inside buttons (mainly "Login"and "Search" buttons) so that the button just shows the text? (Like the Submit, Cancel and Preview Buttons)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 12, 2012 - 11:46 am

Yes indeed. You will need to make some edits to the SP theme templates - both search and login are in the spHead.php template.

For the Login button you will need to locate the function call to sp_LogInOutButton(). By defaulkt it will probably look like this:

sp_LogInOutButton('tagClass=spButton spRight', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

You need to add two arguments for the two different icons like so:

sp_LogInOutButton('tagClass=spButton spRight&logInIcon=&logOutIcon=', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

be careful - note the ampersands and the use of case in the new arguments. They must be entered correctly.

The search is the same - the function is sp_SearchForm() but in this case, there is only one icon and the new argument to be added is icon=

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

andy-signature.png
YELLOW
SWORDFISH
Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 1:31 pm

Okay, LogInOut Button went smoothly. But I'm having trouble understanding the process for the search button

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 12, 2012 - 2:21 pm

I'm sorry - I gave you bad advice. I wasn't thinking straight. Apologies.

The search button is part of the search form so has a different format. Right at the top of the template you will find two form object definitions. The second one is the search form. Locate the icon entry and remove the icon file name. Just leave the two empty single quote marks there.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 3:27 pm

I'm left with a broken image link next to the search. Can you post an example?

Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 4:03 pm

No only that now when I tick "Advance Search" it doesn't drop down, it points to spSearch.png.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 12, 2012 - 4:08 pm

I don't believe this! That is a genuine bug in the code. It isn't dropping the image tag as it is supposed to do if there is no icon defined - like the login button did.
I will make sure that is fixed up quickly. I can post the code here if you want to the make the change

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 12, 2012 - 4:20 pm

I'll do it anyway.

The file is /simple-press/forum/content/sp-common-view-functions.php

The function is sp_SearchForm()

Locate the line of code that starts:

$out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip'.....

And replace it with this block of code:

    $out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip' title='$toolTip' onclick='jQuery(document).ready(function() { spjValidateSearch({$sfglobals['mysql']['search']['min']}); });'>";
    if(!empty($icon)) {
        $out.= "<img class='$iconClass' src='".SPTHEMEICONSURL.$icon."' alt=''/>";
    }
    $out.= "$submitLabel</a>";

Which should do the trick.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 4:34 pm

I saved a copy of the file before the changes, now I'm back to square one after the LogInOut button success. I don't want to changed something important I can fix I'd prefer if you could just post the code needed to change; search, profile, add topic, add reply, and edit. I'm trying to conserve space while keeping the current page format with sidebar.

 

Avatar
Matthew Bonner
Member
Free Members
sp_UserOfflineSmall Offline
Jul 12, 2012 - 5:23 pm

Yellow Swordfish said
I'll do it anyway.

The file is /simple-press/forum/content/sp-common-view-functions.php

The function is sp_SearchForm()

Locate the line of code that starts:

$out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip'.....

And replace it with this block of code:

    $out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip' title='$toolTip' onclick='jQuery(document).ready(function() { spjValidateSearch({$sfglobals['mysql']['search']['min']}); });'>";
    if(!empty($icon)) {
        $out.= "<img class='$iconClass' src='".SPTHEMEICONSURL.$icon."' alt=''/>";
    }
    $out.= "$submitLabel</a>";

Which should do the trick.

laugh Works

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625