Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Sub forum icons
Avatar
Meztli
Sweden
Member
sp_UserOfflineSmall Offline
Feb 13, 2014 - 4:40 pm

Yellow Swordfish said
OK - I will give it a try... there are two files involved.

1 - /simple-press/forum/content/classes/sp-forum-view-class.php

1.1 - at line 479 locate this line of code:

<br />

$f[$forumid]->forum_icon = sanitize_file_name($r->forum_icon);

<br />

and add below it:

<br />

$f[$forumid]->forum_icon_new = sanitize_file_name($r->forum_icon_new);

<br />

1.2 - at line 545 locate this line of code:

<br />

$f[$fidx]->subforums[$sub->forum_id]->forum_icon = sanitize_file_name($sub->forum_icon);

<br />

and add below it:

<br />

$f[$fidx]->subforums[$sub->forum_id]->forum_icon_new = sanitize_file_name($sub->forum_icon_new);

<br />

1.3 - at line 695 locate this line of code:

<br />

$spdb->fields = 'forum_id, forum_name, forum_slug, forum_desc, forum_seq, forum_status, forum_disabled, forum_icon, topic_icon, topic_icon_new, forum_rss_private, post_id, post_id_held, topic_count, post_count, post_count_held, parent, children';

<br />

and add the following text after 'forum_icon' along with the necessary comma:

<br />

forum_icon_new,

<br />

2 - /simple-press/forum/content/sp-forum-view-functions.php

2.1 Locate the block of code between lines 88 and 97. These start with the line:

<br />

if (!empty($spThisSubForum->forum_icon)) {

<br />

and end with the line:

<br />

$out = "[Image Can Not Be Found]
";

<br />

Replace the whole block of code with:

<br />

$path = SPTHEMEICONSDIR;
$url = SPTHEMEICONSURL;
if($spThisSubForum->unread) {
    $fIcon = sanitize_file_name($iconUnread);
    if (!empty($spThisSubForum->forum_icon_new)) {
        $fIcon = sanitize_file_name($spThisSubForum->forum_icon_new);
        $path = SFCUSTOMDIR;
        $url = SFCUSTOMURL;
    }
} else {
    $fIcon = sanitize_file_name($icon);
    if (!empty($spThisSubForum->forum_icon)) {
        $fIcon = sanitize_file_name($spThisSubForum->forum_icon);
        $path = SFCUSTOMDIR;
        $url = SFCUSTOMURL;
    }
}
if(!file_exists($path.$fIcon)) {
    $fIcon = SPTHEMEICONSURL.sanitize_file_name($icon);
} else {
    $fIcon = $url.$fIcon;
}
if ($get) return $fIcon;
$out = "[Image Can Not Be Found]
";

<br />

and all being well that should do...

Hello Guys,

Is this fix included in the latest update?

Just want to be 100% sure. :)

Cheers

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 13, 2014 - 9:36 pm

yes it is...

Avatar
Meztli
Sweden
Member
sp_UserOfflineSmall Offline
Feb 14, 2014 - 4:10 am

Mr Papa said
yes it is...

Great, thanks!

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 14, 2014 - 10:48 am

you are welcome...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
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: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626