Support Forum

Hats off to the Developers!

MO Monkfish
Monkfish
Member

I have just upgraded my version of SF to V5, and would like to show my appreciation for what appears to be a fantastic piece of software!

Congratulations guys – it’s very tidy! laugh

First impressions are that it should be a dream to work with both from an admin point of view, and from a users perspective.

I’m now going to go and try to make some changes and add some plugins – lets see how she goes! kiss

14 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

oooh. Now I do hope nothing goes wrong when you do that!

MO Monkfish
Monkfish
Member

Well whaddya know! It’s all working fine!

Thank you guys for such a wonderful upgrade.

 

Can i ask how i would go about adding in Custom icons? i see the menu link has gone, and there is no plugin? or have i missed it ?

 

Thanks once again!

YS Yellow Swordfish
Yellow Swordfish
Member

Moved to the manage Forums menu.
Check your storage locations as we were unable to move the old custom icons folder so just check it exists and is writable.

MO Monkfish
Monkfish
Member

All my storage location are working fine – but the custom icon menu only allows me to upload an icon – not assign it to a position with a URL?

How do i place custom icons into my theme ?

YS Yellow Swordfish
Yellow Swordfish
Member

Are sorry – assumed you meant for use in forums and groups.
Go to your new SP themes folder for the theme you are using and look at the the templates folder. With a little thought you will find they are pretty straightforward and follow the display of the different forum views.
You can add any php, html into those wherever you like.
As always we recommend you make your own theme to avoid losing customisations in future updates.

MO Monkfish
Monkfish
Member

OK – i submit.

That’s a whole lotta code that is no where near my ability… so i request some assistance please.

I would like to ad an additional button to the right of the member button ( when logged in ) that links to another wp page.

Judging by the code in spHead.php, I would need to add the relevant code under this line (98):

sp_MemberButton(‘tagClass=spButton spRight’, __sp(‘Members’), __sp(‘View the members list’));

But what code would i need to change this to so that I can add a live chat button pointing to a dedicated url elsewhere in my site?

I am thinking along the lines of:

sp_MemberButton(‘tagClass=spButton spRight’, __sp(‘Live Chat’), __sp(‘Enter the chat room’)); 

or something along the lines of:

<a class=’spButton spRight vtip’ id=’spMemberButton’ title=’Enter Live Chat’ href=’http://www.racecraftmag.co.uk/?page_id=133/members’><img class=’spIcon’ src=’http://www.racecraftmag.co.uk/wp-content/sp-resources/forum-themes/default/images/sp_livechat.png’ alt=”/>Live Chat</a>

But how do i add that second line of code into the php of sphead.php file ?

I know this is not right, so some guidance would be much appriciated 🙂

YS Yellow Swordfish
Yellow Swordfish
Member

That raw HTML at the end there is the way to go.

So before the position you want that just close the php tags with a :

?>

and than after the html re-open the php tags with a:

<?php

and it should work.

Except that you will need to put the sp_livechat.png onto that images file. AND you should make your own theme: http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/

MO Monkfish
Monkfish
Member

Thank you swordfish. That has worked a treat!

And i have made my own theme as you have recommended.

Final question.

Would it be possible to only show that custom icon when a member is logged in? Or would that require some coding madness ?

MO Monkfish
Monkfish
Member

Also – as I activated my new theme – i received this error in a popup :

Fatal error: Cannot redeclare spdefault_textdomain() (previously declared in /problem-with-post-edit-buttonome/fearofth/public_html/www.racecraftmag.co.uk/wp-content/sp-resources/forum-themes/default/templates/spFunctions.php:17) in /problem-with-post-edit-buttonome/fearofth/public_html/www.racecraftmag.co.uk/wp-content/sp-resources/forum-themes/racecraft/templates/spFunctions.php on line 18

It contiunued to work – but to test i changed the theme back to default and got this error :

Fatal error: Cannot redeclare spdefault_textdomain() (previously declared in /problem-with-post-edit-buttonome/fearofth/public_html/www.racecraftmag.co.uk/wp-content/sp-resources/forum-themes/racecraft/templates/spFunctions.php:17) in /problem-with-post-edit-buttonome/fearofth/public_html/www.racecraftmag.co.uk/wp-content/sp-resources/forum-themes/default/templates/spFunctions.php on line 18

But again the theme continues to work – apparently all ok? Though you should know 🙂

BR Brandon
Brandon
Member

The error is nothing big but it is caused by not editing the functions template to change localization on your new theme. It will still run fine.

See here, step 5, on changing that.

Regarding the making a new button and that html.

This should work for you and may be easier.

sp_MemberButton(‘tagClass=spButton spRight&link=”racecraftmag.co.uk/?page_id=133/members”&icon=”sp_livechat.png” ‘, __sp(‘Live Chat’), __sp(‘Enter the chat room’));

 

That function checks to see if the user can view the members list so your button would only be shown if they can.

You may want to create a completely new button that way you can customize further or use the same function and have buttons that can be placed anywhere in the forum.

You could create a new function in your theme’s spFunctions.php (in /template folder)

Call it any button.

function sp_AnyButton($args=”, $label=”, $toolTip=”) {

# Check if logged in if not don’t show.
if (is_user_logged_in() !=  true) return;
    global $sfvars;
    $defs = array(‘tagId’         => ‘spAnyButton’,
                  ‘tagClass’     => ‘spButton’,
                  ‘link’         => ‘../’,
                  ‘icon’         => ‘sp_AnyButton.png’,
                  ‘iconClass’    => ‘spIcon’,
                  ‘echo’        => 1,
                  );
    $a = wp_parse_args($args, $defs);
    $a = apply_filters(‘sph_AnyButton_args’, $a);
    extract($a, EXTR_SKIP);

    # sanitize before use
    $tagId        = esc_attr($tagId);
    $tagClass    = esc_attr($tagClass);
    $link        = esc_url($link);
    $icon        = sanitize_file_name($icon);
    $iconClass     = esc_attr($iconClass);
    $toolTip    = esc_attr($toolTip);
    $echo        = (int) $echo;

    $out = “<a class=’$tagClass vtip’ id=’$tagId’ title=’$toolTip’ href=’$link’>”;
    if (!empty($icon)) $out.= “<img class=’$iconClass’ src='”.SPTHEMEICONSURL.$icon.”‘ alt=”/>”;
    if (!empty($label)) $out.= sp_filter_title_display($label);
    $out.= ‘</a>’;
    $out = apply_filters(‘sph_AnyButton’, $out, $a);

    if ($echo) {
        echo $out;
    } else {
        return $out;
    }

Then put this where you want it.

sp_AnyButton(‘tagClass=spButton spRight&link=”PageToGoTo” ‘, __sp(‘Any Button’), __sp(‘Any Button Text’));

MO Monkfish
Monkfish
Member

Hey Brandon – thank you for the information.

The localisation worked, and the first snippet of code works like a dream – but second addition of “any button” doesn’t work.

 

I added the code as you pointed out – changed the references of “Any Button” to the correct term and uploaded, but got a syntax error.

I then re-checked, and after pasting the code into the functions file again – it is giving me a syntax error on line 68 – at the end of the page.

This is don’t understand, as it is saying the close tag – ?> – is incorrect, but that was in the page to begin with.

Any ideas ?

MP Mr Papa
Mr Papa
Member

the routine is missing the closing }…

Add it before the ?>

MO Monkfish
Monkfish
Member

Awesome. Thanks papa – I shall ad that into my theme 🙂